How meta/rebalancer works
Rebalancer is an assignment-optimization library: users define objects, containers, an initial assignment, constraints and goals, select a solving strategy, then receive an assignment result. The README documents local search and MIP solving, with Gurobi, Xpress and HiGHS backends. The repository also contains an Explorer web application for inspecting runs and assignments; sampled routes show its API-to-client dispatch. Some solver and Explorer implementation paths are represented by their exact enclosing directories because their source was not sampled.
Main entry points: rebalancer Explorer API routes · ProblemFactory.cpp Backend selection · cpp_server Explorer backend · Problem.h Problem API
Components 21
Problem modeling
- Python specs
src/rebalancer/specs.py - Problem API
algopt/lp/generic/Problem.h - Assignment model
algopt/rebalancer/entities
Solving
- Solver strategy
algopt/rebalancer/interface/StrategyBuilder.cpp - Local search
algopt/rebalancer/solver - MIP formulation
algopt/lp - Assignment result
algopt/rebalancer/interface/ProblemSolver.cpp
MIP backends
- Backend selection
algopt/lp/factory/ProblemFactory.cpp - Gurobi adapter
algopt/lp/detail/gurobi/GurobiProblem.cpp - Xpress adapter
algopt/lp/detail/xpress/XpressProblem.cpp - HiGHS adapter
algopt/lp/detail/highs/HiGHSProblem.cpp
Run Explorer
- Run inspection UI
algopt/rebalancer/explorer/app/app/(authenticated)/run/[runId] - Explorer API routes
algopt/rebalancer/explorer/app/app/api/rebalancer - Handle route wrapper
algopt/rebalancer/explorer/app/lib/api-handler.ts - Entity queries
algopt/rebalancer/explorer/app/lib/client/entity.ts - Move queries
algopt/rebalancer/explorer/app/lib/client/moves.ts - Evaluation queries
algopt/rebalancer/explorer/app/lib/client/evaluation.ts - Tree queries
algopt/rebalancer/explorer/app/lib/client/tree.ts - Explorer backend
algopt/rebalancer/explorer/cpp_server
Other components
- Problem author
- Explorer user
Connections 23
- Problem author → Python specs: defines specs
- Problem author → Problem API: defines problem
- Problem API → Assignment model: models assignment
- Problem API → Solver strategy: selects strategy
- Solver strategy → Local search: runs local search
- Solver strategy → MIP formulation: chooses MIP
- MIP formulation → Backend selection: uses backend
- Backend selection → Gurobi adapter: selects backend
- Backend selection → Xpress adapter: selects backend
- Backend selection → HiGHS adapter: selects backend
- Local search → Assignment result: produces assignment
- MIP formulation → Assignment result: produces assignment
- Explorer user → Run inspection UI: inspects runs
- Run inspection UI → Explorer API routes: requests run data
- Explorer API routes → Handle route wrapper: wraps requests
algopt/rebalancer/explorer/app/app/api/rebalancer/move-sets/route.ts - Explorer API routes → Entity queries: dispatches entity queries
algopt/rebalancer/explorer/app/app/api/rebalancer/typeahead/route.ts - Explorer API routes → Move queries: dispatches move queries
algopt/rebalancer/explorer/app/app/api/rebalancer/move-sets/route.ts - Explorer API routes → Evaluation queries: dispatches evaluations
algopt/rebalancer/explorer/app/app/api/rebalancer/evaluate-metric-collection/route.ts - Explorer API routes → Tree queries: dispatches tree queries
algopt/rebalancer/explorer/app/app/api/rebalancer/tree-node/route.ts - Entity queries → Explorer backend: queries backend
- Move queries → Explorer backend: queries backend
- Evaluation queries → Explorer backend: queries backend
- Tree queries → Explorer backend: queries backend