test/min_cost_flow_test.cc
author Alpar Juttner <alpar@cs.elte.hu>
Thu, 07 May 2009 12:21:00 +0100
changeset 700 682941948726
parent 687 6c408d864fa1
child 711 cc61d09f053b
permissions -rw-r--r--
Merge
kpeter@648
     1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
kpeter@648
     2
 *
kpeter@648
     3
 * This file is a part of LEMON, a generic C++ optimization library.
kpeter@648
     4
 *
kpeter@648
     5
 * Copyright (C) 2003-2009
kpeter@648
     6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
kpeter@648
     7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
kpeter@648
     8
 *
kpeter@648
     9
 * Permission to use, modify and distribute this software is granted
kpeter@648
    10
 * provided that this copyright notice appears in all copies. For
kpeter@648
    11
 * precise terms see the accompanying LICENSE file.
kpeter@648
    12
 *
kpeter@648
    13
 * This software is provided "AS IS" with no warranty of any kind,
kpeter@648
    14
 * express or implied, and with no claim as to its suitability for any
kpeter@648
    15
 * purpose.
kpeter@648
    16
 *
kpeter@648
    17
 */
kpeter@648
    18
kpeter@648
    19
#include <iostream>
kpeter@648
    20
#include <fstream>
kpeter@687
    21
#include <limits>
kpeter@648
    22
kpeter@648
    23
#include <lemon/list_graph.h>
kpeter@648
    24
#include <lemon/lgf_reader.h>
kpeter@648
    25
kpeter@648
    26
#include <lemon/network_simplex.h>
kpeter@648
    27
kpeter@648
    28
#include <lemon/concepts/digraph.h>
kpeter@648
    29
#include <lemon/concept_check.h>
kpeter@648
    30
kpeter@648
    31
#include "test_tools.h"
kpeter@648
    32
kpeter@648
    33
using namespace lemon;
kpeter@648
    34
kpeter@648
    35
char test_lgf[] =
kpeter@648
    36
  "@nodes\n"
kpeter@687
    37
  "label  sup1 sup2 sup3 sup4 sup5 sup6\n"
kpeter@687
    38
  "    1    20   27    0   30   20   30\n"
kpeter@687
    39
  "    2    -4    0    0    0   -8   -3\n"
kpeter@687
    40
  "    3     0    0    0    0    0    0\n"
kpeter@687
    41
  "    4     0    0    0    0    0    0\n"
kpeter@687
    42
  "    5     9    0    0    0    6   11\n"
kpeter@687
    43
  "    6    -6    0    0    0   -5   -6\n"
kpeter@687
    44
  "    7     0    0    0    0    0    0\n"
kpeter@687
    45
  "    8     0    0    0    0    0    3\n"
kpeter@687
    46
  "    9     3    0    0    0    0    0\n"
kpeter@687
    47
  "   10    -2    0    0    0   -7   -2\n"
kpeter@687
    48
  "   11     0    0    0    0  -10    0\n"
kpeter@687
    49
  "   12   -20  -27    0  -30  -30  -20\n"
kpeter@687
    50
  "\n"                
kpeter@648
    51
  "@arcs\n"
kpeter@687
    52
  "       cost  cap low1 low2 low3\n"
kpeter@687
    53
  " 1  2    70   11    0    8    8\n"
kpeter@687
    54
  " 1  3   150    3    0    1    0\n"
kpeter@687
    55
  " 1  4    80   15    0    2    2\n"
kpeter@687
    56
  " 2  8    80   12    0    0    0\n"
kpeter@687
    57
  " 3  5   140    5    0    3    1\n"
kpeter@687
    58
  " 4  6    60   10    0    1    0\n"
kpeter@687
    59
  " 4  7    80    2    0    0    0\n"
kpeter@687
    60
  " 4  8   110    3    0    0    0\n"
kpeter@687
    61
  " 5  7    60   14    0    0    0\n"
kpeter@687
    62
  " 5 11   120   12    0    0    0\n"
kpeter@687
    63
  " 6  3     0    3    0    0    0\n"
kpeter@687
    64
  " 6  9   140    4    0    0    0\n"
kpeter@687
    65
  " 6 10    90    8    0    0    0\n"
kpeter@687
    66
  " 7  1    30    5    0    0   -5\n"
kpeter@687
    67
  " 8 12    60   16    0    4    3\n"
