Reputation: 623
So in a typical Linear Optimization Problem, I would have an Objective like this:
Example of a Linear Program
maximize:
3x + y
subject to:
1.5 x + 2 y <= 12
0 <= x <= 3
0 <= y <= 5
However, perhaps I wanted to have two objectives? such as (not sure this is possible just adding a quick example)
maximize:
3x + y
maximize:
3x
subject to:
1.5 x + 2 y <= 12
0 <= x <= 3
0 <= y <= 5
so saying something like I want to maximize the value of 3x + y, but with maximum 3*x out of those solutions. Basically all I am asking is are there two variable optimizations? Where I can set two objectives?
I was using specifically Google-OR tools to do this in python.. just need someone to point me in the right direction
Upvotes: 2
Views: 2035
Reputation: 761
And if weighting as in @guissoares' answer is not good enough, then your best options are: 1. Try many different weightings, keep all the solutions, and observe the Pareto front (ie trade-offs) 2. Use a multi-objective algorithm such as NSGA2.
Upvotes: 0
Reputation: 496
When you have multiple objectives, typically you have not one, but a set of optimal solutions, because you usually have a trade-off between the objectives. That means that if you take an optimal solution, you might be able to increase one of the objectives even further, at the expense of the others, while maintaining the optimality.
To solve your problem, maybe you can assign a weight to each objective and combine them into a single one, such as in here:
maximize:
5(3x + y) + 2(3x)
subject to:
1.5 x + 2 y <= 12
0 <= x <= 3
0 <= y <= 5
In this example, I'm saying that I want to maximize both objectives, but in order to eliminate the multiplicity of optimal solutions I'm saying that I want the first objective to have a higher priority than the second one (weights 5
and 2
, respectively).
Of course, I can rewrite the previous example as:
maximize:
21x + 5y
subject to:
1.5 x + 2 y <= 12
0 <= x <= 3
0 <= y <= 5
which shows that the problem is again a single objective optimization.
Upvotes: 1