How to write sumation in IBM CPLEX Python API
<p>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:</p>

<p>Maximize
sum(i in set1,j in set2) C_ij*X_ij</p>

<p>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.</p>

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

<p>The <a href="http://www.ibm.com/support/knowledgecenter/SSSA5P_12.6.3/ilog.odms.cplex.help/refpythoncplex/html/help.html?pos=2" rel="nofollow">CPLEX Python API</a> does not support this, but the <a href="https://developer.ibm.com/docloud/documentation/optimization-modeling/modeling-for-python/" rel="nofollow">DOcplex Modeling for Python API</a> is similar to OPL.  For a quick start to the later see the <a href="https://cdn.rawgit.com/IBMDecisionOptimization/docplex-doc/master/docs/mp/creating_model.html" rel="nofollow">Creating a MP model in a nutshell</a> page, and <a href="https://cdn.rawgit.com/IBMDecisionOptimization/docplex-doc/master/docs/mp/docplex.mp.model.html#docplex.mp.model.Model.sum" rel="nofollow">Model.sum</a> in the reference manual.</p>

python cplex