← ~/visualizations

greedy-algorithms

Visualizes greedy selection on an interval-scheduling timeline (using argmin(finish)) while showing the feasibility boundary after each choice. A dependency diagram highlights that the greedy-choice property relies on optimal substructure, and that each greedy step must preserve feasibility so the remaining subproblem stays valid.

canvasclick to interact
t=0s

practical uses

  • 01.Interval scheduling / resource allocation with non-overlap constraints
  • 02.Minimum spanning tree (Kruskal/Prim) greedy edge selection
  • 03.Shortest paths with nonnegative weights (Dijkstra) via greedy frontier expansion

technical notes

Time-based cycle animates discrete greedy steps and a feasibility boundary; a second cycle highlights conceptual dependencies with pulsing arrows. All drawing is grid-snapped for a blocky aesthetic and uses only Canvas 2D primitives with GREEN/GREEN_DIM on black.