Boost logo

Boost Users :

Subject: Re: [Boost-users] transform from std::vector<std::vector<int> > type to boost::adjacency_list< >
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-10-01 13:56:25


On Fri, 30 Sep 2011, Dave Abrahams wrote:

>
> on Fri Sep 30 2011, Jeremiah Willcock <jewillco-AT-osl.iu.edu> wrote:
>
>> On Fri, 30 Sep 2011, Pablo Fleurquin wrote:
>>
>>> Ok, but can you give me a hint, how to write a wrap for this?The
>>> function I use is boost::strong_connected_component
>>
>> Look at the documentation page for that algorithm; there is a list of
>> concepts it requires its graph type to model, with links to individual
>> documentation pages for those. Those pages will list which functions
>> you need to implement and how they are supposed to behave. You will
>> also need a graph_traits specialization; the documentation pages will
>> also say what that should look like.
>
> Jeremiah, I could have _sworn_ there was built-in support to make
> std::vector's usable directly as graphs. Am I mis-remembering? Was it
> removed?

It looks like vector_as_graph does exactly that, and so it should work for
this application.

-- 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