Quote: Original post by EmergentQuote: Original post by SymLinked
It's the graph, a bunch of nodes each with its own list of neighbours.
Then just let the graph be implied by an occupancy grid. Don't explicitly store neighbors anywhere. The neighbors are just whatever cells in the occupancy grid that you can get to in one move that are not occupied. You could even wrap this stuff in accessor functions so that it "looks" like a graph; e.g., consider a "getNeighbors" function that, given an index into the occupancy grid, returns the indexes of all adjacent cells that are not occupied. You can wrap this up in whatever OO-prettiness you want in the language of your choice; e.g., you could have an abstract "GraphNode" class of which "OccupancyGridGraphNode" is an implementation. Under the hood, "OccupancyGridGraphNode" could be implemented as indexes into an occupancy grid, but A* doesn't have to know.Quote: but it isn't said anywhere how their allocation works in regards to "removed" nodes.
Wait... instead of maintaining a CLOSED list, you want to somehow remove those nodes from memory? I get it. But you still need some representation of your map somewhere in memory at all times, so rather than copying that and then deleting that copy as you go, why not just work with the original representation?
I'm thinking we're on a different technical level here or we're simply talking about different stuff. :) I'm talking about the grid which occupies the whole area meant to be pathfinded trough. Each node has a neighbour list and a integer which determines the type (walkable, wall - etc). That's the list that's too large.
I think I've found that I'm going to settle on a hash_map that I can access via the coordinates of the grid. That's going to cut down memory consumption a ton, I'm just not sure how well it will perform just yet. Hence my question about Boost :)