Boost logo

Boost Users :

Subject: Re: [Boost-users] transform from std::vector<std::vector<int> > type to boost::adjacency_list< >
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-09-30 11:29:22

on Fri Sep 30 2011, Pablo Fleurquin <> wrote:

> I have an adjacency list, representing a directed graph, written in
> standard c++ format using vector: vector<vector<int> > I want to
> tranform it to boost adjacency_list< > format and then back to vector
> <vector<int> >.
> Which is the simplest way to do it?

Are you *sure* that's what you want to do?

The usual thing to do in cases like this is to write the necessary
functions and traits so your type conforms to the graph concept needed
for your algorithms. (In fact I think vector<vector<int> > may already
conform, but I could be mistaken).

Dave Abrahams
BoostPro Computing

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at