Boost logo

Boost :

Subject: [boost] copy a graph (adjacency_list) to another one
From: ShNaYkHs ShNaYkHs (shnaykhs_at_[hidden])
Date: 2012-02-13 10:07:46


How can I copy a graph of type adjacency_list to another one graph of type
adjacency_list ? Look at the flowing code example:

typedef adjacency_list<setS, setS, undirectedS, NodeDataStruct,
EdgeDataStruct> MyGraph;
MyGraph g1, g2;

// processing g1: adding vertices and edges ...
// processing g2: adding some vertices and edges ...

g1.clear();
g1 = g2 // this gives an execution error (exception)
g1 = MyGraph(g2); // this also gives an execution error
g2.clear();

Note that to use of copy_graph(...) it is said that the graph type must be
a model of VertexListGraph. In my case it is an adjacency_list ...

Thanks,


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk