0

I would like to enter a complicated objective function in IBM's Cplex using Python API. The easiest way to do this it to enter it in Algebraic Mode. There is some instruction on page 191 of this document on how to enter objective function in Algebraic mode but none for how do so using the Python API.

Thanks

user58925
  • 1,537
  • 5
  • 19
  • 28

1 Answers1

0

The document says:

This view is supported by the LP format, when you enter a quadratic objective function in the Interactive Optimizer, and by Concert Technology.

It's directly not available in the CPLEX Python API (an index based API similar to the underlying C Callable Library). However, you can read an LP file with the Python API, so that is one way to do it.

Another option is to consider using DOcplex (a modeling language that can utilize a local CPLEX Python API installation or solve on the cloud via the docplexcloud service). See the Beyond Linear Programming Tutorial Notebook for an example of using a quadratic objective with DOcplex.

rkersh
  • 4,447
  • 2
  • 22
  • 31