Skip to main content

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.

The /api/v1/integer/solve endpoint solves Pure Integer Programming (IP) problems where every decision variable must take a non-negative integer value. The solver uses Branch & Bound with LP relaxation at each node, branching by applying floor/ceil bounds to fractional variables until an integer-feasible optimal solution is confirmed or the problem is shown to be infeasible.

Request

POST /api/v1/integer/solve
Content-Type: application/json
objective
list[float]
required
Coefficients of the objective function, one per decision variable. Must contain between 2 and 5 elements. Variables are named x1, x2, …, x5 in order.Example: [5, 8] represents 5x1 + 8x2.
goal
string
required
Optimisation direction. Accepted values: "max" or "min".
constraints
list[Constraint]
required
At least one linear constraint. Every constraint must have the same number of coefficients as objective.

Response

A successful call returns an IntegerResponse object.
status
string
Outcome of the solve. One of:
  • "optimal" — a best integer solution was found.
  • "infeasible" — no feasible integer assignment satisfies all constraints.
  • "limit" — the node limit was reached before proving optimality.
objective_value
float | null
Optimal objective value at the best integer solution found. null when status is "infeasible".
variables
object | null
Map of variable names to their optimal integer values, e.g. {"x1": 3, "x2": 2}. null when status is "infeasible".
nodes_explored
integer
Total number of Branch & Bound nodes evaluated during the search.
nodes
list[IntegerNode]
Complete Branch & Bound exploration tree, one entry per node.
message
string
Human-readable status message describing the result.

Example

Maximize 5x1 + 8x2 subject to:
  • x1 + x2 ≤ 6
  • 5x1 + 9x2 ≤ 45
curl -X POST https://api.example.com/api/v1/integer/solve \
  -H "Content-Type: application/json" \
  -d '{
    "objective": [5, 8],
    "goal": "max",
    "constraints": [
      {"coefficients": [1, 1], "inequality": "<=", "rhs": 6},
      {"coefficients": [5, 9], "inequality": "<=", "rhs": 45}
    ]
  }'
{
  "status": "optimal",
  "objective_value": 41.0,
  "variables": {
    "x1": 1,
    "x2": 4
  },
  "nodes_explored": 5,
  "nodes": [
    {
      "node_id": 0,
      "parent_id": null,
      "depth": 0,
      "lower_bounds": {"x1": 0.0, "x2": 0.0},
      "upper_bounds": {},
      "lp_value": 41.25,
      "lp_vars": {"x1": 1.25, "x2": 4.375},
      "status": "branched",
      "branched_on": "x2",
      "branch_direction": null,
      "edge_label": null
    },
    {
      "node_id": 1,
      "parent_id": 0,
      "depth": 1,
      "lower_bounds": {"x1": 0.0, "x2": 0.0},
      "upper_bounds": {"x2": 4.0},
      "lp_value": 41.0,
      "lp_vars": {"x1": 1.0, "x2": 4.0},
      "status": "integer_feasible",
      "branched_on": null,
      "branch_direction": "floor",
      "edge_label": "x2 ≤ 4"
    },
    {
      "node_id": 2,
      "parent_id": 0,
      "depth": 1,
      "lower_bounds": {"x1": 0.0, "x2": 5.0},
      "upper_bounds": {},
      "lp_value": 40.0,
      "lp_vars": {"x1": 0.0, "x2": 5.0},
      "status": "pruned_bound",
      "branched_on": null,
      "branch_direction": "ceil",
      "edge_label": "x2 ≥ 5"
    }
  ],
  "message": "Optimal integer solution found"
}
Unlike the Binary solver, Pure Integer Programming allows each variable to take any non-negative integer value. The solver applies tighter lower_bounds and upper_bounds progressively as it branches deeper into the tree.
All constraint coefficients arrays must have the same length as objective. Mismatched lengths return HTTP 422 Unprocessable Entity.

Health Check

GET /api/v1/integer/health Returns a liveness confirmation for the Pure Integer Programming service.
curl https://api.example.com/api/v1/integer/health
{
  "status": "ok",
  "service": "integer-optimizer-api"
}

Build docs developers (and LLMs) love