First, I'd like to qualify this by saying I have no topology experience. So bear with me.
I've been contemplating pathfinding algorithms for a game I'm working on. I thought about the idea of trying to abstract the map into some notion of a topological space. I was wondering if there exists a way to arbitrarily do something like the following.
Ignoring issues like holes in the topological space, is there a way to generally transform something like the top image into something like the bottom one? If so, then it looks like I can more or less draw a straight line to find my path and then map the lines coordinates back into the first space to get my path. Embedding something like this could be done at compile time and thus seems like it could be tremendously powerful for running quick pathfinding!
To be precise, my exact question would probably be: is there an algorithm to translate a computer friendly version of a map (could be some form of a graph, or polygons) into a unit square that preserves the topology in this way? Assume genus zero (that is far as my buzzword knowledge goes).