From c2be71d4dc3c379d56c89801df67797a2185b376 Mon Sep 17 00:00:00 2001 From: Stefan Pranger Date: Tue, 25 Jan 2022 18:49:06 +0100 Subject: [PATCH] allow multiple definition of same arc in input --- Graph.cpp | 2 +- examples/FF_killer.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Graph.cpp b/Graph.cpp index 277ebcf..34c9d54 100644 --- a/Graph.cpp +++ b/Graph.cpp @@ -31,7 +31,7 @@ namespace data { m_flow.resize(m_num_vertices, std::vector(m_num_vertices, 0)); m_capapcities.resize(m_num_vertices, std::vector(m_num_vertices, 0)); for(auto const &arc : m_arc_list) { - m_capapcities.at(arc.start - 1).at(arc.end - 1) = arc.capacity; + m_capapcities.at(arc.start - 1).at(arc.end - 1) += arc.capacity; } } diff --git a/examples/FF_killer.txt b/examples/FF_killer.txt index 8d4b37c..749e746 100644 --- a/examples/FF_killer.txt +++ b/examples/FF_killer.txt @@ -2,5 +2,6 @@ 1 2 99 1 3 99 2 3 1 -2 4 99 +2 4 98 +2 4 1 3 4 99