COIN-OR::LEMON - Graph Library

Changeset 167:7949a29a334e in lemon-0.x for src/work/jacint/dijkstra.h


Ignore:
Timestamp:
03/11/04 13:55:50 (17 years ago)
Author:
jacint
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@238
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/jacint/dijkstra.h

    r160 r167  
    33 *template <Graph, T, Heap=FibHeap>
    44 *
    5  *
    65 *Constructor:
    76 *
    87 *Dijkstra(Graph G, NodeIt s, Graph::EdgeMap<T> length)
    9  *
    108 *
    119 *
     
    1614 *  The following function should be used after run() was already run.
    1715 *
    18  *
    1916 *T dist(NodeIt v) : returns the distance from s to v.
    2017 *   It is 0 if v is not reachable from s.
    21  *
    2218 *
    2319 *EdgeIt pred(NodeIt v) : returns the last edge
    2420 *   of a shortest s-v path. Returns an invalid iterator
    2521 *   if v=s or v is not reachable from s.
    26  *
    2722 *
    2823 *bool reach(NodeIt v) : true iff v is reachable from s
     
    7772          NodeIt v=heap.top();
    7873          T oldvalue=heap.get(v);
     74          heap.pop();
    7975          distance.set(v, oldvalue);
    80           heap.pop();
    81          
     76
    8277          OutEdgeIt e;
    8378          for( G.getFirst(e,v); G.valid(e); G.next(e)) {
     
    8984                heap.push(w,oldvalue+length.get(e));
    9085                predecessor.set(w,e);
    91 
    9286              } else if ( oldvalue+length.get(e) < heap.get(w) ) {
    9387                predecessor.set(w,e);
     
    115109        return reached.get(v);
    116110      }
    117 
     111     
    118112    };
    119 
     113 
    120114}
    121115
Note: See TracChangeset for help on using the changeset viewer.