Originally posted by: Semen11111
Hi guys, I'm in stuck, and I need help. I make this java code:
IloIntExpr q = cp.intExpr();
IloIntVar[][][] arr = ...;
for (int i = 0; i < day; i++)
{
for(int j = 0; j < workersTypesNum - 1; j++)
{
for(int j1 = j + 1; j1 < workersTypesNum; j1++)
{
q = cp.sum(q, cp.prod(arr[i][j], arr[i][j1]));
}
}
I start this code with profiler, and I get, that "cp.sum" function spend almost all time, so my first question: how can I fix it?
and the second question about logic: In my task I'd like to make all types of work in one day (this is my target function), and I decided to maximize quadratic function like: arr[i][j] * arr[i][j1],
where i -day numder, and j is work type (j <> j1). arr is matrix with 0 and 1.
But may be I do it wrong? maybe it's linear task at all?
thanks)
#CPOptimizer#DecisionOptimization