Reputation: 37
I'm trying to solve a multi-objective problem in which I have to minimize two different objectives but with one taking priority over the other one.
To solve the problem, and hence the question, I tried to use weighted sum of both objective functions. The problem here is that that approach finds the minimum value between the two problems which I don't want. I want to solve one objective and then, maintaning that specific value, I want to solve the other problem.
Upvotes: 1
Views: 435
Reputation: 10059
You could use staticLex.
int nbKids=200;
float costBus40=500;
float costBus30=400;
float costBus50=625;
dvar int+ nbBus40;
dvar int+ nbBus30;
dvar int+ nbBus50;
dvar float cost;
dvar float co2emission;
minimize
staticLex(cost,co2emission);
subject to
{
cost==costBus40*nbBus40 +nbBus30*costBus30+nbBus50*costBus50;
co2emission==nbBus50+nbBus40*1.1+nbBus30*1.2;
40*nbBus40+nbBus30*30+nbBus50*50>=nbKids;
}
execute DISPLAY_After_SOLVE
{
writeln("The minimum cost is ",cost);
writeln("CO2 emission is ",co2emission);
writeln("We will use ",nbBus40," 40 seats buses ",nbBus30,
" 30 seats buses and ", nbBus50," buses 50 seats");
}
which gives
The minimum cost is 2500
CO2 emission is 4
We will use 0 40 seats buses 0 30 seats buses and 4 buses 50 seats
I posted this answer 5 days ago but that was deleted by a moderator.
See tiny example at https://www.ibm.com/developerworks/community/forums/html/topic?id=abac189a-0b99-4a08-bedf-78bbf919e14d
Upvotes: 1
Reputation: 5085
Version 12.9 of CPLEX has the ability to do exactly that: solve one objective, fix its value, and move to the next objective. Here's an example LP:
Maximize multi-objectives
first: abstol=2
x1
second: priority=-1
x2
Subject to
x1 + x2 = 10
General
x1 x2
End
This feature is described in the release notes, as well as in these slides.
Upvotes: 1