RouteLab documentation / v1

Understand the
whole trace.

Architecture, algorithm guarantees, keyboard controls, and safety boundaries for an inspectable pathfinding laboratory.

Open the lab
01

Mental model

RouteLab separates finding a route from showing how that route was found.

A graph contains nodes and directed edges. Each edge exposes one or more finite costs—weight, distance, or travel time. A run selects a start, goal, cost model, algorithm, and optional heuristic. The algorithm returns both a result and an ordered semantic trace.

01Scenariovalidated graph
02Algorithmpure execution
03Tracesemantic events
04ReplayUI state
Key distinction

Algorithm execution time is measured independently from animation duration. Playback speed never changes the algorithm result.

02

Trace architecture

Every event carries enough information to replay state, explain the current decision, and associate it with a conceptual source-code section. Timeline navigation folds events into an inspectable snapshot.

initializeCreates the start state, distance map, and frontier.
enqueue / dequeueRecords frontier changes and deterministic priorities.
inspectEdgeMarks the candidate edge currently under consideration.
relaxEdgeCompares a candidate route with the best known distance.
updateDistance / setParentPersists the improved cost and predecessor.
reconstructPathEmits the final connected route from start to goal.
finishReports path cost, outcome, and aggregate run metrics.
03

Algorithm guarantees

Compatibility is enforced before a run. BFS is limited to equal-cost graphs, Dijkstra-family searches reject negative weights, and Floyd–Warshall is capped to small graphs.

AlgorithmTimeRequirementGuarantee
Breadth-first searchO(V + E)Unweighted onlyShortest by edge count
DijkstraO((V + E) log V)Nonnegative costsOptimal
A*O((V + E) log V)*Admissible heuristicOptimal when admissible
Greedy best-firstO((V + E) log V)Heuristic availableNot guaranteed
Bidirectional DijkstraO((V + E) log V)Nonnegative costsOptimal
Bellman–FordO(VE)Negative edges allowedOptimal or negative cycle
Floyd–WarshallO(V³)Small graphsAll-pairs optimal
f(n) = g(n) + h(n)

For A*, g is cost already paid and h estimates what remains. A zero heuristic visibly reduces A* to Dijkstra.

04

Playback controls

The Lab keeps every primary action available by pointer and keyboard. Form fields use native controls and the graph has a structured nonvisual alternative.

SpacePlay or pause
Next event
Previous event
HomeRestart trace
EndJump to result
RRestart playback
?Open keyboard help
05

Scenario data model

Imports accept JSON data only. A scenario declares its schema version, bounded nodes and edges, explicit start and goal IDs, deterministic seed, compatibility metadata, and learning objectives. The fragment below illustrates core graph fields; use the Lab’s Export action for a complete importable document.

{
  "schemaVersion": 1,
  "id": "custom-seed-42",
  "name": "My bounded graph",
  "graph": {
    "nodes": [{ "id": "A", "x": 80, "y": 120, "label": "Start" }],
    "edges": [{ "id": "A-B", "fromId": "A", "toId": "B", "weight": 4 }]
  },
  "startId": "A",
  "goalId": "B",
  "seed": 42
}
06

Security boundary

RouteLab treats labels, imported files, URL state, and graph metadata as hostile data. It never evaluates expressions, runs submitted code, dynamically imports user paths, or fetches user-provided URLs.

Validate

Strict schema

Finite numbers, unique IDs, valid references, version checks, and closed object shapes.

Bound

Hard limits

File bytes, labels, nodes, edges, share state, trace history, and all-pairs graph size.

Render

Plain text

No unsafe HTML, external SVG, user styles, event handlers, or arbitrary URL requests.

Isolate

Client-only import

Custom files remain on the device and are not uploaded or logged by RouteLab.

07

Accessibility

RouteLab targets WCAG 2.2 AA with visible focus, semantic landmarks, live playback announcements, reduced-motion behavior, 44-pixel touch targets, and redundant state encodings.

  • The visualization includes a current-state summary and node/edge tables.
  • Current, frontier, visited, and path states use labels and shape—not color alone.
  • Native scroll remains available; reduced motion removes automated transitions.
  • Code panes are read-only, focusable, scrollable, and never trap keyboard focus.