for example, I want to bfs for only k steps, or called k level. How can I do it? Now I know only a little about how to terminate it from Is it possible to change breadth first search termination condition in BGL?.
I use boost::record_distance solved the problem, but I think it's not the perfect answer.