Find a vector x which minimizes c . x subject to the constraint m . x >= b, x integer.
Here's a sample input set:
c : {1,2,3}
m : {{1,0,0},
{0,1,0},
{1,0,1}}
b : {1,1,1}
With output:
x = {1,1,0}
What are good tools for solving this sort of problem, and examples of how to use them?
I am using Python & Pyomo. There is a good overview of the advantages on the project website: http://www.pyomo.org
Mathematica
Mathematica has this built in. (NB: Mathematica is not free software.)
outputs:
You've specified a pure integer programming problem. Most practical applications usually involve what is called mixed integer programming where only some of the variables are integer. A reasonably concise tutorial & essay on the subject can be found here:
http://mat.gsia.cmu.edu/orclass/integer/integer.html
Typical solution techniques for IP problems are dynamic programming or branch and bound. Searching on these terms should help you find some freeware, shareware, or academic code.
Good luck
There is a similar question on scicomp.stackexchange.com and an answer which lists a few libraries.
These type of simple problems can also be solved using a technique called constraint programming. You can find more details about the technique and free and commercial solvers available to solve these problems from the corresponding wikipedia entry. If the problems involving integer variables are more complex than what you mention, it is better to consider general purpose Linear Programming/Integer Programming solvers (like GLPK). There are a bunch of them, some names are: LPSOLVE (free), IBM ILOG CPLEX (Commercial).
GLPK
I'm offering an answer using GLPK's glpsol, but I hope there are much better ways to do this (it seems like GLPK is overly powerful/general for this kind of simple special case of a linear programming problem):
In order to generate the .mps file given below you've got to split up your matrices row-wise into a system of equations, so the problem description becomes:
GLPK documentation has detailed info on the .mps format, but you specify the rows, columns, rhs, and bounds. In the ROWS section the 'N' and 'G' specify the type of constraint (number, and greater than respectively). In the BOUNDS section the 'UI' specifies that the bounds are upper integer type, forcing the solution to be integer.
To run the solver on the problem specification:
example.mps file:
outputs:
Also, I'm not clear on how to directly get the x vector that solves the problem, though it is encoded in the output above in this section: