How to define constraints that result integer numbers in Linear programming?

조회 수: 7 (최근 30일)
Hello,
i need define the constraints in my linear programming problem, the constraints need to be integer numbers.
e.g.:
f = [28;31].*-1;
A = [3.5 4];
b = [50];
lb = [0;0];
x = linprog(f,A,b,[],[],lb,[])
x = [14.5 0]
if the constraint was integer the value of x become [12 2].
Thank you in advance.

채택된 답변

Shashank Prasanna
Shashank Prasanna 2013년 7월 16일
Mixed Integer constraints is currently not possible with linprog. If you have the global optimization toolbox, you can use GA to solve the problem:
If you don't then you can surely find something in File Exchange:

추가 답변 (1개)

Artur M. G. Lourenço
Artur M. G. Lourenço 2013년 7월 16일

카테고리

Help CenterFile Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by