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 91 def distance_to_root(v) 92 @distance_map[v] 93 end
handle_tree_edge(u, v)
click to toggle source
Calls superclass method
# File lib/rgl/graph_visitor.rb 84 def handle_tree_edge(u, v) 85 super 86 @distance_map[v] = @distance_map[u] + 1 87 end