0

Is there a way to output the final tableau in python with docplex library? If not, is there a work around?

I want to use dual simplex method to solve linear programming problem with newly added constraints. So, I would need to access the final tableau to decide which variable to exit the basis, without having to re-solve the problem from scratch.

Aaron_Geng
  • 189
  • 1
  • 1
  • 14

1 Answers1

1

This sort of low level interaction cannot be done at the docplex level. In order to do this you can use Model.get_cplex() to get a reference to the underlying engine object. With this you can then get additional information. You can find the reference documentation for this class here. You probably want to look at the solution, solution.basis, solution.advanced properties. This should give you all the information you need.

Note that the engine works with an index oriented model in which every variable or constraint is just a number. You can convert docplex variable objects by using Model.get_var_by_index().

I also wonder whether you may want drop docplex and instead directly use the CPLEX Python API. You can find documentation of this here.

Daniel Junglas
  • 5,830
  • 1
  • 5
  • 22