From cd68e9fac7b1d65da848caf8f2982dcd8fa68dc9 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 15 Jan 2018 18:51:36 +0000 Subject: [PATCH] Linkgraph: Do not pre-fill annos set at start of MCF Dijkstra --- src/linkgraph/mcf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkgraph/mcf.cpp b/src/linkgraph/mcf.cpp index f6b85f82da..5db29b1184 100644 --- a/src/linkgraph/mcf.cpp +++ b/src/linkgraph/mcf.cpp @@ -384,7 +384,7 @@ void MultiCommodityFlow::Dijkstra(NodeID source_node, PathVector &paths) for (NodeID node = 0; node < size; ++node) { AnnosWrapper *anno = new (this->job.path_allocator.Allocate()) AnnosWrapper(node, node == source_node); anno->UpdateAnnotation(); - anno->self_iter = annos.insert(AnnoSetItem(anno)).first; + anno->self_iter = (node == source_node) ? annos.insert(AnnoSetItem(anno)).first : annos.end(); // only insert the source node, the other nodes will be added as reached paths[node] = anno; } while (!annos.empty()) {