1. The data structures are not going to matter a great deal -- how are you going to get the maze into the program? (Do you have to parse a file, read a list of vertices, ???) How are you going to solve the maze? Those are the only questions that matter, and you appear to have not started on them.

2. Originally Posted by tabstop
The data structures are not going to matter a great deal -- how are you going to get the maze into the program? (Do you have to parse a file, read a list of vertices, ???) How are you going to solve the maze? Those are the only questions that matter, and you appear to have not started on them.
Oh yeah good point. I think i will be able to read the maze from a text file as it is. Afterwards it has to be converted to adjacency matrix notation. How to do that?

3. Originally Posted by iamnew
Oh yeah good point. I think i will be able to read the maze from a text file as it is. Afterwards it has to be converted to adjacency matrix notation. How to do that?
You do that as you read it in. How you do it depends on how the maze is represented in the file.

4. say this is the maze in the text file
Code:
```Soxxxxooooooxxxx
oooooooooooxoxxo
xooooooxxxxoooox
xoxxxoxoooooooox
xxxoooxoooxxxxox
ooooxxxxoooxooox
oxoooxoooooxooox
oxoooxooooxooooo
oxoooxxxxoxoxooo
oxoooxooooxxxxxo
xxxxoxxxxoxooxoo
oooooxoooooooxoo
oxooooooxxxxxxoo
oxxxxooooxxooooo
ooxoooooxoxoxxxx
oooooxxxooxooooF```
S - Start F- Finish

Now once i read it and put it into a 2D array i get is the same thing

This will not be a adjacency matrix

How can i resolve this issue.

5. To build an adjacency matrix you have to
1. figure out how many squares there are in the maze
2. make a 2D matrix that is that many on each side
3. Using the text, decide which squares are connected
4. Put a 1 in the appropriate places in the adjacency matrix
5. Make a note of starting node and finishing node
6. Use whatever algorithm you feel appropriate to solve the maze
7. Print the solution, making conversions from internal representation to user representation

6. How do i represent walls?

7. Originally Posted by iamnew
How do i represent walls?
You don't. An adjacency matrix only stores the places you can move to. (EDIT: To be more clear, a 0 in the adjacency matrix means you can't get from point A to point B, for whatever reason, whether it's a wall, or because the two squares aren't next to each other.)

8. okay then the no of movable nodes = total no of nodes - no of walls

am i correct?