Jak mogę skopiować wykres typu adjacency_list na inny wykres typu adjacency_list?skopiuj wykres (adjacency_list) do innego
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();
Dla copy_graph mówi się, że typ wykresu musi być modelem VertexListGraph. W moim przypadku powiedziałem, że jest to lista adjacency_list. – shn
@ user995434 Ale adjacency_list jest modelem VertexAndEdgeListGraph, który jest udoskonaleniem VertexListGraph. Stąd lista adjacency_list jest modelem VertexListGraph. –
Czy możesz podać mały przykład ilustrujący użycie copy_graph() dla tego, co chciałbym zrobić? Zawsze daje mi błędy kompilacji. Z góry dziękuję. – shn