|
|
|
|
|
by sltkr
4437 days ago
|
|
Yeah, I'm pretty sure the site you linked is wrong too, and I think the author doesn't realize it, because he says: > My last post was about using Kruskal’s algorithm to generate random mazes. This article is about using another minimal spanning tree algorithm to do the same: Prim’s algorithm. But his implementation is NOT the same! (His implementation of Kruskal's algorithm does look correct.) Extracting elements at a random index is not equivalent to assigning random weights to elements and extracting the minimum-weight elements. |
|
[1] http://en.wikipedia.org/wiki/Maze_generation_algorithm#Rando...