Nexma MathEngine
Provably optimal spatial decisions
Nexma MathEngine is the optimization engine Jax calls when a question crosses out of "look it up" into "compute the best answer." It turns spatial goals and the world model's constraints into formal optimization problems and solves them — returning plans that are provably optimal and fully auditable. Manual plans satisfy a deadline; optimization satisfies an objective, and proves how close it got.
Core concepts
You state the business goal. Jax formulates the math. The MathEngine solves it and explains the result.
- Jax formulates the model. It translates your objective and the active Ontology's rules into a formal problem — objective, variables, and constraints. You do not write the math.
- Constraints come from the Ontology. Engineering standards and domain rules defined in the world model become solver constraints, so plans are valid by construction, not by review.
- Results are verifiable. Every result reports its optimality gap — how close it is to provably optimal — plus which constraints were binding and what drove the objective.
- Jax invokes it through `Solve`. The MathEngine is reached through one of the eight primitives. Many questions need no optimization at all; Jax uses the right tool for each.
"How many homes are in this polygon?" is aRead. "What is the cable length between these closures?" isRun. "What is the lowest-cost layout that serves all of them?" isSolve.
The solver families
Nexma ships a family of solvers covering most spatial optimization work. Jax dispatches automatically based on the shape of the problem — no manual selection.
| Family | What it does | Typical use |
|---|---|---|
| MIP | Discrete decisions under linear constraints; provable optimality | Facility location, siting, assignment, cabinet placement |
| VRP | Capacitated routing with time windows, pickups, deliveries, driver-hour rules | Fleet and crew routing, account-visit planning |
| CP | Combinatorial scheduling with rich constraint semantics | Crew scheduling, deadline rollups, resource leveling |
| Simulation | Time-stepped or event-driven simulation | Pressure-drop validation, pedestrian flow, outcome prediction |
| Heuristic | Fast approximate search when an exact method is overkill | Large, loosely constrained layout and routing problems |
| Graph | Shortest-path, max-flow, MST, betweenness, community detection | Routing, hierarchy layout, reachability |
How it works
The engine formulates, dispatches, solves, and proves — in one loop Jax drives.
1Goal: "Site cabinets to serve every household at lowest cost."
2 1. Formulate objective: minimize Σ cost · x
3 constraints: capacity, coverage, budget (from the Ontology)
4 2. Dispatch choose the solver family by problem shape → MIP
5 3. Solve browser for small problems, server for large ones
6 4. Prove return the plan + optimality gap + binding constraintsBrowser versus server dispatch
Solvers run in two places, and the dispatcher chooses automatically.
- In the browser. Sub-second latency for problems that fit a single tab, so Jax feels instant.
- On a solver server. A managed service handles larger problems and any family that does not fit comfortably in the browser.
Both paths return identical result shapes; the calling logic never branches on location. If one approach stalls, the engine escalates to a more powerful family to keep making progress.
Self-correction
A solver returning a number is not the same as a correct design. If a result violates a domain constraint — a closure over its optical budget, a route that misses a time window, a transformer past thermal capacity — Jax detects the violation, reformulates the problem, and re-runs. The loop is bounded; after a small number of attempts Jax surfaces the problem to you in plain language rather than returning a silent failure.
This is the difference between "the solver returned a number" and "the design is correct." Nexma optimizes for the latter.
Extending the model
New constraints and objective functions are added through the Ontology and the bound Skill — a new constraint becomes a new term in the formulation. The dispatcher and the solver service do not change. Every result also carries the full formulation, so compliance and stakeholders get a defensible, reproducible record.
Where to go next
- Jax — the agent that formulates and dispatches each problem.
- GeoEngine — natural-language spatial analysis that hands off optimization here.
- Ontology — where the constraints the solver enforces are defined.
- The eight primitives — how
SolveandRundiffer.