The Simplex Optimizer is a full-stack monorepo that pairs a Python 3.11 + FastAPI backend with a React 18 + TypeScript + Vite frontend. The backend exposes a versioned REST API atDocumentation 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.
/api/v1, housing seven solver routers and nine engine classes that handle everything from classic Big-M simplex to Branch & Bound, bisection, gradient descent, and Karush-Kuhn-Tucker conditions. The frontend consumes those endpoints through a thin service layer and renders results — tableaux, graphical feasible regions, B&B trees, and 3-D surfaces — using an atomic component hierarchy that scales from individual Button atoms up to full solver pages.
Monorepo structure
The repository is split into two top-level directories. Thebackend/ tree contains the FastAPI application, all engine classes, Pydantic v2 schemas, and a requirements.txt that pins every dependency to an exact version. The frontend/ tree contains the React application, atomic design component hierarchy, hooks, service modules, and shared TypeScript types.
Data flow
Every user interaction follows the same end-to-end path, from form input through the engine and back to the display layer.User fills the form
A React page component (e.g.
SolverPage) renders an ObjectiveForm and ConstraintsForm organism, collecting coefficients, the optimization goal (max/min), and constraint rows.Hook manages state and dispatch
Submitting the form calls
solve() from the relevant hook (e.g. useSimplex). The hook sets loading: true, builds the typed request payload from form state, and delegates to the service layer.Service makes the HTTP call
The service module (e.g.
simplexApi.ts) calls fetch against VITE_API_URL/simplex/solve with Content-Type: application/json. Non-2xx responses are converted into a typed ApiError.FastAPI route validates and dispatches
The matching router validates the request body against its Pydantic v2 schema, instantiates the engine class with the parsed parameters, and calls
.solve().Engine computes the solution
The engine (e.g.
SimplexEngine) builds the tableau internally using NumPy, iterates the Big-M pivot algorithm, and returns a SimplexResult dataclass containing the status, objective value, variable assignments, tableau rows, and per-iteration snapshots.Pydantic serializes the response
The route handler converts the dataclass into the appropriate Pydantic response model (e.g.
SimplexResponse), which FastAPI serializes to JSON automatically.Solver modules
The application covers seven distinct optimization methods, each with its own route, engine, schema, service, and hook.| Method | Route prefix | Variables | Description |
|---|---|---|---|
| Big-M Simplex | /simplex | 2 – 5 | LP maximization and minimization |
| Binary B&B | /binary | 2 – 5 | 0/1 integer programming via Branch & Bound |
| Pure Integer B&B | /integer | 2 – 5 | General integer programming |
| Bisection | /bisection | 1 | Single-variable unconstrained optimization |
| Newton-Raphson | /newton | 1 | Newton’s method for unconstrained optimization |
| Gradient descent | /gradient | 2 – 3 | Multi-variable gradient method + graphical output |
| KKT | /kkt | 2 – 3 | Karush-Kuhn-Tucker conditions for constrained NLP |
Detail pages
Backend Architecture
FastAPI app setup, seven router modules, engine class patterns, Pydantic v2 schemas, CORS configuration, and auto-generated API docs.
Frontend Architecture
React 18 atomic design layers, hooks, service modules, TypeScript types, Plotly.js integration, and Vite build tooling.