Module: RGL::GraphVisitor::DistanceMapSupport

### Home Classes Methods

### In Files

- lib/rgl/graph_visitor.rb

### Methods

- #distance_to_root
- #handle_tree_edge

### Class/Module Index

Quicksearch

- RGL
- RGL::AdjacencyGraph
- RGL::BFSIterator
- RGL::BellmanFordAlgorithm
- RGL::BellmanFordVisitor
- RGL::BidirectionalGraph
- RGL::BipartiteBFSIterator
- RGL::DFSIterator
- RGL::DFSVisitor
- RGL::DOT
- RGL::DOT::Digraph
- RGL::DOT::DirectedEdge
- RGL::DOT::Edge
- RGL::DOT::Element
- RGL::DOT::Graph
- RGL::DOT::Node
- RGL::DOT::Port
- RGL::DOT::Subgraph
- RGL::DijkstraAlgorithm
- RGL::DijkstraVisitor
- RGL::DirectedAdjacencyGraph
- RGL::Edge
- RGL::Edge::DirectedEdge
- RGL::Edge::UnDirectedEdge
- RGL::EdgePropertiesMap
- RGL::EdmondsKarpAlgorithm
- RGL::EdmondsKarpAlgorithm::EdmondsKarpBFSIterator
- RGL::Graph
- RGL::Graph::TarjanSccVisitor
- RGL::GraphIterator
- RGL::GraphVisitor
- RGL::GraphVisitor::ClassMethods
- RGL::GraphVisitor::DistanceMapSupport
- RGL::ImplicitGraph
- RGL::MutableGraph
- RGL::MutableGraph::MutableGraphParser
- RGL::NoEdgeError
- RGL::NoVertexError
- RGL::NonNegativeEdgePropertiesMap
- RGL::NotDirectedError
- RGL::NotUndirectedError
- RGL::PrimAlgorithm
- RGL::TopsortIterator
- Enumerable
- Object

No matching classes.

# 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

    # File lib/rgl/graph_visitor.rb, line 84
    def handle_tree_edge(u, v)
      super
      @distance_map[v] = @distance_map[u] + 1
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.