Hi everyone,
I have a question concerning the Boost Graph library, specifically with
strongly connected components.
My problem is this:
I have a graph that I need to collapse into strongly connected
components, then topologically sort the resulting DAG of components.
Then I want to traverse the sorted DAG (in order), and for each
component (now just a vertex I guess), look up into the original graph
to find all the vertices that belong to this component.
The application here is a rigid body simulator, and I'm constructing a
graph of contact points between bodies. The idea is to find an ordering
to apply collision impulses, which logically means from the ground up.
Vertices are thus bodies, and edges denote a contact (collision) case.
I've constructed the original graph, and using the example online,
performed the strong_components algorithm on it. However, I'm unsure of
how to correctly create a graph of the components. I presume using the
root_map is somehow involved, but I'm kind of at a loss. Here's what I got:
// typedefs, most stolen from graph introduction at boost.org
typedef std::pair