CS347 SP2005 The Plank Puzzle: Phase III - Iterative-Deepening Depth-First Graph Search
Revision 2/8/2005. Note: it is the students' responsibility to check the CS347 website for possible new revisions!
Assignment
The following plank puzzle description is cited from
http://www.clickmazes.com/planks/ixplanks.htm:
"Your challenge is to find a route across a crocodile infested swamp using just a handful of rather short planks.
Fortunately the planks are light enough to move around, and the swamp is full of old tree-stumps which will support
the planks to form temporary bridges. So by careful planning, and re-use of planks, you might just find a route.
Needless to say you can only move planks you can physically reach, so try not to leave any too far behind.
The best way to understand the plank puzzle concept is to imagine yourself stuck in a real swamp, with tree-stumps
too far apart to jump-between, and planks too heavy to move more than one at a time. The remaining rules get a bit
fiddley, but here they all are:
- You can pick up and carry a plank provided you have access to one end.
- You can only pick-up and carry one plank at a time.
- Planks must be supported both ends, and must be an exact fit.
- You cannot jump between stumps or planks.
- You cannot move a plank if you are already carrying one.
- Planks cannot be used diagonally, only north-south or east-west.
- Planks cannot support other planks, and cannot be stacked.
- Planks cannot bridge intermediate stumps or planks.
The objective is to find a path from start (home icon in class framework) to finish (diamond icon in class framework) with lower cost paths being more desirable (the optimal path is the one with the lowest path cost)."
In this third phase all you have to do is modify the CIddfgsPlayer class (iddfgsplayer.cpp) in the provided Qt framework to attempt to solve the puzzle using Iterative-Deepening Depth-First Graph Search. Note that when the play function is first called it needs to generate a complete solution and return the first move; in subsequent calls it should return the corresponding subsequent moves without regenerating the solution! Also note that when the
reset function is called, it should reset the play function so that the next call to play will regenerate the complete solution.
See http://web.umr.edu/~cs347a/sp2005/planks for framework instructions.
Note: this is an individual project; plagiarism of any type will result in a zero grade.
You need to submit only iddfgsplayer.cpp and, if you have modified it, iddfgsplayer.h on or before Friday 2/11/2005. This is accomplished by following the instructions at http://web.umr.edu/~tauritzd/submission.html.
Grading
The maximum number of points you can get is 100, the minimal is 0.
The following are the maximum number of points per component:
- Iterative-Deepening Depth-First Graph Search implementation: 80
- Good programming practices (style, comments, modular design, etc.): 10
- Code reliability (no crashes, defensive programming, compiles correctly): 10
Multiple Submissions and Late Submissions
While it is hoped that all code will be submitted error-free and on time, this may not always be the case, so the
following rules apply if code is not submitted error-free or on time:
- You must make your final submission within 48 hours of the due date. Submissions which are more
than two days late will not be graded.
- If your code is submitted late, a 10 point per day penalty will apply (fractions of days are rounded up),
after two days you will automatically receive a zero.
- Resubmissions are allowed but late penalties will apply based on the last submission.