Class RGL::DirectedAdjacencyGraph
In: lib/rgl/adjacency.rb
Parent: Object

Methods

Included Modules

MutableGraph

Public Class methods

Shortcut for creating a DirectedAdjacencyGraph:

 RGL::DirectedAdjacencyGraph[1,2, 2,3, 2,4, 4,5].edges.to_a.to_s =>
   "(1-2)(2-3)(2-4)(4-5)"

Returns a new empty DirectedAdjacencyGraph which has as its edgelist class the given class. The default edgelist class is Set, to ensure set semantics for edges and vertices.

Public Instance methods

See MutableGraph#add_vertex.

If the vertex is already in the graph (using eql?), the method does nothing.

Returns true.

Iterator for the keys of the vertice list hash.

Complexity is O(1), if a Set is used as adjacency list. Otherwise, complexity is O(out_degree(v)).


MutableGraph interface.

Complexity is O(1), because the vertices are kept in a Hash containing as values the lists of adjacent vertices of v.

See MutableGraph::remove_edge.

Protected Instance methods

[Validate]