Class: GRATR::DirectedMultiGraph

Inherits:
Digraph
  • Object
show all
Defined in:
lib/gratr/digraph.rb

Overview

This is a Digraph that allows for parallel edges and loops

Instance Method Summary collapse

Methods inherited from Digraph

#balanced?, #delta, #directed?, #edge_class, #oriented?, #reversal

Methods included from Graph::ChinesePostman

#closed_chinese_postman_tour

Methods included from Graph::Distance

#bellman_ford_moore, #dijkstras_algorithm, #floyd_warshall, #shortest_path

Methods included from Graph::StrongComponents

#condensation, #strong_components, #transitive_closure, #transitive_closure!

Methods included from Graph::Search

#acyclic?, #astar, #best_first, #bfs, #bfs_spanning_forest, #bfs_tree_from_vertex, #cyclic?, #dfs, #dfs_spanning_forest, #dfs_tree_from_vertex, #lexicograph_bfs, #method_missing, #pre_search_method_missing, #spanning_forest, #topsort, #tree_from_vertex

Methods included from AdjacencyGraph

#add_edge!, #add_vertex!, #adjacent, #edge?, #edges, #graph_adjacent, included, #remove_edge!, #remove_vertex!, #vertex?, #vertices

Methods included from Graph

#dotty, #to_dot, #to_dot_graph, #write_to_graphic_file

Constructor Details

#initialize(*params) ⇒ DirectedMultiGraph

Returns a new instance of DirectedMultiGraph.

Raises:

  • (ArgumentError)


107
108
109
110
111
112
# File 'lib/gratr/digraph.rb', line 107

def initialize(*params)
  raise ArgumentError if params.any? do |p| 
   !(p.kind_of? GRATR::Graph or p.kind_of? Array)
  end
  super(:parallel_edges, :loops, *params)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GRATR::Graph::Search