Project 6: SolveMaze

Maze solution using digraph model and depth-first search

Version 10/11/17

Educational Objectives: After completing this assignment, the student should be able to accomplish the following:

Operational Objectives: Implement a maze solver as a client of fsu::DFSurvey.

Deliverables:

bfsurvey.h    # contains implementation of Search(x,y)
dfsurvey.h    # contains implementation of Search(x,y)
solvemaze.cpp # client program of fsu::ALDGraph and fsu::DFSurvey; solves maze 
makefile      # creates targets ranmaze.x, solvemaze.x
log.txt       # development and testing log

Procedural Requirements

  1. The official development/testing/assessment environment is specified in the Course Organizer. Code should compile without warnings or errors.

  2. In order not to confuse the submit system, create and work within a separate subdirectory cop4531/proj6.

  3. Maintain your work log in the text file log.txt as documentation of effort, testing results, and development history. This file may also be used to report on any relevant issues encountered during project development.

  4. General requirement on genericity. Use generics whenever possible. For example:

    1. If you need to sort, use a generic sort algorithm or a container with built-in sorting.
    2. If a sort requires a specialized notion of order, create a function object that captures the desired order property.
    3. If you need a graph algorithm, use a component of the fsu graph library.
    4. In general, whenever a generic algorithm exists that can be deployed, do not circumvent that with specialized one-off code.
    5. Carefully choose all containers as the most appropriate for a particular purpose.

    In short: re-use components from LIB (or your own versions) whenever possible. Don't re-invent the wheels.

  5. Begin by copying all of the files from LIB/proj6 into your proj6 directory along with relevant executables from area51. You should see at least the following:

    bfsurvey_stub.h        # has non-functional implementation of Search(x,y)
    dfsurvey_stub.h        # has non-functional implementation of Search(x,y)
    deliverables.sh        # submission configuration file
    ranmaze_i.x            # sample executable
    solvemaze_i.x          # sample executable
    mazemaster_i.x         # maze analyzer
    

    Execute ranmaze_i.x to generate maze files and solvemaze_i.x and observe behavior. It may be helpful to use the visualization tools discussed below (and in the Ranmaze project).

  6. Implement the methods BFSurvey::Search(Vertex x, Vertex y) and DFSurvey::Search(Vertex x, Vertex y). These should perform the same functionality as the 1-argument versions, except that the process is halted immediately after a path from x to y has been computed.

    Note that these are called by Path_BFS and Path_DFS, respectively.

  7. Create the file solvemaze.cpp, a client of DFSurvey<>. Be sure that the implementation is built around a call to Path_DFS. Test thoroughly to be sure the solutions it generates are correct and that the behavior mimics that of LIB/area51/solvemaze_i.x, including the file name extensions for output files.

  8. Check that ranmaze.cpp [both yours and the area51 version] and solvemaze.cpp inter-operate correctly and meet the specifications given below.

  9. Be sure that you have established the submit script LIB/scripts/submit.sh as a command in your ~/.bin directory.

    Warning: Submit scripts do not work on the program and linprog servers. Use shell.cs.fsu.edu or quake.cs.fsu.edu to submit projects. If you do not receive the second confirmation with the contents of your project, there has been a malfunction.

Code Requirements and Specifications - solvemaze

  1. Client program uses Path_DFS, CheckSymmetry, and LoadMaze from the fsu graph library. Command line argument: maze file (required).

  2. Program reads maze file into a directed graph model, checks the digraph for symmetry (consistency for the maze), solves the maze, and appends solution to a copy of input maze file with ".dfs" extension.

Hints - solvemaze

Hints - visualization