Find an optimal solution for a linear system with two inequations

조회 수: 1 (최근 30일)
Hello expert i have a function that i have to maximize, and i don't i have much information about algorithm that i should use , i used the MILP but it doesn’t work well .
The function : Max (x1+x2)
Contraints : 150x1+200x2 <= 164
X1+x2 <= 2
X1 and x2 are binary
I will be very grateful if you can help me
  댓글 수: 2
James Tursa
James Tursa 2019년 6월 7일
What does "x1 and x2 are binary" mean? Do you mean they are both integers?
Imane hammou ouali
Imane hammou ouali 2019년 6월 8일
thanks for asking !
x1 and x2 takes just 0 or 1

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

채택된 답변

Walter Roberson
Walter Roberson 2019년 6월 8일
intlinprog([-1 -1], 1:2, [150 200;1 1], [164;2],[],[],[0 0],[1 1])

추가 답변 (1개)

James Tursa
James Tursa 2019년 6월 8일
편집: James Tursa 2019년 6월 8일
The way you have this problem posed, and assuming by "binary" you mean integer, it can be solved by simple inspection. The max value is simply 2 and can be achieved in many ways. E.g., x1 = 5 and x2 = -3. Maybe there is something missing in your problem statement? Or maybe by "binary" you really did mean just 0 or 1 values?

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by