|
Boost Users : |
Subject: Re: [Boost-users] Missing something about Boost.Graph
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2015-10-28 09:59:28
On Wed, Oct 28, 2015 at 1:43 PM, Jeremiah Willcock <jewillco_at_[hidden]>
wrote:
> > From: Dominique Devienne <ddevienne_at_[hidden]>
> > Graph G(edges.begin(), edges.end(), edges.size());
>
> The third parameter to the constructor is the number of vertices, not the
> number of edges. If you want to give the edge count explicitly, that is
> placed as the fourth parameter, after the edge count.
Thanks a bunch Jeremiah. Silly mistake on my end...
In the mean time (I'm on GMT+1), thanks to [1], I've completely changed the
way I build the graph, working around the above mistake, and was able to
make progress.
I now get the much more sensical "Graph has 112 vertices and 1257 edges".
But my graph is not a DAG. So thanks to [2] I found my back edges (4 of
them).
So next I tried to get a good report on the cycle using [3] and
strong_components(), which yields these two questions:
- Why do I get 106 strong components? Only 1 of them contains more than 1
vertex. All others have a single vertex.
- In the 1 component with more than 1 vertex, which looks like my cycle, is
there a way to know the edges of the cycle?
Thanks, --DD
[1] http://stackoverflow.com/questions/3100146
[2]
http://www.boost.org/doc/libs/master/libs/graph/doc/file_dependency_example.html
[3]
http://www.boost.org/doc/libs/1_59_0/libs/graph/example/strong_components.cpp
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