How saikrishna0817/markov-cero works
markov-cero is a C++ mathematical optimization solver, with CLI, Python, and optional authenticated web entry points. Its main workflow is to parse and classify an LP/MPS model, prepare it for solving, dispatch to an appropriate optimization engine, then verify and report the result; supported MILP cases can also export replayable proofs. The README documents this pipeline and the major LP, MILP, QP, nonlinear, GPU, and ML capabilities. Some internal links below follow that documentation because the corresponding implementation was not sampled.
Main entry points: api.cpp Solve API · primal_verifier.cpp Result verification · engine_milp.cpp MILP branch and cut · server.py Web solve adapter
Components 22
User interfaces
- CLI tools
apps/markov_cero_solve.cpp - Python binding
python/src/bindings.cpp - Web workspace
web/src/App.tsx - Web solve adapter
web/backend/server.py
Model preparation
- Solve API
src/api/api.cpp - LP MPS NLP parsers
src/io/mps.cpp - Sparse model
src/model/model.cpp - Model classification
src/model/classifier.cpp - Presolve scaling canonicalize
src/presolve/presolve.cpp
Solve engines
- LP engines
src/api/engine_lp.cpp - MILP branch and cut
src/api/engine_milp.cpp - Parallel tree search
src/api/engine_parallel.cpp - QP ADMM KKT
src/api/engine_qp.cpp - Nonlinear SQP OA
src/api/engine_nonlinear.cpp
Verification and results
- Result verification
src/verify/primal_verifier.cpp - MIP proof replay
src/verify/mip_proof.cpp - JSON results
apps/json_output.hpp
Specialized capabilities
- GPU kernels
gpu/src/pdhg_solver.cpp - ML branching scorer
src/milp/ml_branching/onnx_scorer.cpp - Refinery modeling
src/refinery/refinery_model.cpp
Other components
- Model user
- Supabase auth
Connections 28
- Model user → CLI tools: submits model
- Model user → Python binding: submits model
- Model user → Web workspace: uses workspace
- Web workspace → Web solve adapter: sends solve request
- Web solve adapter → Supabase auth: validates session
- Web solve adapter → CLI tools: runs solver
- CLI tools → Solve API: calls solve
- Python binding → Solve API: exposes solve API
- Solve API → LP MPS NLP parsers: reads model
- LP MPS NLP parsers → Sparse model: builds model
- Solve API → Model classification: classifies model
- Solve API → Presolve scaling canonicalize: prepares model
- Solve API → LP engines: dispatches LP
- Solve API → MILP branch and cut: dispatches MILP
- Solve API → Parallel tree search: dispatches parallel search
- Solve API → QP ADMM KKT: dispatches QP
- Solve API → Nonlinear SQP OA: dispatches nonlinear
- LP engines → Result verification: checks witnesses
- MILP branch and cut → Result verification: checks primal
- Parallel tree search → Result verification: checks primal
- QP ADMM KKT → Result verification: checks KKT
- Nonlinear SQP OA → Result verification: checks local KKT
- MILP branch and cut → MIP proof replay: certifies result
- Parallel tree search → MIP proof replay: certifies result
- Solve API → JSON results: formats result
- LP engines → GPU kernels: uses optional backend
- MILP branch and cut → ML branching scorer: scores branches
- Model user → Refinery modeling: models refinery decisions