All request and response bodies in the Simplex Optimizer API are defined as Pydantic v2 models inDocumentation 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.
backend/app/models/schemas.py. Pydantic validates every incoming payload automatically—type mismatches or out-of-range values produce a 422 Unprocessable Entity before the solver is ever called. The sections below document every schema grouped by functional area, with field types, constraints, and default values noted inline.
Shared Types
These schemas appear across multiple solver endpoints and are referenced by both request and response models.Constraint
Represents a single linear constraint used by the Simplex, binary integer, and pure integer solvers.
Left-hand-side coefficients for each decision variable. Must contain between 2 and 5 elements, and the length must match the number of elements in the corresponding request’s
objective array.The constraint direction. Accepted literals:
"<=", ">=", "=".Right-hand-side value of the constraint.
Example Constraint
TableauRow
A single row of a Simplex tableau snapshot, carrying the name of the basic variable in that row and the full row of numeric values (including objective row coefficients and the RHS).
The label of the basic variable occupying this row (e.g.
"x1", "s2", "Z").All numeric entries for this tableau row, left to right, including the RHS column.
IterationTableau
A complete snapshot of the Simplex tableau at one pivot step, returned as part of SimplexResponse.iteration_tableaux.
Zero-based iteration index. Iteration
0 is the initial tableau before any pivots.Label of the variable entering the basis at this step.
null on the final (optimal) tableau.Label of the variable leaving the basis at this step.
null on the final tableau.Column header labels for the tableau (e.g.
["x1", "x2", "s1", "s2", "RHS"]).All rows of the tableau at this iteration, including the objective row.
Graphical LP Types
These schemas are embedded inSimplexResponse.graphical when the LP has exactly two decision variables, and they power the front-end constraint/feasible-region chart.
GraphPoint
A single 2-D coordinate.
Horizontal axis value.
Vertical axis value.
GraphLine
One constraint or objective line in the graphical LP plot, in the form ax + by = c.
Coefficient of the first variable (x-axis).
Coefficient of the second variable (y-axis).
RHS constant of the line equation.
Two endpoints used to draw the line segment across the chart bounds.
Human-readable label for the line (e.g.
"C1", "Objective"). null when no label is set.Direction of the half-plane:
"<=", ">=", or "=". null for the objective line.GraphBounds
Axis extents for the graphical LP chart.
Minimum x-axis value.
Maximum x-axis value.
Minimum y-axis value.
Maximum y-axis value.
GraphicalData
The complete graphical payload embedded in a two-variable SimplexResponse.
Solution status:
"optimal", "unbounded", or "infeasible".Chart axis extents.
One
GraphLine entry per constraint, in the same order as the request.Ordered vertices that form the boundary of the feasible region.
null when the problem is infeasible or unbounded.All corner points of the feasible region, including those not evaluated by the objective.
The objective function drawn at the optimal value.
null when the problem is not optimal.The optimal solution point.
null when no optimal solution exists.Objective function value at the optimal point.
null when not optimal.The optimization direction:
"max" or "min".Branch & Bound Node Types
These schemas describe individual nodes in the Branch & Bound enumeration tree returned by the binary and pure integer programming solvers.BBNode
A single node in the binary Branch & Bound tree (BinaryResponse.nodes).
Unique integer identifier for this node, assigned in exploration order (root =
0).node_id of the parent node. null for the root node.Depth of this node in the tree (root =
0).Variables fixed to binary values at this node. Keys are variable names (e.g.
"x1"), values are 0 or 1.Optimal LP relaxation objective value at this node.
null if the LP relaxation was infeasible.LP relaxation variable values at this node.
null if infeasible.Node disposition string, e.g.
"explored", "pruned_infeasible", "pruned_bound", "integer_feasible".Variable name that was branched on to create this node’s children.
null for leaf nodes.Label for the edge connecting this node to its parent in a tree visualization (e.g.
"x2 = 0"). null for the root.IntegerNode
A single node in the pure integer Branch & Bound tree (IntegerResponse.nodes). Similar to BBNode but uses continuous lower/upper bounds rather than fixed binary assignments, and records the branching direction.
Unique node identifier in exploration order.
Parent node ID.
null for the root.Tree depth of this node (root =
0).Current lower bounds for each decision variable at this node.
Current upper bounds for each decision variable at this node.
LP relaxation objective at this node.
null if infeasible.LP relaxation variable values.
null if infeasible.Node status string (same vocabulary as
BBNode.status).Variable branched on to produce children.
null for leaf nodes.Which side of the branch this node represents:
"down" (floor bound tightened) or "up" (ceiling bound tightened). null for the root.Human-readable edge label for tree visualization (e.g.
"x1 ≤ 3"). null for the root.Nonlinear Optimization Types
These schemas appear in the gradient descent, graphical multivariable, and KKT solver responses.CriticalPointSchema
A classified critical point returned by the graphical multivariable solver (GraphicalMultivarResponse.critical_points).
Coordinate vector of the critical point, with one entry per variable (length matches
variables).Objective function value at this critical point.
Classification of the critical point. One of:
"min", "max", "saddle", "degenerate".Example CriticalPointSchema
SurfaceData
A 2-D grid of function values for a two-variable function, used by the front-end to render a Plotly surface chart (GraphicalMultivarResponse.surface).
Sorted x-axis sample values (grid columns).
Sorted y-axis sample values (grid rows).
2-D matrix of function values.
z[i][j] is f(x[j], y[i]). Individual entries may be null where the expression is undefined (e.g. division by zero, domain error).The
z array is row-major: the outer list indexes over y values and the inner list indexes over x values, matching Plotly’s expected layout for go.Surface.VolumeData
A flat list of sample points and function values for a three-variable function, used by the front-end to render a Plotly volume or scatter3d chart (GraphicalMultivarResponse.volume).
x-coordinate for each sample point.
y-coordinate for each sample point.
z-coordinate for each sample point.
Function value
f(x, y, z) at each sample point. Entries are null where the expression is undefined.KKTCase
One explored combination of active inequality constraints in the KKT solver (KKTResponse.cases). The solver enumerates every subset of inequality constraints that could be simultaneously active, attempts to solve the resulting KKT system, and records the outcome here.
Sequential index of this case (zero-based), assigned in enumeration order.
Indices (into
KKTRequest.constraints) of the inequality constraints assumed active (binding) in this case. Equality constraints are always active.Outcome of solving the KKT system for this case. One of:
"valid"— a KKT point was found, primal and dual feasibility hold."dual_infeasible"— the multiplier signs violate dual feasibility (not a true optimum for the given goal)."primal_infeasible"— the solution violates at least one constraint."no_convergence"— the Newton solver did not converge within the iteration limit.
Decision variable values at the KKT point.
null when status is not "valid".Lagrange multipliers for equality constraints, keyed by constraint index string.
null when no equality constraints are active or when the system did not converge.KKT multipliers for inequality constraints, keyed by constraint index string.
null when no inequality constraints are active.Objective function value at this KKT point.
null when a valid point was not found.A plain-language description of why this case was accepted or rejected (e.g.
"Dual infeasible: mu[0] < 0").Example KKTCase (valid)
Example KKTCase (dual infeasible)
Single-Variable Iteration Types
These schemas appear as list items inside theiterations array of the bisection and Newton-Raphson solver responses.
BisectionIteration
One step of the derivative-bisection algorithm, returned in BisectionResponse.iterations.
One-based iteration counter.
Left endpoint of the search interval at the start of this iteration.
Right endpoint of the search interval at the start of this iteration.
Midpoint
m = (a + b) / 2 evaluated in this step.Objective function value
f(m) at the midpoint.First derivative value
f′(m) at the midpoint. The bisection is applied to f′, so the interval is updated based on the sign of this value.Current interval width
|b − a|. Convergence is declared when this falls below the requested tolerance.Example BisectionIteration
NewtonIteration
One step of the Newton-Raphson method applied to f′(x) = 0, returned in NewtonResponse.iterations.
One-based iteration counter.
Current iterate
xₙ.Objective function value
f(xₙ).First derivative
f′(xₙ). The update step zeros this quantity.Second derivative
f″(xₙ). Used as the denominator in the Newton update: xₙ₊₁ = xₙ − f′(xₙ) / f″(xₙ).Next iterate
xₙ₊₁ after applying the Newton step.Signed step size
xₙ₊₁ − xₙ. Convergence is declared when |step| falls below the requested tolerance.Example NewtonIteration
Multivariable Iteration Types
GradientIteration
One step of the gradient descent or ascent algorithm, returned in GradientResponse.iterations.
One-based iteration counter.
Current iterate vector
xₙ, with one entry per variable (length matches variables).Gradient vector
∇f(xₙ) evaluated at the current point. Each entry is the partial derivative with respect to the corresponding variable.Euclidean norm
‖∇f(xₙ)‖₂. Convergence is declared when this falls below the requested tolerance.Objective function value
f(xₙ) at the current point.Example GradientIteration