Hello everyone!,
I have three lists: BVILobby, CCGLobby and VRLobby.
The solution set will comprise of elements from these three lists. I want to ensure that no more than half (1/2) of all elements in solution set comprise of elements from BVILobby set and No more than one-third (1/3) of all elements in solution set comprise of elements from CCGLobby set, in the Final solution. The equations are as follows:
solver.Add(solver.Sum(2 * (X_j[BVILobby.index(l)]) for l in BVILobby) <=(solver.Sum((X_j[j]) for j in DUTY_COUNTER))) and\
solver.Add(solver.Sum(3 * (X_j[CCGLobby.index(k)]) for k in CCGLobby) <= (solver.Sum((X_j[j]) for j in DUTY_COUNTER)))
Here, X_j[j] = 1, if duty j in final solution, 0 otherwise and DUTY_COUNTER contains numbers corresponding to whole feasible solution set, from which the optimum is being derived. In some cases it does give the solutions in ratios specified but in some cases the constraints are not being followed at all. It gives solution clearly violating the ratios, and not giving warning of infeasibility.
I am using pywraplp as solver. I tried with pywrapcp also, but same results
Any help in this regard will be highly appreciated.
Thanks,
Abhishek