Pure Integer Programming (IP) solves linear optimization problems in which every decision variable must be a non-negative integer. Unlike Binary Integer Programming — where each variable is restricted to exactly 0 or 1 — pure integer variables can take any non-negative integer value (0, 1, 2, 3, …). The solver uses a Branch and Bound algorithm that systematically explores candidate solutions while pruning regions that cannot improve the best integer solution found so far.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/FabianeloV/Metodo-simplex/llms.txt
Use this file to discover all available pages before exploring further.
How Branch and Bound Works
The algorithm begins by solving the LP relaxation of the problem at the root node (integrality constraints are temporarily dropped). It then proceeds depth-first through a search tree:- Integer solution found — if all variables in the LP solution are already integers, the node is recorded as a candidate and the best-known bound is updated.
- Prune by infeasibility — if the LP relaxation at a node is infeasible or unbounded, the subtree is discarded.
- Prune by bound — if the LP objective at a node is no better than the current best integer solution, the subtree is discarded.
- Branch — the algorithm selects the most-fractional variable (the one whose fractional part is closest to 0.5) and creates two child nodes:
- Floor child: adds the constraint xᵢ ≤ ⌊v⌋
- Ceil child: adds the constraint xᵢ ≥ ⌈v⌉
lower_bounds and upper_bounds dictionaries that accumulate all branching constraints from root to that node. The search stops when no more nodes remain, or the 500-node safety limit is reached.
Pure Integer vs. Binary Integer: In Binary Integer Programming every variable is fixed between 0 and 1, so branching simply assigns a variable to 0 or to 1. In Pure Integer Programming, variables can grow arbitrarily, so each branch instead tightens a lower or upper bound — tracked independently for every node in the tree.
Endpoint
Request
Send a JSON body matchingIntegerRequest. The structure is identical to a standard Simplex request — the engine enforces integrality automatically.
Body fields
Coefficients of the objective function, one per decision variable. Must contain between 2 and 5 elements. Variables are labelled
x1, x2, … in the order they appear.Example: [5, 4] represents the objective 5x1 + 4x2.Optimization direction. Accepted values:
"max" or "min".Array of linear constraints. Each constraint object contains:
Response
Top-level fields
Result status of the solver run:
"optimal"— a best integer solution was found and confirmed."infeasible"— no feasible integer solution exists."limit"— the 500-node exploration limit was reached; the best incumbent (if any) is returned.
The optimal objective value achieved by the integer solution, or
null when infeasible.Mapping of variable names to their optimal integer values, e.g.
{"x1": 3, "x2": 2}. null when infeasible.Total number of Branch and Bound nodes evaluated during the search.
Full list of every node visited during the search. Used by the frontend to render the interactive Branch and Bound tree visualization.
Human-readable summary of the result, including the optimal value and the total number of nodes explored.
Example
Maximize Z = 5x1 + 4x2 subject to:- 6x1 + 4x2 ≤ 24
- x1 + 2x2 ≤ 6
- x1, x2 ≥ 0 and integer
The
nodes array is consumed directly by the frontend tree visualization. Each node’s node_id and parent_id form the edges of the directed graph, and edge_label is rendered on the connecting arc.