module RGL::GraphVisitor::DistanceMapSupport
Public Instance Methods
distance_to_root(v)
click to toggle source
Answer the distance to the start vertex.
# File lib/rgl/graph_visitor.rb, line 91 def distance_to_root(v) @distance_map[v] end
handle_tree_edge(u, v)
click to toggle source
Calls superclass method
# File lib/rgl/graph_visitor.rb, line 84 def handle_tree_edge(u, v) super @distance_map[v] = @distance_map[u] + 1 end