Resuming a-star BGL Search

I use the astar algorithm on a graph that is partially (?) Implicit - it is built from a large paging data source, but the graph is constant. I need to process the paging in new parts of the graph whenever the astara algorithm falls into an area that is not completely unloaded — ideally, without a full astar search.

I tried a couple of solutions, but got into some road blocks, and I wonder if I am missing something obvious or just approaching the problem incorrectly.

I am currently using boost 1.45, but plan to upgrade to 1.51.

Firstly, I tried to change the visitor-astara in such a way that when he determines that he needs a page in the new data, he calls the function on the graph and loads it, however, since the graph is const, this is not possible. I looked around and found this other question to increase the implicit graph and astar_search_no_init , which refers to a presentation that says that someone did the work to make this possible, but it seems like the actual code is not available.

Secondly, I thought I could exit the algorithm when I get to the place where I need a page with a lot of data and save the state of distance_map, predecessor_map and color_map so that I can use them to “resume” the search with astar_search_no_init . I'm not sure if this will work, because as soon as I switch to using astar_search_no_init, I see that although the visitor seems to be doing the job of finding the path, the predecessor map is empty - since I use the predecessor to build the path after the visitor, I must know how the visitor then creates the path.

Here is a definition of my graph and how I call astar_search, if that helps at all.

typedef adjacency_list<
     vecS,         
     vecS,        
     undirectedS, 
     VertexInfo,        //contains geographic location     
     EdgeInfo,          //contains weight information             
     no_property,     
     setS>            
        BoostGraph;
...
ColorMap cmap = get(vertex_color_t, myGraph);           
astar_search(
     myGraph, 
     source,
     distance_heuristic(myGraph, destination), //geometric distance heuristic
     predecessor_map(&srcPredmap[0]).
     distance_map(&distMap[0]).
     color_map(cmap).
     visitor(astar_goal_visitor<vertex_descriptor>(destination, this)). //throws an exception when it finds the goal
     weight_map(make_function_property_map<edge_descriptor>(  //copied make_function_property_map functionality from boost 1.51 since I can't upgrade just yet
        EdgeWeightAdjuster(&myGraph, weightFactors))));       //modifies edge weights based on weightFactors construct
+5
source share
1 answer

: ", const, ..." CAST ( C-cast)? , , . .. . .

" " " ". , .

+1

All Articles