I built this experiment to make the cost of an optimization decision visible.
Seven service requests compete for three compute locations. Capacity, deadline, and cost constraints change which requests can be admitted. I compare a greedy heuristic and a genetic algorithm against an exhaustive reference, so a visitor can inspect both the assignments and how far a search result is from the optimum.
Explore recorded experiments · Read the model contract · Inspect the solvers
| Change | Inspect |
|---|---|
| Balanced capacity | Which requests go to the cheaper, slower location? |
| Scarce edge capacity | Which tight-deadline request loses its place? |
| Tighter deadlines | How much capacity becomes unusable because it is too far away? |
| Costly edge capacity | When is rejection better than a technically feasible placement? |
The hosted viewer shows actual saved results, not a running Python service. It includes five seeds, four configurations, placements and generation traces. The local app below runs fresh computations and lets you change the search budget.
Python 3.11+ and a browser. No packages, solver license, cloud account or API key.
git clone https://github.com/B8Z/placement-tradeoffs.git
cd placement-tradeoffs
python run.pyOpen http://127.0.0.1:8775. Choose Tighter deadlines, compare methods, and select a method to inspect its placements. Change the seed or generation budget and select Run all three methods. Export this result saves the problem, assignments, generation trace and source revision as JSON.
Use python3 or py -3 if that is your Python command. --port 8877 changes the
port. Ctrl+C stops the server. It binds only to loopback and stores no user data.
The objective is admitted request value minus the capacity cost of its placement. I use integer units and reject assignments that violate capacity or fixed delay limits. The same problem and evaluator are used by all three methods.
- Greedy: consider requests in descending value order and choose the cheapest feasible remaining location. It is deterministic and can make a locally useful choice that blocks a better combination later.
- Genetic search: random assignments, feasibility repair, tournament selection, crossover, mutation and elitism. The population starts randomly; I do not seed it with the greedy or exhaustive result. Repair processes requests in fixed order, which creates an explicit order bias.
- Exhaustive reference: evaluate all 16,384 assignments for each published fixture. There is no cutoff, so it establishes the optimum for this small model. Enumeration grows exponentially and is not a large-network solution.
Synthetic fixture → shared constraints and objective → three solvers
↓
Browser ← assignments / search trace / objective gap ← result
The Python code is the only solver implementation. The browser renders results; it does not implement a second algorithm that could drift. Static hosting reads committed output from the same code. Architecture and alternatives.
python -m unittest -v
python scripts/measure.pyThe measurement command requires a clean Git checkout. It records the tested commit, environment, full inputs, seeds, warm-ups, repetitions, individual observations and variability. Correctness tests include a hand-solved optimum, a greedy counterexample, boundary equality, seed repeatability, search monotonicity, input validation and HTTP boundaries. Verification and browser checks.
Recorded results and interpretation explain what was timed, what each method counted, and where the comparison stops. Candidate evaluation counts have different units across methods; I do not treat them as equivalent work. These are local solver observations, not production performance.
My 2022 master's thesis at Christopher Newport University examined genetic optimization and VNF placement in multi-layer fog networks using Python, NumPy, NetworkX and a Gurobi MILP comparison.
This is a new, independent implementation from October 2026. It makes a small placement problem inspectable without commercial software. It does not reproduce the thesis's code, full model or reported results. The exhaustive reference is not a substitute presented as the historical Gurobi comparison. Read my thesis note and original reference.
Completed: three solvers, four controlled fixtures, live local experiments, recorded browser exploration, raw measurements, tests and result export.
Not modeled: service chains, shared VNF instances, route selection, network-link capacity, queueing, migration, workload arrivals or hardware. Delay is a fixed property of each location. A result here cannot establish universal genetic algorithm superiority or predict a production placement decision.
MIT licensed; original synthetic code and data. Optional browser tests use Playwright (Apache-2.0). I used AI assistance in development; the model contract, tests and recorded experiments make the work open to inspection.
