Search code examples
matlabintegermathematical-optimizationlinear-programming

Can linprog give an integer value of x's?


I have a linprog code that has x1,x2,x3 and x4 in the objective function.

The results I get give me values in the form:

 x = 
6.6667
0.0420
0 
0

Which in the case I am trying to model doesn't make physical sense because the x's represent the number of units of a specific technology, and therefore for example 0.0420 doesn't in fact exist. Is there anyway to "force" linprog to find the optimum integer value of x?

Thank you


Solution

  • That's called integer programming and in general is NP-hard. It's not covered by linprog as it's a completely different and much harder problem.

    Here's a related question (but not a duplicate) from Stack Overflow about Integer Programming.