필터 지우기
필터 지우기

Different optimization solutions with weighted objective functions

조회 수: 3 (최근 30일)
b999
b999 2023년 9월 23일
댓글: Matt J 2023년 9월 24일
Hi everybody,
I want so solve an optimization problem regarding integers in a matrix. I am using the problem-based approach with intlinprog.
The objective function is e.g.
f_1 = -sum(col(x(:,:,1))); % Maximize the 1s
f_2 = -sum(col(x(:,:,3))); % Maximize the 3s
w_1 = 1;
w_2 = 1;
w = 1;
fun = w*(w_1*f_1 + w_2*f_2);
prob.Objective = fun;
In this case the two parts of the objective function (f_1 and f_2) are weighted equally. But the optimized solution depends on the overall weighting factor w.
For example
for w=1 :
number 1s = 1
number 3s = 6
for w = 10:
number 1s = 3
number 3s = 4
for w = 50/ w = 100
number 1s = 1
number 3s = 6
for w = 150
number 1s = 3
number 3s = 4
So the total number of 1s and 3s is always the same, but the allocation of the numbers is different depending on w.
I thought that the number are always be the same because of the same weight w_1 and w_2. Why is the solution of the optimization dependent on the w? And why am I not getting the optimal solution, I think in thsi case that there are three 1s and four 3s when I am weighting the two objective functions the same?
I know it is not a complete example, I would like to understand in theory why the results can be different when the objective function is weighted.

채택된 답변

Bruno Luong
Bruno Luong 2023년 9월 23일
편집: Bruno Luong 2023년 9월 23일
They are all optimal solution since the number of 1 + number of 3 are 7 in 4 cases.
Your objective function (divided by w) are the same, there is no preference bwteen 4 solutions.
When your change the total weight the algorithm (cut and bounds) behave differently, it follow different trajectory (it is an iterative method) and ends uop at different solution. There is nothing to be puzzeled about it.
  댓글 수: 4
Matt J
Matt J 2023년 9월 24일
It's deterministic since the intlinprog algorithm is deterministic
Although, you may find that the same code gives you different solutions on different CPUs.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by