Try it by running app.py
. Requires pygame.
Thanks to Brad Miller and David Ranum for their lovely book Problem Solving with Algorithms and Data Structures using Python. The priority queue code here is by them, and the rest of the algorithm and data structure code is at least heavily influenced.