COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
05/25/04 17:11:11 (17 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@864
Message:

Corrected some obvious errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/athos/min_cost_flow.cc

    r659 r661  
    11#include <iostream>
    2 #include "test_tools.h"
     2//#include "test_tools.h"
    33#include <hugo/list_graph.h>
    44#include <mincostflow.h>
     
    5252 
    5353
    54   ListGraph::EdgeMap<int> length(graph);
     54  ListGraph::EdgeMap<int> cost(graph);
    5555
    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);
    6464
    6565  /*
     
    8080
    8181  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);
    8383
    8484  int k=1;
    8585
    8686  /*
    87   check(  min_cost_flow_test.run(s,t,k) == 1 && min_cost_flow_test.totalLength() == 19,"One path, total length should 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");
    8888
    8989  check(min_cost_flow_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
     
    9191  k=2;
    9292 
    93   check(  min_cost_flow_test.run(s,t,k) == 2 && min_cost_flow_test.totalLength() == 41,"Two paths, total length should 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");
    9494
    9595  check(min_cost_flow_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
     
    9898  k=4;
    9999
    100   check(  min_cost_flow_test.run(s,t,k) == 3 && min_cost_flow_test.totalLength() == 64,"Three paths, total length should 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");
    101101
    102102  check(min_cost_flow_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
Note: See TracChangeset for help on using the changeset viewer.