
On Mon, 19 Mar 2012, Luke Meyers wrote:
Having finally gotten this working, I wanted to share it. As the topic states, this is an implementation of an infinite, implicit graph, and an example that searches the graph with astar_search_no_init. I didn't find any examples out there of anyone doing this particular thing, so I hope it may be helpful to my fellow travelers.
I like it; would you please put it under the Boost license (and maybe write some documentation/explanation for it) so I can put it into the BGL example directory?
This code is a bastardization of some stuff from a game I'm working on (blatant plug: http://snarglequest.blogspot.com/) and the "city search" example code from the BGL docs. I'm sure it could be more concise, but I hope you'll find it accessible.
Oh, and critiques would of course be welcome. I said it's working, not perfect; I'm sure there are many things I could be doing in better ways, and I'd love to know about them.
I am curious why you are not using associative_property_map for the map lookup case where you don't need to customize the default element. I can fix associative_property_map to take a customized default as well, which would probably help you in that case as well. Remember that property maps need to make shallow copies (which usually entails using a shared_ptr to hold the container) so building them yourself is not as straightforward as what you are doing now. -- Jeremiah Willcock