Case study 02Back to work

Algorithm engineering · Multi-agent planning · Python

When plans
collide, recover.

A deterministic planning laboratory that makes runtime failure inspectable: inject a delay, identify the affected agents, preserve completed work and validate the recovered joint plan independently.
Automated tests
70
Seeded oracle cases
1,200
Planning strategies
3
Post-recovery conflicts
0
System question

What happens after a valid plan meets reality?

Multi-agent routes can be collision-free at planning time and unsafe one moment later. A delayed robot, vehicle or process can invalidate another agent's reserved position even when the original planner was correct.

The project treats disruption as part of the system. It simulates the failure, discovers the affected set, locks the executed prefix and replans only the remaining suffixes before a separate validator accepts the result.

Recovery path

Four boundaries from plan to proof.

  1. 01Plan

    Static A*, canonical SIPP and reservation-aware planning establish the initial joint paths.

  2. 02Simulate

    A discrete-time runtime executes paths and injects a declared one-step delay.

  3. 03Recover

    Affected-set discovery protects completed work and selectively replans future suffixes.

  4. 04Validate

    An independent checker tests legality, collisions, goal holding, prefixes and determinism.

Correctness contract

A planner cannot certify itself.

Results are not marked solved until an independent validator passes every declared invariant.

01

Legal paths

Every path starts at its declared start, reaches its goal and uses only valid moves.

02

Vertex safety

No two agents may occupy the same cell at the same timestep.

03

Edge safety

No two agents may swap the same edge in opposite directions simultaneously.

04

Goal occupancy

An arrived agent continues to reserve its goal through the planning horizon.

05

Prefix integrity

Recovery preserves the executed prefix exactly and changes only future work.

06

Determinism

Fixed inputs produce the same plan, event trace, metrics and solution digest.

Implementation

Search logic separated from presentation.

Planning corePython 3.12 · immutable reservations · safe intervals
StrategiesPrioritised SIPP · bounded priority sweep · bounded CBS
RuntimeDiscrete-time simulation · delay events · suffix replanning
ContractTyped FastAPI routes · versioned JSON · replayable event records
InterfaceReact · stage playback · timestep scrubbing · decision inspector
QualityPytest · Ruff · mypy · coverage · scenario validation
Measured comparison

Three strategies, explicit trade-offs.

The benchmark record is limited to committed small instances. It shows where additional bounded search changes the result without turning local measurements into general performance claims.

01 / Responsive track

Fixed priority

One deterministic order with the lowest search effort, but order-dependent and incomplete.

Priority trap: no plan
02 / Middle ground

Priority sweep

Tries a bounded set of deterministic orders and retains the best valid result.

Priority trap: cost 11
03 / Small-instance optimum

Bounded CBS

Resolves conflicts in a constraint tree and optimizes sum of costs when within its limit.

Priority trap: cost 11
Verification evidence

Correctness before spectacle.

01Low-level oracleCanonical SIPP matched an exact space-time BFS oracle across 1,000 deterministic random cases.

02Multi-agent casesOne hundred seeded prioritised-planning cases exercise reservations, conflicts and goal occupancy.

03CBS oracleOne hundred exact joint-state comparisons test the bounded Conflict-Based Search implementation.

04Regression setFive permanent scenarios protect crossing, order, storage-detour and recovery behavior.

05Scaling recordA controlled 9 × 9 family adds agents from two to six and reports deterministic expanded-state counts.

Known limits

Bounded evidence, stated plainly.

Fixed-priority planning is order-dependent and incomplete. Priority sweep grows factorially. Conflict-Based Search can grow exponentially and is deliberately restricted to small instances.

This is a discrete-time planning laboratory, not a production railway dispatch system, robotics controller or safety-certified operational product. The measurements support the committed scenarios only.

Inspect the complete system

Trigger the failure. Watch the recovery.

The live laboratory exposes the baseline, failure, affected set, recovered paths, strategy comparison and validation record.