src/work/jacint/dijkstra.h
changeset 217 fc549fac0dd0
parent 211 9222a9b8b323
child 220 7deda4d6a07a
     1.1 --- a/src/work/jacint/dijkstra.h	Sat Mar 20 16:10:26 2004 +0000
     1.2 +++ b/src/work/jacint/dijkstra.h	Sat Mar 20 16:13:19 2004 +0000
     1.3 @@ -45,7 +45,9 @@
     1.4      const LengthMap& length;
     1.5      typename Graph::NodeMap<Edge> predecessor;
     1.6      typename Graph::NodeMap<T> distance;
     1.7 +    //FIXME:
     1.8      typename Graph::NodeMap<bool> reach;
     1.9 +    //typename Graph::NodeMap<int> reach;
    1.10      
    1.11    public :
    1.12      
    1.13 @@ -65,7 +67,9 @@
    1.14  	reach.set(u,false);
    1.15        }
    1.16       
    1.17 +      //FIXME:
    1.18        typename Graph::NodeMap<bool> scanned(G,false);
    1.19 +      //typename Graph::NodeMap<int> scanned(G,false);
    1.20        typename Graph::NodeMap<int> heap_map(G,-1);
    1.21        
    1.22        Heap heap(heap_map);
    1.23 @@ -76,7 +80,7 @@
    1.24        while ( !heap.empty() ) {
    1.25  	
    1.26  	Node v=heap.top(); 
    1.27 -	T oldvalue=heap.get(v);
    1.28 +	T oldvalue=heap[v];
    1.29  	heap.pop();
    1.30  	distance.set(v, oldvalue);
    1.31  	scanned.set(v,true);
    1.32 @@ -90,26 +94,23 @@
    1.33  	      reach.set(w,true);
    1.34  	      heap.push(w,oldvalue+length[e]); 
    1.35  	      predecessor.set(w,e);
    1.36 -	    } else if ( oldvalue+length[e] < heap.get(w) ) {
    1.37 +	    } else if ( oldvalue+length[e] < heap[w] ) {
    1.38  	      predecessor.set(w,e);
    1.39  	      heap.decrease(w, oldvalue+length[e]); 
    1.40  	    }
    1.41  	  }
    1.42  	}
    1.43        }
    1.44 -    } 
    1.45 +    }
    1.46      
    1.47 -
    1.48      T dist(Node v) {
    1.49        return distance[v];
    1.50      }
    1.51  
    1.52 -
    1.53      Edge pred(Node v) {
    1.54        return predecessor[v];
    1.55      }
    1.56       
    1.57 -
    1.58      bool reached(Node v) {
    1.59        return reach[v];
    1.60      }