kpeter@687
    68
  " 9 12    50    6    0    0    0\n"
kpeter@687
    69
  "10 12    70   13    0    5    2\n"
kpeter@687
    70
  "10  2   100    7    0    0    0\n"
kpeter@687
    71
  "10  7    60   10    0    0   -3\n"
kpeter@687
    72
  "11 10    20   14    0    6  -20\n"
kpeter@687
    73
  "12 11    30   10    0    0  -10\n"
kpeter@648
    74
  "\n"
kpeter@648
    75
  "@attributes\n"
kpeter@648
    76
  "source 1\n"
kpeter@648
    77
  "target 12\n";
kpeter@648
    78
kpeter@648
    79
kpeter@687
    80
enum SupplyType {
kpeter@656
    81
  EQ,
kpeter@656
    82
  GEQ,
kpeter@656
    83
  LEQ
kpeter@656
    84
};
kpeter@656
    85
kpeter@648
    86
// Check the interface of an MCF algorithm
kpeter@689
    87
template <typename GR, typename Value, typename Cost>
kpeter@648
    88
class McfClassConcept
kpeter@648
    89
{
kpeter@648
    90
public:
kpeter@648
    91
kpeter@648
    92
  template <typename MCF>
kpeter@648
    93
  struct Constraints {
kpeter@648
    94
    void constraints() {
kpeter@648
    95
      checkConcept<concepts::Digraph, GR>();
kpeter@648
    96
kpeter@652
    97
      MCF mcf(g);
kpeter@689
    98
      const MCF& const_mcf = mcf;
kpeter@648
    99
kpeter@653
   100
      b = mcf.reset()
kpeter@653
   101
             .lowerMap(lower)
kpeter@652
   102
             .upperMap(upper)
kpeter@652
   103
             .costMap(cost)
kpeter@652
   104
             .supplyMap(sup)
kpeter@652
   105
             .stSupply(n, n, k)
kpeter@652
   106
             .run();
kpeter@652
   107
kpeter@687
   108
      c = const_mcf.totalCost();
kpeter@689
   109
      x = const_mcf.template totalCost<double>();
kpeter@656
   110
      v = const_mcf.flow(a);
kpeter@687
   111
      c = const_mcf.potential(n);
kpeter@689
   112
      const_mcf.flowMap(fm);
kpeter@689
   113
      const_mcf.potentialMap(pm);
kpeter@648
   114
    }
kpeter@648
   115
kpeter@648
   116
    typedef typename GR::Node Node;
kpeter@648
   117
    typedef typename GR::Arc Arc;
kpeter@689
   118
    typedef concepts::ReadMap<Node, Value> NM;
kpeter@689
   119
    typedef concepts::ReadMap<Arc, Value> VAM;
kpeter@654
   120
    typedef concepts::ReadMap<Arc, Cost> CAM;
kpeter@689
   121
    typedef concepts::WriteMap<Arc, Value> FlowMap;
kpeter@689
   122
    typedef concepts::WriteMap<Node, Cost> PotMap;
kpeter@648
   123
kpeter@648
   124
    const GR &g;
kpeter@689
   125
    const VAM &lower;
kpeter@689
   126
    const VAM &upper;
kpeter@654
   127
    const CAM &cost;
kpeter@648
   128
    const NM &sup;
kpeter@648
   129
    const Node &n;
kpeter@648
   130
    const Arc &a;
kpeter@689
   131
    const Value &k;
kpeter@689
   132
    FlowMap fm;
kpeter@689
   133
    PotMap pm;
kpeter@652
   134
    bool b;
kpeter@689
   135
    double x;
kpeter@689
   136
    typename MCF::Value v;
kpeter@689
   137
    typename MCF::Cost c;
kpeter@648
   138
  };
kpeter@648
   139
kpeter@648
   140
};
kpeter@648
   141
kpeter@648
   142
kpeter@648
   143
// Check the feasibility of the given flow (primal soluiton)
kpeter@648
   144
template < typename GR, typename LM, typename UM,
kpeter@648
   145
           typename SM, typename FM >
kpeter@648
   146
bool checkFlow( const GR& gr, const LM& lower, const UM& upper,
kpeter@656
   147
                const SM& supply, const FM& flow,
kpeter@687
   148
                SupplyType type = EQ )
