lib/rgl/bidirectional_adjacency.rb in rgl-0.6.1 vs lib/rgl/bidirectional_adjacency.rb in rgl-0.6.2

- old
+ new

@@ -20,12 +20,14 @@ def initialize(edgelist_class = Set, *other_graphs) @reverse = DirectedAdjacencyGraph.new(edgelist_class) super(edgelist_class, *other_graphs) end - # We don't need to override add_vertex() because the reverse graph doesn't need to - # contain any unconnected vertices. Vertices will be added by add_edge() as - # required. + # @see MutableGraph#add_vertex. + def add_vertex(v) + super(v) + @reverse.add_vertex(v) + end # @see MutableGraph#add_edge. def add_edge(u, v) super(u, v) @reverse.add_edge(v, u)