Skip to content

Commit 07f2904

Browse files
committed
Fixed max-flow bug. Refactored max-flow tests.
1 parent 52fcd9c commit 07f2904

4 files changed

Lines changed: 752 additions & 99 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ if(NETGRAPH_CORE_BUILD_TESTS)
1313
)
1414
FetchContent_MakeAvailable(googletest)
1515
enable_testing()
16-
add_executable(netgraph_core_tests
17-
tests/cpp/smoke_test.cpp
18-
tests/cpp/flow_policy_tests.cpp
19-
tests/cpp/strict_multidigraph_tests.cpp
20-
tests/cpp/shortest_paths_tests.cpp
21-
tests/cpp/flow_state_tests.cpp
22-
tests/cpp/flow_graph_tests.cpp
23-
tests/cpp/max_flow_tests.cpp
24-
tests/cpp/k_shortest_paths_tests.cpp
25-
)
16+
add_executable(netgraph_core_tests
17+
tests/cpp/smoke_test.cpp
18+
tests/cpp/flow_policy_tests.cpp
19+
tests/cpp/strict_multidigraph_tests.cpp
20+
tests/cpp/shortest_paths_tests.cpp
21+
tests/cpp/flow_state_tests.cpp
22+
tests/cpp/flow_graph_tests.cpp
23+
tests/cpp/max_flow_tests.cpp
24+
tests/cpp/k_shortest_paths_tests.cpp
25+
)
2626
target_link_libraries(netgraph_core_tests PRIVATE netgraph_core GTest::gtest_main)
2727
target_include_directories(netgraph_core_tests PRIVATE tests/cpp)
2828
if(NETGRAPH_CORE_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))

src/flow_state.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ Flow FlowState::place_on_dag(NodeId src, NodeId dst, const PredDAG& dag,
230230
if (pushed < kMinFlow) break;
231231
pushed_layer += static_cast<Flow>(pushed);
232232
remaining -= pushed;
233-
if (shortest_path) break;
234233
if (remaining <= kMinFlow) break;
235234
}
236235
if (pushed_layer < kMinFlow) break;

0 commit comments

Comments
 (0)