python mazesolver.py -i inputfile -o outputfile
Note: We must require **inputfile'** in CWD (current working directory) with proper input in it.
To find paths between two location of the matrix (maze), the algorithm can detect when there is no path between the source and destination.
Program description :
Data structures used is adjacency matrix to store the input which is present in 'inputfile'.
File Handling in used to read and write into files. Matrix is present in inputfile which is used converted to path matrix in outputfile.
Function 'maze_solver' applies modified BFS to this matrix and creates a list of visited elements wrt their indices. 'visited' list consists required path of maze. 'write_maze_matrix' function converts 'visited' list into a matrix which then stored in 'outputfile'. If path doesn't exist then 'outputfile' consists -1.
Command Line Arguments are used to read names of input and output files.