kpeter@648
   149
{
kpeter@648
   150
  TEMPLATE_DIGRAPH_TYPEDEFS(GR);
kpeter@648
   151
kpeter@648
   152
  for (ArcIt e(gr); e != INVALID; ++e) {
kpeter@648
   153
    if (flow[e] < lower[e] || flow[e] > upper[e]) return false;
kpeter@648
   154
  }
kpeter@648
   155
kpeter@648
   156
  for (NodeIt n(gr); n != INVALID; ++n) {
kpeter@648
   157
    typename SM::Value sum = 0;
kpeter@648
   158
    for (OutArcIt e(gr, n); e != INVALID; ++e)
kpeter@648
   159
      sum += flow[e];
kpeter@648
   160
    for (InArcIt e(gr, n); e != INVALID; ++e)
kpeter@648
   161
      sum -= flow[e];
kpeter@656
   162
    bool b = (type ==  EQ && sum == supply[n]) ||
kpeter@656
   163
             (type == GEQ && sum >= supply[n]) ||
kpeter@656
   164
             (type == LEQ && sum <= supply[n]);
kpeter@656
   165
    if (!b) return false;
kpeter@648
   166
  }
kpeter@648
   167
kpeter@648
   168
  return true;
kpeter@648
   169
}
kpeter@648
   170
kpeter@648
   171
// Check the feasibility of the given potentials (dual soluiton)
kpeter@652
   172
// using the "Complementary Slackness" optimality condition
kpeter@648
   173
template < typename GR, typename LM, typename UM,
kpeter@656
   174
           typename CM, typename SM, typename FM, typename PM >
kpeter@648
   175
bool checkPotential( const GR& gr, const LM& lower, const UM& upper,
kpeter@656
   176
                     const CM& cost, const SM& supply, const FM& flow, 
kpeter@656
   177
                     const PM& pi )
kpeter@648
   178
{
kpeter@648
   179
  TEMPLATE_DIGRAPH_TYPEDEFS(GR);
kpeter@648
   180
kpeter@648
   181
  bool opt = true;
kpeter@648
   182
  for (ArcIt e(gr); opt && e != INVALID; ++e) {
kpeter@648
   183
    typename CM::Value red_cost =
kpeter@648
   184
      cost[e] + pi[gr.source(e)] - pi[gr.target(e)];
kpeter@648
   185
    opt = red_cost == 0 ||
kpeter@648
   186
          (red_cost > 0 && flow[e] == lower[e]) ||
kpeter@648
   187
          (red_cost < 0 && flow[e] == upper[e]);
kpeter@648
   188
  }
kpeter@656
   189
  
kpeter@656
   190
  for (NodeIt n(gr); opt && n != INVALID; ++n) {
kpeter@656
   191
    typename SM::Value sum = 0;
kpeter@656
   192
    for (OutArcIt e(gr, n); e != INVALID; ++e)
kpeter@656
   193
      sum += flow[e];
kpeter@656
   194
    for (InArcIt e(gr, n); e != INVALID; ++e)
kpeter@656
   195
      sum -= flow[e];
kpeter@656
   196
    opt = (sum == supply[n]) || (pi[n] == 0);
kpeter@656
   197
  }
kpeter@656
   198
  
kpeter@648
   199
  return opt;
kpeter@648
   200
}
kpeter@648
   201
kpeter@648
   202
// Run a minimum cost flow algorithm and check the results
kpeter@648
   203
template < typename MCF, typename GR,
kpeter@648
   204
           typename LM, typename UM,
kpeter@687
   205
           typename CM, typename SM,
kpeter@687
   206
           typename PT >
kpeter@687
   207
void checkMcf( const MCF& mcf, PT mcf_result,
kpeter@648
   208
               const GR& gr, const LM& lower, const UM& upper,
kpeter@648
   209
               const CM& cost, const SM& supply,
kpeter@687
   210
               PT result, bool optimal, typename CM::Value total,
kpeter@656
   211
               const std::string &test_id = "",
kpeter@687
   212
               SupplyType type = EQ )
