abdelhamedia
abdelhamedia

Reputation: 85

Solve linear programming equations with integer result

I am using the following matlab tool to solve my linear equations
x = linprog(f,A,b,Aeq,beq,lb,ub) all things going well with me, but the result of x vector not integer values. so how can I set the x vector to be integer value or take value 0 or 1 only.(I mean solve linear equations for integer result).

let me explain more: if I want to min x for the objective function 8X1 + X2 subject to
x1+2x2≥−14, −4x1−x2≤−33, 2x1+x2≤20 the result of X1,X2 not integer value.

Upvotes: 1

Views: 254

Answers (1)

scmg
scmg

Reputation: 1894

If you have Matlab version 2014a above, then there is intlinprog for what you are looking for.

UPDATE: Since you have Matlab 2012b, so i strongly suggest you to use this perfect tool at first, but you need something called Internet connection [j/k :-)]. By the way, there are some solutions:

  1. something on Matlab exchange.
  2. GLPK (GNU Linear Programming Kit)
  3. answered question on stackoverflow

Upvotes: 2

Related Questions