Class: RGL::BipartiteBFSIterator

### Home Classes Methods

### In Files

- lib/rgl/bipartite.rb

### Parent

RGL::BFSIterator

### Methods

- #handle_back_edge
- #handle_forward_edge
- #handle_tree_edge
- #reset
- #reset_start
- #set_to_begin

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

### Attributes

bipartite_sets_map[R]
found_odd_cycle[R]

### Public Instance Methods

handle_back_edge(u, v) click to toggle source

    # File lib/rgl/bipartite.rb, line 70
    def handle_back_edge(u, v)
      verify_odd_cycle(u, v)
    end

handle_forward_edge(u, v) click to toggle source

    # File lib/rgl/bipartite.rb, line 74
    def handle_forward_edge(u, v)
      verify_odd_cycle(u, v)
    end

handle_tree_edge(u, v) click to toggle source

    # File lib/rgl/bipartite.rb, line 66
    def handle_tree_edge(u, v)
      @bipartite_sets_map[v] = (@bipartite_sets_map[u] + 1) % 2 unless u.nil?  # put v into the other set
    end

reset() click to toggle source

    # File lib/rgl/bipartite.rb, line 48
    def reset
      super

      @bipartite_sets_map = {}
      @found_odd_cycle = false
    end

reset_start(new_start) click to toggle source

    # File lib/rgl/bipartite.rb, line 61
    def reset_start(new_start)
      @start_vertex = new_start
      set_to_begin
    end

set_to_begin() click to toggle source

    # File lib/rgl/bipartite.rb, line 55
    def set_to_begin
      super

      @bipartite_sets_map[@start_vertex] = 0
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.