I would like to apply the astar_search()
algorithm to an implicit graph that generates over time. The initialization of a new vertex in the graph is thereby quite involved and requires an external lookup in another data structure.
I have looked into quite a few examples that use astar_search()
, but could not find a lot with implicit graphs. From all the examples that use implicit graphs [1] looks the most promising. The problem with the proposed solution is, that astar_search()
takes a const graph reference (const VertexListGraph &g
) as a parameter in boost 1.66, thus prohibiting the modification and addition of new vertices and edges to the graph in the examine_vertex
visitor.
Another proposed solution I saw was [2]. Although I'm not quite sure that I fully understand every bit of the code, I think the astar_search_no_init()
function does not fit my problem either, since I already start with a partially computed graph and a simple default construction of a new vertex is problematic, due to the vertex creation with the external lookup described above.
I guess the easiest, yet not working, solution to my problem would be an examine_vertex
visitor that is able to modify the graph.
Do you guys have any idea what I could do instead or know a workaround solution?
[1] A* Graph Search Within the BGL Framework (p.12-19)
[2] Stack Overflow Question: boost implicit graph and astar_search_no_init