Here's a bit of a puzzle I've been working on the past day or so. I imagine it's not as difficult as I'm making it to be, so I thought someone here might be able to help me out. It's basically a "pathing" routine.
In this particular application (in my case, it's a board game), I have 500 different "sectors" or units where a player could be located. Unfortunately, the board is not really set up in a system with coordinates and it has no definite shape. The playing field is set up randomly each game and the only rule in how the game is set up is that one sector must border between 1 and 5 other sectors.
My goal is to create a routine which will generate the shortest path between "sectors" (which sectors the user must traverse).
So far, I have come up with the following, but it is so slow and unwieldy that it craps out if the sectors are more than 12 or so spaces from one another.