tools/dimacs-to-lgf.cc
changeset 645 a3402913cffe
parent 463 88ed40ad0d4f
child 631 33c6b6e755cd
equal deleted inserted replaced
3:b9773283e6cf 4:d064baeb1646
    94     case DimacsDescriptor::MIN:
    94     case DimacsDescriptor::MIN:
    95       {
    95       {
    96         Digraph digraph;
    96         Digraph digraph;
    97         DoubleArcMap lower(digraph), capacity(digraph), cost(digraph);
    97         DoubleArcMap lower(digraph), capacity(digraph), cost(digraph);
    98         DoubleNodeMap supply(digraph);
    98         DoubleNodeMap supply(digraph);
    99         readDimacsMin(is, digraph, lower, capacity, cost, supply, desc);
    99         readDimacsMin(is, digraph, lower, capacity, cost, supply, 0, desc);
   100         DigraphWriter<Digraph>(digraph, os).
   100         DigraphWriter<Digraph>(digraph, os).
   101           nodeMap("supply", supply).
   101           nodeMap("supply", supply).
   102           arcMap("lower", lower).
   102           arcMap("lower", lower).
   103           arcMap("capacity", capacity).
   103           arcMap("capacity", capacity).
   104           arcMap("cost", cost).
   104           arcMap("cost", cost).
   109     case DimacsDescriptor::MAX:
   109     case DimacsDescriptor::MAX:
   110       {
   110       {
   111         Digraph digraph;
   111         Digraph digraph;
   112         Node s, t;
   112         Node s, t;
   113         DoubleArcMap capacity(digraph);
   113         DoubleArcMap capacity(digraph);
   114         readDimacsMax(is, digraph, capacity, s, t, desc);
   114         readDimacsMax(is, digraph, capacity, s, t, 0, desc);
   115         DigraphWriter<Digraph>(digraph, os).
   115         DigraphWriter<Digraph>(digraph, os).
   116           arcMap("capacity", capacity).
   116           arcMap("capacity", capacity).
   117           node("source", s).
   117           node("source", s).
   118           node("target", t).
   118           node("target", t).
   119           attribute("problem","max").
   119           attribute("problem","max").