From 957f5ca11758d556763881d04ced39cd34c470c1 Mon Sep 17 00:00:00 2001 From: fonsinchen Date: Sat, 14 Jun 2014 13:35:39 +0000 Subject: (svn r26646) -Fix [FS#6041]: Save locations instead of distances in link graphs to reduce size. --- src/linkgraph/mcf.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/linkgraph/mcf.cpp') diff --git a/src/linkgraph/mcf.cpp b/src/linkgraph/mcf.cpp index 3163ec9e3..81d4d6d38 100644 --- a/src/linkgraph/mcf.cpp +++ b/src/linkgraph/mcf.cpp @@ -259,7 +259,6 @@ void MultiCommodityFlow::Dijkstra(NodeID source_node, PathVector &paths) for (NodeID to = iter.Next(); to != INVALID_NODE; to = iter.Next()) { if (to == from) continue; // Not a real edge but a consumption sign. Edge edge = this->job[from][to]; - assert(edge.Distance() < UINT_MAX); uint capacity = edge.Capacity(); if (this->max_saturation != UINT_MAX) { capacity *= this->max_saturation; @@ -267,7 +266,7 @@ void MultiCommodityFlow::Dijkstra(NodeID source_node, PathVector &paths) if (capacity == 0) capacity = 1; } /* punish in-between stops a little */ - uint distance = edge.Distance() + 1; + uint distance = DistanceMaxPlusManhattan(this->job[from].XY(), this->job[to].XY()) + 1; Tannotation *dest = static_cast(paths[to]); if (dest->IsBetter(source, capacity, capacity - edge.Flow(), distance)) { annos.erase(dest); -- cgit v1.2.3-70-g09d2