Eighth Honors Data Structures Homework
Disjoint Sets and Mazes

DUE: Wednesday, April 11, 2001
Hard-copy due at 2:40pm in 227 Mudd
Electronic copy submission due 2:30pm

List all other 3139 students that you consulted with for this assignment on the hard-copy.
30 pts. in total + extra credit

This assignment expands on problem 8.15 of Weiss. You are to write a program that generates mazes of arbitrary size inside a JPanel. In addition, the program should be able to find an optimal path through the maze. Some other features and functionalities are required.

As usual, you should include a README file that explains the program.

Part 1) Generating random mazes (22 pts.)

Write a program that allows the user to generate random mazes using a GUI. The method for doing this is described in section 8.7 of Weiss. Here are some features that you should implement (THERE ARE SOME ADDITIONAL REQUIREMENTS ABOUT THE WAY THE Disjoint-Sets DATA STRUCTURE SHOULD BE IMPLEMENTED. THESE ARE SHOWN IN RED):

Part 2) Solving the maze (8 pts.)

Solve the maze by finding the optimal path (no dead-ends) from the start-cell to the end-cell. When this path has been found, it should be drawn on the panel. The user should be able to click on a "Solve" button to start the solution phase of the program.

One way of doing this is by viewing the maze as a graph; moreover, cells are vertices which are connected to neighboring cells by an edge, whenever the wall between the cells has been knocked down. You can either create an explicit graph representation for the maze, or you can keep only the structures that you had for part 1, so that the edges are just "missing" interior walls. You can use the method described in class, or any other method that you come up with.

Part 3) Extra Credit Additions

List any extra credit that you do in the README file and explain how your extra credit works.