1
votes

I am new to Cplex Python APIs, but I worked with Cplex OPL, in OPL, you can easily write this objective function Max [sum C_ij*X_ij] as:

Maximize sum(i in set1,j in set2) C_ij*X_ij

if we want to use python API, we have to define it in vector format Max C*X, which C and X are both vectors of coefficients and variables respectively. So you need to make the vector format from C_ij matrix.

Is there any way to write it in matrix format like what we do in OPL?

1

1 Answers

1
votes

The CPLEX Python API does not support this, but the DOcplex Modeling for Python API is similar to OPL. For a quick start to the later see the Creating a MP model in a nutshell page, and Model.sum in the reference manual.