Index: tools/dimacs-solver.cc
===================================================================
--- tools/dimacs-solver.cc	(revision 611)
+++ tools/dimacs-solver.cc	(revision 614)
@@ -94,5 +94,5 @@
 template<class Value>
 void solve_min(ArgParser &ap, std::istream &is, std::ostream &,
-               DimacsDescriptor &desc)
+               Value infty, DimacsDescriptor &desc)
 {
   bool report = !ap.given("q");
@@ -101,15 +101,33 @@
   Digraph::NodeMap<Value> sup(g);
   Timer ti;
-  ti.restart();
-  readDimacsMin(is, g, lower, cap, cost, sup, 0, desc);
+
+  ti.restart();
+  readDimacsMin(is, g, lower, cap, cost, sup, infty, desc);
+  ti.stop();
+  Value sum_sup = 0;
+  for (Digraph::NodeIt n(g); n != INVALID; ++n) {
+    sum_sup += sup[n];
+  }
+  if (report) {
+    std::cerr << "Sum of supply values: " << sum_sup << "\n";
+    if (sum_sup <= 0)
+      std::cerr << "GEQ supply contraints are used for NetworkSimplex\n\n";
+    else
+      std::cerr << "LEQ supply contraints are used for NetworkSimplex\n\n";
+  }
   if (report) std::cerr << "Read the file: " << ti << '\n';
+
   ti.restart();
   NetworkSimplex<Digraph, Value> ns(g);
   ns.lowerMap(lower).capacityMap(cap).costMap(cost).supplyMap(sup);
+  if (sum_sup > 0) ns.problemType(ns.LEQ);
   if (report) std::cerr << "Setup NetworkSimplex class: " << ti << '\n';
   ti.restart();
-  ns.run();
-  if (report) std::cerr << "Run NetworkSimplex: " << ti << '\n';
-  if (report) std::cerr << "\nMin flow cost: " << ns.totalCost() << '\n';
+  bool res = ns.run();
+  if (report) {
+    std::cerr << "Run NetworkSimplex: " << ti << "\n\n";
+    std::cerr << "Feasible flow: " << (res ? "found" : "not found") << '\n';
+    if (res) std::cerr << "Min flow cost: " << ns.totalCost() << '\n';
+  }
 }
 
@@ -152,5 +170,5 @@
     {
     case DimacsDescriptor::MIN:
-      solve_min<Value>(ap,is,os,desc);
+      solve_min<Value>(ap,is,os,infty,desc);
       break;
     case DimacsDescriptor::MAX:
Index: tools/lgf-gen.cc
===================================================================
--- tools/lgf-gen.cc	(revision 616)
+++ tools/lgf-gen.cc	(revision 623)
@@ -481,6 +481,6 @@
       g.erase(*ei);
       ConstMap<Arc,int> cegy(1);
-      Suurballe<ListGraph,ConstMap<Arc,int> > sur(g,cegy,a,b);
-      int k=sur.run(2);
+      Suurballe<ListGraph,ConstMap<Arc,int> > sur(g,cegy);
+      int k=sur.run(a,b,2);
       if(k<2 || sur.totalLength()>d)
         g.addEdge(a,b);
@@ -512,7 +512,6 @@
       if(e==INVALID) {
         ConstMap<Arc,int> cegy(1);
-        Suurballe<ListGraph,ConstMap<Arc,int> >
-          sur(g,cegy,pi->a,pi->b);
-        int k=sur.run(2);
+        Suurballe<ListGraph,ConstMap<Arc,int> > sur(g,cegy);
+        int k=sur.run(pi->a,pi->b,2);
         if(k<2 || sur.totalLength()>d)
           {
