2

So pulp seems to be doing its job, I call prob.solve() and get the results.

What I am hugely missing and cannot find is a complete report, similar to scipy output after linprog;

     con: array([-2.75732770e-11, -5.51465540e-11, -2.75728329e-11])

     fun: 3.6000000001467547

 message: 'Optimization terminated successfully.'

     nit: 4

   slack: array([], dtype=float64)

  status: 0

 success: True
       x: array([5.00000000e-01, 2.43836732e-11, 5.00000000e-01, 5.00000000e-01,
       5.00000000e-01])

Now I know I can call:

prob.status

But that is basically it. If problem is unfeasible (i.e. status = -1) I am missing tools to debug it. What I cam to so far is e.g. to iterate through constrains and find the ones which are unsatisfied:

for c in prob.constraints:
eps = 1e-13
if abs(prob.constraints[c].value())> eps:
    print(c,int(prob.constraints[c].value()))

But I still miss some standard outputs:

  • number of iterations
  • gap
  • gradient/hessian
  • slack (if active)
  • precision (if set or obtained)

Is it something I cannot find in the docu, or something that is actually missing?

  • 1
    Can you share a reproducible example? The information you get from pulp actually depends on the solver pulp is using. Try giving the argument `msg=1` to get more information on what the solver is doing. – pchtsp May 27 '20 at 21:27
  • Somewhat typically, linear programs are difficult to debug holistically, and instead you need to comment out your constraints one by one to find out which one is problematic. Though you didn't add any meaningful code to this question, so four years later I doubt we can help you with a solution. – Reinderien Apr 07 '23 at 21:35

0 Answers0