Assignment-6 (20 October 2015)
Understanding Backtracking strategy
Represent a maze M by a boolean m X n array. Starting from a start point, one can move to adjacent points in the same row or the same column. If M[i,j] is true then you can pass through (i,j); if M[i,j] is false, you cannot pass through the cell. Implement a backtracking algorithm that finds a path, if one exists, from (0,0) to (m-1,n-1).
- Read the input matrix of 0's and 1's from a file in which the array is given one row per line
- The first line contains m n separated by white space and the second line onwards the matrix follows
- Print the output of the path giving the positions (i,j) visited on the route from (0,0) to (m-1,n-1)
- Print all the possible paths that exist