Changeset 661:d306e777117e in lemon-0.x for src/work/athos/min_cost_flow.cc
- Timestamp:
- 05/25/04 17:11:11 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@864
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/athos/min_cost_flow.cc
r659 r661 1 1 #include <iostream> 2 #include "test_tools.h"2 //#include "test_tools.h" 3 3 #include <hugo/list_graph.h> 4 4 #include <mincostflow.h> … … 52 52 53 53 54 ListGraph::EdgeMap<int> length(graph);54 ListGraph::EdgeMap<int> cost(graph); 55 55 56 length.set(s_v1, 6);57 length.set(v1_v2, 4);58 length.set(s_v3, 10);59 length.set(v2_v4, 5);60 length.set(v2_v5, 1);61 length.set(v3_v5, 4);62 length.set(v4_t, 8);63 length.set(v5_t, 8);56 cost.set(s_v1, 6); 57 cost.set(v1_v2, 4); 58 cost.set(s_v3, 10); 59 cost.set(v2_v4, 5); 60 cost.set(v2_v5, 1); 61 cost.set(v3_v5, 4); 62 cost.set(v4_t, 8); 63 cost.set(v5_t, 8); 64 64 65 65 /* … … 80 80 81 81 MinCostFlow< ListGraph, ListGraph::EdgeMap<int>, ListGraph::NodeMap<int> > 82 min_cost_flow_test(graph, length, supply_demand);82 min_cost_flow_test(graph, cost, supply_demand); 83 83 84 84 int k=1; 85 85 86 86 /* 87 check( min_cost_flow_test.run(s,t,k) == 1 && min_cost_flow_test.totalLength() == 19,"One path, total lengthshould be 19");87 check( min_cost_flow_test.run(s,t,k) == 1 && min_cost_flow_test.totalLength() == 19,"One path, total cost should be 19"); 88 88 89 89 check(min_cost_flow_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?"); … … 91 91 k=2; 92 92 93 check( min_cost_flow_test.run(s,t,k) == 2 && min_cost_flow_test.totalLength() == 41,"Two paths, total lengthshould be 41");93 check( min_cost_flow_test.run(s,t,k) == 2 && min_cost_flow_test.totalLength() == 41,"Two paths, total cost should be 41"); 94 94 95 95 check(min_cost_flow_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?"); … … 98 98 k=4; 99 99 100 check( min_cost_flow_test.run(s,t,k) == 3 && min_cost_flow_test.totalLength() == 64,"Three paths, total lengthshould be 64");100 check( min_cost_flow_test.run(s,t,k) == 3 && min_cost_flow_test.totalLength() == 64,"Three paths, total cost should be 64"); 101 101 102 102 check(min_cost_flow_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
Note: See TracChangeset
for help on using the changeset viewer.