COIN-OR::LEMON - Graph Library

Changeset 774:4297098d9677 in lemon-0.x for src/hugo/dijkstra.h


Ignore:
Timestamp:
08/30/04 14:01:47 (17 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1066
Message:

Merge back the whole branches/hugo++ to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/dijkstra.h

    r758 r774  
    8585    bool local_distance;
    8686
     87    //The source node of the last execution.
     88    Node source;
     89
    8790    ///Initialize maps
    8891   
     
    213216      init_maps();
    214217     
    215       for ( NodeIt u(*G) ; G->valid(u) ; G->next(u) ) {
     218      source = s;
     219     
     220      for ( NodeIt u(*G) ; u!=INVALID ; ++u ) {
    216221        predecessor->set(u,INVALID);
    217222        pred_node->set(u,INVALID);
     
    236241       
    237242       
    238         for(OutEdgeIt e(*G,v); G->valid(e); G->next(e)) {
    239           Node w=G->bNode(e);
     243        for(OutEdgeIt e(*G,v); e!=INVALID; ++e) {
     244          Node w=G->head(e);
    240245         
    241246          switch(heap.state(w)) {
     
    311316
    312317    ///Returns \c true if \c v is reachable from the root.
    313     ///\warning the root node is reported to be unreached!
    314     ///\todo Is this what we want?
     318    ///\warning the root node is reported to be reached!
    315319    ///\pre \ref run() must be called before using this function.
    316320    ///
    317     bool reached(Node v) { return G->valid((*predecessor)[v]); }
     321    bool reached(Node v) { return v==source || (*predecessor)[v]==INVALID; }
    318322   
    319323  };
Note: See TracChangeset for help on using the changeset viewer.