How to create a multi-objective model with objective priority

时间:2019-06-01 13:59:53

标签: cplex opl

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.

3 个答案:

答案 0 :(得分:1)

CPLEX的12.9版可以完全做到这一点:解决一个目标,确定其价值,然后转移到下一个目标。这是一个示例LP:

Maximize multi-objectives
first: abstol=2
   x1
second: priority=-1
   x2
Subject to
   x1 + x2 = 10
General
   x1 x2
End

the release notesthese slides中都描述了此功能。

答案 1 :(得分:1)

您可以使用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");
}

给出

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 

我5天前发布了此答案,但被主持人删除了。

请参见https://www.ibm.com/developerworks/community/forums/html/topic?id=abac189a-0b99-4a08-bedf-78bbf919e14d

上的一个小例子

答案 2 :(得分:0)