I am trying to solve an optimisation problem where the variables I am trying to optimise are in a matrix (salesperson X shop, the variable is 1 if that salesperson is assigned to that shop). Each shop has a profit.
This is how I define it:
set SalesPeople;
set Shops;
param profit{Shops} >=0;
var a{i in SalesPeople, j in Shops}, binary;
I am now trying to add a constraint that says that the maximum over all salesperson of the sum over all shops of the profit is greater than a certain number. This is how I formulated it but this does not seem to work.
subject to cond3: max{i in SalesPeople} sum{j in Shops} profit[j]*a[i,j] >= 10;
Can this be done? If so, what is the right syntax?
I have only just started learning MathProg so it is all a bit confusing.
The constraint
is not linear, so a MIP solver cannot accept this. Unfortunately, this particular form requires extra binary variables. If the constraint was
we could write:
For your case we need to do something like:
The last constraint can also be written as:
This construct essentially says: "at least one
ishould have:sum{j in Shops} profit[j]*a[i,j] >= 10".