I want to copy edges with their vertices and properties from dataG.front(), and add it to testg , I tried what I found in "Accessing bundled properties" section http://www.boost.org/doc/libs/1_57_0/libs/graph/doc/bundles.html but it isn't working for me. PS: dataG is a vector of graphs.
typedef std::pair<edge_iter, edge_iter> edge_pair;
Graph testg;
if (!dataG.empty())
{
auto const& gr = dataG.front();
for (edge_pair ep = edges(gr); ep.first != ep.second; ++ep.first) //ep edge number
{
auto ep = edges(gr).first; // ep edge number
vertex_t from = source(*ep.first, gr);
vertex_t to = target(*ep.first, gr);
boost::add_vertex(gr[from], testg);
boost::add_vertex(gr[to], testg);
boost::add_edge(from, to, gr[*ep.first], testg);
}
}
edges properties works but there is a problem in source and target. (vertex_t and add_vertex part), How to add directly the vertices properties to the added one because there is a duplication here.
PS: for more information here is the full code http://pastebin.com/2iztGAa6