Class: RGL::BellmanFordVisitor

### Home Classes Methods

### In Files

- lib/rgl/bellman_ford.rb

### Parent

DijkstraVisitor

### Methods

- ::new

### 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::BellmanFordVisitor

Bellman-Ford shortest paths algorithm has the following event points:

    * examine_edge
    * edge_relaxed
    * edge_not_relaxed
    * edge_minimized
    * edge_not_minimized

### Public Class Methods

new(graph) click to toggle source

    # File lib/rgl/bellman_ford.rb, line 22
    def initialize(graph)
      super(graph)

      # by default, through an exception if a negative-weight cycle is detected
      @edge_not_minimized_event_handler = lambda do |u, v|
        raise ArgumentError.new("there is a negative-weight cycle including edge (#{u}, #{v})")
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.