Skip to Main Content
Mazes for Programmers
book

Mazes for Programmers

by Jamis Buck
July 2015
Intermediate to advanced content levelIntermediate to advanced
286 pages
6h 31m
English
Pragmatic Bookshelf
Content preview from Mazes for Programmers

Kruskal’s Algorithm

Kruskal’s algorithm was developed by the mathematician and computer scientist Joseph Kruskal in 1956 to construct what are called minimum spanning trees. Don’t be put off by the crazy vocabulary—spanning tree is really just a fancy name for these perfect mazes we’ve been generating, and minimum simply refers to the costs and weights we discussed in the previous chapter.

Basically, Kruskal was trying to solve the following problem. Let’s say you start with a graph, or grid, where every possible passage that might connect neighboring cells is given a cost. It might look something like the following figure.

images/connected-grid.png

Merely constructing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Exercises for Programmers

Exercises for Programmers

Brian P. Hogan

Publisher Resources

ISBN: 9781680501315Errata Page