AI Model Reviewer

Mst kruskal prim

Build a minimum spanning tree race on a map of 40 towns: the towns are random points connected by a Delaunay-style or k-nearest-neighbour road network with w…

More

1 test · 2 finished runs (2 agent, 0 raw one-shot) · 2 live demos

The prompt

Build a minimum spanning tree race on a map of 40 towns: the towns are random points connected by a Delaunay-style or k-nearest-neighbour road network with weights equal to road length. Two panels side by side (stacked on narrow screens) run Kruskal's and Prim's algorithms at the same time on the same graph, one primitive step per tick. Kruskal's panel shows the edge list sorted by weight on the side with a cursor moving down it, each considered edge flashing, accepted edges turning bright, rejected edges (that would make a cycle) crossing out red, and the union-find forest drawn as coloured town groups that merge as edges are added. Prim's panel shows the growing tree from a starting town, the priority queue of frontier edges as a small sorted list, and the cheapest frontier edge being chosen each step. Count edges considered and total weight so far in each panel; when both finish, overlay them to show they found the same total weight, and highlight any edges where ties made them differ. Controls: town-count slider (10 to 120), layout presets (uniform, clustered, ring, grid with jitter), start town for Prim (click or tap a town), speed slider, play, pause, step, reset. So the page is alive without input, on load it races automatically and then starts a new random map after a 3 second pause, forever, until the user touches a control. Make it look like a beautiful glowing night map. Save it as index.html in the current directory: one self-contained file with inline CSS and JavaScript only, no libraries or frameworks, and no external requests of any kind (no CDNs, web fonts, images or audio files). It must work when opened directly from disk, fit any window from a 390 px wide phone to a desktop, and run without console errors. You may serve it locally and open it in headless chromium (/usr/bin/chromium, software WebGL, no GPU) to screenshot and inspect your own output, and iterate on your own before finishing. Close any browser you open as soon as you've taken your screenshot.

Same prompt, all models: step through 2 runsIn the gallery: one player, arrow keys or swipe.

2 of 2 runs shown