Browse Source

allow multiple definition of same arc in input

main
Stefan Pranger 3 years ago
parent
commit
c2be71d4dc
  1. 2
      Graph.cpp
  2. 3
      examples/FF_killer.txt

2
Graph.cpp

@ -31,7 +31,7 @@ namespace data {
m_flow.resize(m_num_vertices, std::vector<Capacity>(m_num_vertices, 0)); m_flow.resize(m_num_vertices, std::vector<Capacity>(m_num_vertices, 0));
m_capapcities.resize(m_num_vertices, std::vector<Capacity>(m_num_vertices, 0)); m_capapcities.resize(m_num_vertices, std::vector<Capacity>(m_num_vertices, 0));
for(auto const &arc : m_arc_list) { 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;
} }
} }

3
examples/FF_killer.txt

@ -2,5 +2,6 @@
1 2 99 1 2 99
1 3 99 1 3 99
2 3 1 2 3 1
2 4 99
2 4 98
2 4 1
3 4 99 3 4 99
Loading…
Cancel
Save