2
$\begingroup$

I have written a short example to run the simplex algorithm with coin-or Clp, something quite simple like this:

ClpSimplex solver;
solver.readLp(file_in);        
solver.initialSolve();
if(solver.isProvenOptimal()) {
  int ncol = solver.getNumCols();
  const double *solution = solver.getColSolution();
  for(int i=0; i<ncol; i++) {
    printf("%f ", solution[i]);
  }
  printf("\n");
}
if(solver.isAbandoned())
  printf("Numerical problems found\n");
if(solver.isProvenPrimalInfeasible())
  printf("Primal Infeasible\n");
if(solver.isProvenDualInfeasible())
  printf("Dual Infeasible\n");

Now that I have the solution, I would like to do sensitivity analysis that is to say, change the objective function and/or the second member and then check whether the same basis is still optimum or not (of course not restarting from scratch!!)

Is coin-or Clp able to do that and how ? If not, do you know another free LP solver which can make it ?

$\endgroup$
  • 1
    $\begingroup$ Welcome to SciComp.SE! To format code, you need to indent by four spaces. (I have also removed the "thanks", since thanking someone on StackExchange is best done via upvotes and accepting answers.) $\endgroup$ – Christian Clason Jun 21 '13 at 14:40
1
$\begingroup$

Any linear programming solver should be able to give you sensitivity information. The information you'll need for assessing the sensitivity to changes in the cost vector is the reduced cost vector and the simplex tableau. You should be able to get the reduced cost information from a call to solver.getReducedCost() (for the reduced cost; uses nomenclature from your example program).

Although the simplex tableau should be available directly, it is not. You will need to use calls to solver.getColumnStatus(j) (to determine whether or not $x_{j}$ is a basic variable). Once you know the basic variables -- they will have values of ClpSimplex::basic -- you can calculate the simplex tableau explicitly from this information.

You should be able to get the call signatures from the CLP user guide, and then you can use a linear programming textbook to calculate the sensitivity information explicitly in your code.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.