I'm having trouble figuring out how to parse a text file into a graph in python. The file is in the following format:
4 4
o . o . o . o
- - . -
o . o . o | o
. - . .
o | o . o . o
. - . -
o . o . o . o
The integers at the top are the dimensions (row, column). I need to take into account the space between each character. This is suppose to represent a maze that I'll have to run a search on to determine the optimal path given a start and endpoint. That part I have figured out. I simply need help parsing this text file into a graph so I can run the search.
name 'graph' is not defined). Is it some custom type you have created? Or don't you have any specific ideas and you want us to suggest a suitable representation?