COIN-OR::LEMON - Graph Library

Changeset 1007:e24922c56bc2 in lemon


Ignore:
Timestamp:
09/22/10 08:53:09 (9 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
1008:b7ed95cd94a3, 1009:c85f53572941, 1010:1861d5dcf312, 1011:1937b6455b7d, 1067:54464584b157
Phase:
public
Message:

Bug fix in Dfs::start(s,t) (#392)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/dfs.h

    r319 r1007  
    559559    void start(Node t)
    560560    {
    561       while ( !emptyQueue() && G->target(_stack[_stack_head])!=t )
     561      while ( !emptyQueue() && !(*_reached)[t] )
    562562        processNextArc();
    563563    }
     
    15121512    /// with addSource() before using this function.
    15131513    void start(Node t) {
    1514       while ( !emptyQueue() && _digraph->target(_stack[_stack_head]) != t )
     1514      while ( !emptyQueue() && !(*_reached)[t] )
    15151515        processNextArc();
    15161516    }
  • test/dfs_test.cc

    r293 r1007  
    5151  "@attributes\n"
    5252  "source 0\n"
    53   "target 5\n";
     53  "target 5\n"
     54  "source1 6\n"
     55  "target1 3\n";
     56
    5457
    5558void checkDfsCompile()
     
    145148  Digraph G;
    146149  Node s, t;
     150  Node s1, t1;
    147151
    148152  std::istringstream input(test_lgf);
     
    150154    node("source", s).
    151155    node("target", t).
     156    node("source1", s1).
     157    node("target1", t1).
    152158    run();
    153159
     
    176182
    177183  {
     184  Dfs<Digraph> dfs(G);
     185  check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
     186  }
     187 
     188  {
    178189    NullMap<Node,Arc> myPredMap;
    179190    dfs(G).predMap(myPredMap).run(s);
Note: See TracChangeset for help on using the changeset viewer.