Changeset 296:09d6d48815a5 in lemon0.x for src/include/dijkstra.h
 Timestamp:
 04/05/04 15:55:55 (18 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@414
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/include/dijkstra.h
r276 r296 70 70 typename LengthMap=typename Graph::EdgeMap<int>, 71 71 template <class,class,class> class Heap = BinHeap > 72 // typename Heap=BinHeap <typename Graph::Node,73 // typename LengthMap::ValueType,74 // typename Graph::NodeMap<int> > >75 72 #endif 76 73 class Dijkstra{ … … 90 87 const LengthMap& length; 91 88 PredMap predecessor; 92 //In place of reach:93 89 PredNodeMap pred_node; 94 90 DistMap distance; 95 //I don't like this:96 // //FIXME:97 // typename Graph::NodeMap<bool> reach;98 // //typename Graph::NodeMap<int> reach;99 91 100 92 public : 101 93 102 /*103 The distance of the nodes is 0.104 */105 94 Dijkstra(Graph& _G, LengthMap& _length) : 106 95 G(_G), length(_length), predecessor(_G), pred_node(_G), distance(_G) { } … … 147 136 ///\pre \ref run() must be called before using this function. 148 137 const PredNodeMap &predNodeMap() const { return pred_node;} 149 150 // bool reached(Node v) { return reach[v]; }151 138 152 139 ///Checks if a node is reachable from the source. … … 187 174 } 188 175 189 //We don't need it at all.190 // //FIXME:191 // typename Graph::NodeMap<bool> scanned(G,false);192 // //typename Graph::NodeMap<int> scanned(G,false);193 176 typename Graph::NodeMap<int> heap_map(G,1); 194 177 195 //Heap heap(heap_map);196 178 Heap<Node,ValueType,typename Graph::NodeMap<int> > heap(heap_map); 197 179 198 180 heap.push(s,0); 199 // reach.set(s, true);200 181 201 182 while ( !heap.empty() ) { … … 212 193 switch(heap.state(w)) { 213 194 case heap.PRE_HEAP: 214 // reach.set(w,true);215 195 heap.push(w,oldvalue+length[e]); 216 196 predecessor.set(w,e);
Note: See TracChangeset
for help on using the changeset viewer.