COIN-OR::LEMON - Graph Library

Changeset 549:5531429143bc in lemon-0.x for src/work/marci/bfs_dfs_misc.h


Ignore:
Timestamp:
05/06/04 17:10:48 (16 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@722
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/bfs_dfs_misc.h

    r548 r549  
    2020      if (!reached[n]) {
    2121        bfs.pushAndSetReached(n);
    22         bool_map.set(n, false) {
    23           while (!bfs.finished()) {
    24             if (bfs.isBNodeNewlyReached()) {
    25               bool_map.set(bfs.bNode())=!bfs.aNode();
    26             } else {
    27               if (bool_map[bfs.bNode()]==bool_map[bfs.aNode()]) {
    28                 return false;
    29               }
     22        bool_map.set(n, false);
     23        while (!bfs.finished()) {
     24          if (bfs.isBNodeNewlyReached()) {
     25            bool_map.set(bfs.bNode())=!bfs.aNode();
     26          } else {
     27            if (bool_map[bfs.bNode()]==bool_map[bfs.aNode()]) {
     28              return false;
    3029            }
    31             ++bfs;
    3230          }
     31          ++bfs;
    3332        }
    3433      }
    3534    }
     35   
    3636    return true;
    3737  }
     
    3939  /// experimental topsort,
    4040  /// I think the final version will work as an iterator
     41  /// if the graph is not a acyclic, the na pre-topological order is obtained
     42  /// (see Schrijver's book)
    4143  template<typename Graph>
    42   void topSort(Graph& g, std::list<typename Graph::Node>& l) {
     44  void topSort(const Graph& g, std::list<typename Graph::Node>& l) {
    4345    l.clear();
    4446    typedef typename Graph::template NodeMap<bool> ReachedMap;
Note: See TracChangeset for help on using the changeset viewer.