COIN-OR::LEMON - Graph Library

Ticket #392: 392-dfs-bugfix.patch

File 392-dfs-bugfix.patch, 895 bytes (added by Peter Kovacs, 14 years ago)
  • lemon/dfs.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1285099984 -7200
    # Node ID 0f1b10ef79b78aad6bfc4c6ef34e1357591957cf
    # Parent  bb871cb8ac0664d5db95721a1d678d604762a3c2
    Bug fix in Dfs::start(s,t) (#392)
    
    diff --git a/lemon/dfs.h b/lemon/dfs.h
    a b  
    558558    ///added with addSource() before using this function.
    559559    void start(Node t)
    560560    {
    561       while ( !emptyQueue() && G->target(_stack[_stack_head])!=t )
     561      while ( !emptyQueue() && !(*_reached)[t] )
    562562        processNextArc();
    563563    }
    564564
     
    15111511    /// \pre init() must be called and a root node should be added
    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    }
    15171517