kpeter@648
   213
{
kpeter@648
   214
  check(mcf_result == result, "Wrong result " + test_id);
kpeter@687
   215
  if (optimal) {
kpeter@689
   216
    typename GR::template ArcMap<typename SM::Value> flow(gr);
kpeter@689
   217
    typename GR::template NodeMap<typename CM::Value> pi(gr);
kpeter@689
   218
    mcf.flowMap(flow);
kpeter@689
   219
    mcf.potentialMap(pi);
kpeter@689
   220
    check(checkFlow(gr, lower, upper, supply, flow, type),
kpeter@648
   221
          "The flow is not feasible " + test_id);
kpeter@648
   222
    check(mcf.totalCost() == total, "The flow is not optimal " + test_id);
kpeter@689
   223
    check(checkPotential(gr, lower, upper, cost, supply, flow, pi),
kpeter@648
   224
          "Wrong potentials " + test_id);
kpeter@648
   225
  }
kpeter@648
   226
}
kpeter@648
   227
kpeter@648
   228
int main()
kpeter@648
   229
{
kpeter@648
   230
  // Check the interfaces
kpeter@648
   231
  {
kpeter@662
   232
    typedef concepts::Digraph GR;
kpeter@689
   233
    checkConcept< McfClassConcept<GR, int, int>,
kpeter@689
   234
                  NetworkSimplex<GR> >();
kpeter@689
   235
    checkConcept< McfClassConcept<GR, double, double>,
kpeter@689
   236
                  NetworkSimplex<GR, double> >();
kpeter@689
   237
    checkConcept< McfClassConcept<GR, int, double>,
kpeter@689
   238
                  NetworkSimplex<GR, int, double> >();
kpeter@648
   239
  }
kpeter@648
   240
kpeter@648
   241
  // Run various MCF tests
kpeter@648
   242
  typedef ListDigraph Digraph;
kpeter@648
   243
  DIGRAPH_TYPEDEFS(ListDigraph);
kpeter@648
   244
kpeter@648
   245
  // Read the test digraph
kpeter@648
   246
  Digraph gr;
kpeter@687
   247
  Digraph::ArcMap<int> c(gr), l1(gr), l2(gr), l3(gr), u(gr);
kpeter@687
   248
  Digraph::NodeMap<int> s1(gr), s2(gr), s3(gr), s4(gr), s5(gr), s6(gr);
kpeter@652
   249
  ConstMap<Arc, int> cc(1), cu(std::numeric_limits<int>::max());
kpeter@648
   250
  Node v, w;
kpeter@648
   251
kpeter@648
   252
  std::istringstream input(test_lgf);
kpeter@648
   253
  DigraphReader<Digraph>(gr, input)
kpeter@648
   254
    .arcMap("cost", c)
kpeter@648
   255
    .arcMap("cap", u)
kpeter@648
   256
    .arcMap("low1", l1)
kpeter@648
   257
    .arcMap("low2", l2)
kpeter@687
   258
    .arcMap("low3", l3)
kpeter@648
   259
    .nodeMap("sup1", s1)
kpeter@648
   260
    .nodeMap("sup2", s2)
kpeter@648
   261
    .nodeMap("sup3", s3)
kpeter@656
   262
    .nodeMap("sup4", s4)
kpeter@656
   263
    .nodeMap("sup5", s5)
kpeter@687
   264
    .nodeMap("sup6", s6)
kpeter@648
   265
    .node("source", v)
kpeter@648
   266
    .node("target", w)
kpeter@648
   267
    .run();
kpeter@687
   268
  
kpeter@687
   269
  // Build a test digraph for testing negative costs
kpeter@687
   270
  Digraph ngr;
kpeter@687
   271
  Node n1 = ngr.addNode();
kpeter@687
   272
  Node n2 = ngr.addNode();
kpeter@687
   273
  Node n3 = ngr.addNode();
kpeter@687
   274
  Node n4 = ngr.addNode();
kpeter@687
   275
  Node n5 = ngr.addNode();
kpeter@687
   276
  Node n6 = ngr.addNode();
kpeter@687
   277
  Node n7 = ngr.addNode();
kpeter@687
   278
  
kpeter@687
   279
  Arc a1 = ngr.addArc(n1, n2);
kpeter@687
   280
  Arc a2 = ngr.addArc(n1, n3);
kpeter@687
   281
  Arc a3 = ngr.addArc(n2, n4);
kpeter@687
   282
  Arc a4 = ngr.addArc(n3, n4);
kpeter@687
   283
  Arc a5 = ngr.addArc(n3, n2);
kpeter@687
   284
  Arc a6 = ngr.addArc(n5, n3);
kpeter@687
   285
  Arc a7 = ngr.addArc(n5, n6);
kpeter@687
   286
  Arc a8 = ngr.addArc(n6, n7);
kpeter@687
   287
  Arc a9 = ngr.addArc(n7, n5);
kpeter@687
   288
  
kpeter@687
   289
  Digraph::ArcMap<int> nc(ngr), nl1(ngr, 0), nl2(ngr, 0);
kpeter@687
   290
  ConstMap<Arc, int> nu1(std::numeric_limits<int>::max()), nu2(5000);
kpeter@687
   291
  Digraph::NodeMap<int> ns(ngr, 0);
kpeter@687
   292
  
kpeter@687
   293
  nl2[a7] =  1000;
kpeter@687
   294
  nl2[a8] = -1000;
kpeter@687
   295
  
kpeter@687
   296
  ns[n1] =  100;
kpeter@687
   297
  ns[n4] = -100;
kpeter@687
   298
  
kpeter@687
   299
  nc[a1] =  100;
kpeter@687
   300
  nc[a2] =   30;
kpeter@687
   301
  nc[a3] =   20;
kpeter@687
   302
  nc[a4] =   80;
kpeter@687
   303
  nc[a5] =   50;
kpeter@687
   304
  nc[a6] =   10;
kpeter@687
   305
  nc[a7] =   80;
kpeter@687
   306
  nc[a8] =   30;
kpeter@687
   307
  nc[a9] = -120;
kpeter@648
   308
kpeter@652
   309
  // A. Test NetworkSimplex with the default pivot rule
kpeter@648
   310
  {
kpeter@653
   311
    NetworkSimplex<Digraph> mcf(gr);
kpeter@648
   312
kpeter@656
   313
    // Check the equality form
kpeter@653
   314
    mcf.upperMap(u).costMap(c);
kpeter@653
   315
    checkMcf(mcf, mcf.supplyMap(s1).run(),
kpeter@687
   316
             gr, l1, u, c, s1, mcf.OPTIMAL, true,   5240, "#A1");
kpeter@653
   317
    checkMcf(mcf, mcf.stSupply(v, w, 27).run(),
kpeter@687
   318
             gr, l1, u, c, s2, mcf.OPTIMAL, true,   7620, "#A2");
kpeter@653
   319
    mcf.lowerMap(l2);
kpeter@653
   320
    checkMcf(mcf, mcf.supplyMap(s1).run(),
kpeter@687
   321
             gr, l2, u, c, s1, mcf.OPTIMAL, true,   5970, "#A3");
kpeter@653
   322
    checkMcf(mcf, mcf.stSupply(v, w, 27).run(),
kpeter@687
   323
             gr, l2, u, c, s2, mcf.OPTIMAL, true,   8010, "#A4");
kpeter@653
   324
    mcf.reset();
kpeter@653
   325
    checkMcf(mcf, mcf.supplyMap(s1).run(),
kpeter@687
   326
             gr, l1, cu, cc, s1, mcf.OPTIMAL, true,   74, "#A5");
kpeter@653
   327
    checkMcf(mcf, mcf.lowerMap(l2).stSupply(v, w, 27).run(),
kpeter@687
   328
             gr, l2, cu, cc, s2, mcf.OPTIMAL, true,   94, "#A6");
kpeter@653
   329
    mcf.reset();
kpeter@653
   330
    checkMcf(mcf, mcf.run(),
kpeter@687
   331
             gr, l1, cu, cc, s3, mcf.OPTIMAL, true,    0, "#A7");
kpeter@687
   332
    checkMcf(mcf, mcf.lowerMap(l2).upperMap(u).run(),
kpeter@687
   333
             gr, l2, u, cc, s3, mcf.INFEASIBLE, false, 0, "#A8");
kpeter@687
   334
    mcf.reset().lowerMap(l3).upperMap(u).costMap(c).supplyMap(s4);
kpeter@687
   335
    checkMcf(mcf, mcf.run(),
kpeter@687
   336
             gr, l3, u, c, s4, mcf.OPTIMAL, true,   6360, "#A9");
kpeter@656
   337
kpeter@656
   338
    // Check the GEQ form
kpeter@687
   339
    mcf.reset().upperMap(u).costMap(c).supplyMap(s5);
kpeter@656
   340
    checkMcf(mcf, mcf.run(),
kpeter@687
   341
             gr, l1, u, c, s5, mcf.OPTIMAL, true,   3530, "#A10", GEQ);
kpeter@687
   342
    mcf.supplyType(mcf.GEQ);
kpeter@656
   343
    checkMcf(mcf, mcf.lowerMap(l2).run(),
kpeter@687
   344
             gr, l2, u, c, s5, mcf.OPTIMAL, true,   4540, "#A11", GEQ);
kpeter@687
   345
    mcf.supplyType(mcf.CARRY_SUPPLIES).supplyMap(s6);
kpeter@656
   346
    checkMcf(mcf, mcf.run(),
kpeter@687
   347
             gr, l2, u, c, s6, mcf.INFEASIBLE, false,  0, "#A12", GEQ);
kpeter@656
   348
kpeter@656
   349
    // Check the LEQ form
kpeter@687
   350
    mcf.reset().supplyType(mcf.LEQ);
kpeter@687
   351
    mcf.upperMap(u).costMap(c).supplyMap(s6);
kpeter@656
   352
    checkMcf(mcf, mcf.run(),
kpeter@687
   353
             gr, l1, u, c, s6, mcf.OPTIMAL, true,   5080, "#A13", LEQ);
kpeter@656
   354
    checkMcf(mcf, mcf.lowerMap(l2).run(),
kpeter@687
   355
             gr, l2, u, c, s6, mcf.OPTIMAL, true,   5930, "#A14", LEQ);
kpeter@687
   356
    mcf.supplyType(mcf.SATISFY_DEMANDS).supplyMap(s5);
kpeter@656
   357
    checkMcf(mcf, mcf.run(),
kpeter@687
   358
             gr, l2, u, c, s5, mcf.INFEASIBLE, false,  0, "#A15", LEQ);
kpeter@687
   359
kpeter@687
   360
    // Check negative costs
kpeter@687
   361
    NetworkSimplex<Digraph> nmcf(ngr);
kpeter@687
   362
    nmcf.lowerMap(nl1).costMap(nc).supplyMap(ns);
kpeter@687
   363
    checkMcf(nmcf, nmcf.run(),
kpeter@687
   364
      ngr, nl1, nu1, nc, ns, nmcf.UNBOUNDED, false,    0, "#A16");
kpeter@687
   365
    checkMcf(nmcf, nmcf.upperMap(nu2).run(),
kpeter@687
   366
      ngr, nl1, nu2, nc, ns, nmcf.OPTIMAL, true,  -40000, "#A17");
kpeter@687
   367
    nmcf.reset().lowerMap(nl2).costMap(nc).supplyMap(ns);
kpeter@687
   368
    checkMcf(nmcf, nmcf.run(),
kpeter@687
   369
      ngr, nl2, nu1, nc, ns, nmcf.UNBOUNDED, false,    0, "#A18");
kpeter@648
   370
  }
kpeter@648
   371
kpeter@652
   372
  // B. Test NetworkSimplex with each pivot rule
kpeter@648
   373
  {
kpeter@653
   374
    NetworkSimplex<Digraph> mcf(gr);
kpeter@687
   375
    mcf.supplyMap(s1).costMap(c).upperMap(u).lowerMap(l2);
kpeter@648
   376
kpeter@653
   377
    checkMcf(mcf, mcf.run(NetworkSimplex<Digraph>::FIRST_ELIGIBLE),
kpeter@687
   378
             gr, l2, u, c, s1, mcf.OPTIMAL, true,   5970, "#B1");
kpeter@653
   379
    checkMcf(mcf, mcf.run(NetworkSimplex<Digraph>::BEST_ELIGIBLE),
kpeter@687
   380
             gr, l2, u, c, s1, mcf.OPTIMAL, true,   5970, "#B2");
kpeter@653
   381
    checkMcf(mcf, mcf.run(NetworkSimplex<Digraph>::BLOCK_SEARCH),
kpeter@687
   382
             gr, l2, u, c, s1, mcf.OPTIMAL, true,   5970, "#B3");
kpeter@653
   383
    checkMcf(mcf, mcf.run(NetworkSimplex<Digraph>::CANDIDATE_LIST),
kpeter@687
   384
             gr, l2, u, c, s1, mcf.OPTIMAL, true,   5970, "#B4");
kpeter@653
   385
    checkMcf(mcf, mcf.run(NetworkSimplex<Digraph>::ALTERING_LIST),
kpeter@687
   386
             gr, l2, u, c, s1, mcf.OPTIMAL, true,   5970, "#B5");
kpeter@648
   387
  }
kpeter@648
   388
kpeter@648
   389
  return 0;
kpeter@648
   390
}