Mixed-Integer Linear Programming
A linear model with some integer or binary decisions.
In plain terms
Some decisions are all-or-nothing: build a factory or not, buy 3 machines but never 3.5. When a plan mixes these yes/no or whole-number choices with ordinary quantities, it becomes a mixed-integer problem: much harder, because the solver can’t just nudge a dial, it has to choose.
The technical picture
Mixed-integer linear programming adds integrality: some variables must take whole-number or yes/no values, which is what makes the problem combinatorial.
Branch-and-bound based established solvers are strong on MILPs. Quicopt supports them too, and is most valuable when the integer decisions are coupled to structurally hard terms (higher-order, non-convex, or black-box) that those solvers cannot take in their native form.
Mathematical model▾
Minimize a linear objective subject to linear constraints, with a subset of variables restricted to integers.
Example
From install to solved model: a small, self-contained example, copy-paste ready.
Install the client
$ pip install "quicopt[mathopt]"Copy the example
from ortools.math_opt.python import mathopt
from quicopt import Client
# A tiny mixed-integer model: one continuous and one integer variable.
model = mathopt.Model(name="milp")
x = model.add_variable(lb=0.0, name="x")
y = model.add_integer_variable(lb=0.0, ub=10.0, name="y")
model.add_linear_constraint(x + 2 * y <= 14)
model.add_linear_constraint(3 * x - y >= 0)
model.maximize(3 * x + 4 * y)
client = Client("https://try.quicoptapi.pgi.fz-juelich.de")
result = client.solve(model)
print(result.display)Run it
$ python milp.py├── status: optimal ├── feasible: true ├── objective: 42.0 ├── x: x=14, y=0 (2 variables) └── solve_time: 0.0041 s
Docs, API reference and more examples live in the Developer Hub →
Benchmark
How Quicopt performs on representative mixed-integer linear programs.
Measured results for this class are being prepared and will appear here.
Worked guides
Step-by-step, runnable guides for problems in this class (developer hub, in English):
Assign N workers to N tasks at minimum total cost — as a MILP, not O(n!) permutations.
Knapsack problem →Pick the highest-value items within a weight budget — as a MILP, not 2^n subsets.
Job scheduling (makespan) →Split jobs across machines to finish as early as possible — as a MILP, not M^n assignments.
Maximum independent set →The largest set of vertices with no shared edge — as a MILP, proven optimal, not a greedy pass.
Traveling salesman (TSP) →Shortest tour visiting every city once — as a MILP (MTZ), not (n-1)! permutations.
Bin packing →Pack items into the fewest bins — as a MILP, proven optimal, not first-fit-decreasing.
Set cover →Fewest sets that cover every element — as a MILP, proven optimal, not greedy.
Employee shift scheduling →Cover each day’s staffing demand with the fewest workers — as a MILP.
Graph coloring →Fewest colors so adjacent vertices differ (chromatic number) — as a MILP.
Facility location →Which facilities to open + how to serve demand at min cost — as a MILP.
Vehicle routing (VRP) →Route a capacity-limited fleet from a depot at min distance — as a MILP (CVRP).