|
Boost Users : |
Subject: Re: [Boost-users] [BGL] Error using breadth_first_search with labeled_graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2013-04-10 11:28:43
On Tue, 9 Apr 2013, Julio Cezar Novais Raffaine wrote:
> Hi,
> I'm having the above (end of email) error message when compiling my source using breadth_first_search in a
> labeled_graph, here are some of my definitions:
>
> I'm using boost 1.51.0.
>
> struct VertexProperty
> {
> string x;
> };
>
> typedef boost::property<boost::edge_weight_t, double> IndexProperty;
> typedef boost::labeled_graph<
> boost::adjacency_list<boost::vecS, boost::setS, boost::bidirectionalS, VertexProperty, IndexProperty>,
> std::string> GraphT;
I think the issue is that your vertex container is setS. Many Boost.Graph
algorithms, including BFS, require a vertex_index property in your graph
by default, and the error message is saying that your graph does not have
one. If you hare not modifying your graph frequently, you might want to
change the setS to vecS in the definition of GraphT and see if that
changes anything.
-- Jeremiah Willcock
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net