[Lemon-commits] [lemon_svn] deba: r2275 - hugo/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:51:26 CET 2006
Author: deba
Date: Fri Oct 28 11:01:59 2005
New Revision: 2275
Modified:
hugo/trunk/lemon/johnson.h
Log:
Faster implementation
Modified: hugo/trunk/lemon/johnson.h
==============================================================================
--- hugo/trunk/lemon/johnson.h (original)
+++ hugo/trunk/lemon/johnson.h Fri Oct 28 11:01:59 2005
@@ -494,14 +494,16 @@
void shiftedRun(const BelmannFordType& belmannford) {
- typedef PotentialDifferenceMap<Graph,
- typename BelmannFordType::DistMap> PotDiffMap;
- PotDiffMap potdiff(*graph, belmannford.distMap());
- typedef SubMap<LengthMap, PotDiffMap> ShiftLengthMap;
- ShiftLengthMap shiftlen(*length, potdiff);
-
- typename Dijkstra<Graph, ShiftLengthMap>::
- template DefHeap<Heap, HeapCrossRef>::Create dijkstra(*graph, shiftlen);
+ typename Graph::template EdgeMap<Value> shiftlen(*graph);
+ for (EdgeIt it(*graph); it != INVALID; ++it) {
+ shiftlen[it] = (*length)[it]
+ + belmannford.dist(graph->source(it))
+ - belmannford.dist(graph->target(it));
+ }
+
+ typename Dijkstra<Graph, typename Graph::template EdgeMap<Value> >::
+ template DefHeap<Heap, HeapCrossRef>::
+ Create dijkstra(*graph, shiftlen);
dijkstra.heap(*_heap, *_heap_cross_ref);
More information about the Lemon-commits
mailing list