[PPL-devel] [GIT] ppl/ppl(pip): Finished parametric simplex algorithm. No cut generation yet.

François Galea francois.galea at uvsq.fr
Fri Sep 18 11:33:29 CEST 2009


Module: ppl/ppl
Branch: pip
Commit: 80b7e08459297f6dc193ad8988e49baa21e27df4
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=80b7e08459297f6dc193ad8988e49baa21e27df4

Author: François Galea <francois.galea at uvsq.fr>
Date:   Fri Sep 18 09:21:54 2009 +0200

Finished parametric simplex algorithm. No cut generation yet.

---

 src/PIP_Tree.cc |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc
index 604683c..abdb0d5 100644
--- a/src/PIP_Tree.cc
+++ b/src/PIP_Tree.cc
@@ -871,8 +871,36 @@ PIP_Solution_Node::solve(PIP_Tree_Node*& parent_ref,
         return OPTIMIZED_PIP_PROBLEM;
       }
     }
-    //FIXME: to be finished
 
+    /* Otherwise, all parameters are positive: we have found a continuous
+     * solution. If the solution happens to be integer, then it is a
+     * solution of the  integer problem. Otherwise, we may need to generate
+     * a new cut to try and get back into the integer case. */
+    else {
+#ifdef NOISY_PIP
+      std::cout << "All parameters are positive."
+                << std::endl;
+#endif
+      tableau.s.normalize();
+      tableau.t.normalize();
+
+      if (tableau.s.is_integer() && tableau.t.is_integer()) {
+        /* The solution is integer */
+#ifdef NOISY_PIP
+        std::cout << "Solution found for in current node."
+                  << std::endl;
+#endif
+        return OPTIMIZED_PIP_PROBLEM;
+      }
+      else {
+        /* The solution is non-integer. We have to generate a cut. */
+        //FIXME: to be finished
+#ifdef NOISY_PIP
+        std::cout << "Cut generation required."
+                  << std::endl;
+#endif
+      }
+    }
   } // Main loop of the simplex algorithm
 
   return OPTIMIZED_PIP_PROBLEM;




More information about the PPL-devel mailing list