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