id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 10086,Backwards compatibility to 1.42 adjacency list serialisation is broken,oluedecke@…,Jeremiah Willcock,"I have an archive created with boost serialization of an adjacency list which was created with boost 1.42. When switching to Boost 1.55, the adjacency list cannot be deserialised from the archive anymore. I identified commit [77549] which probably broke the serialisation: It appears that the vertex and edges are not wrapped in a 'property' anymore, but stored directly in the adjacency list. Additionaly, in [77615] a new member ""graph_property"" was added to the serialisation code. Unfortunately, the serialisation version number of adjacency list was not incremented and the code in 'boost/graph/adj_list_serialize.hpp' was not changed accordingly. Furthermore in 'boost/pending/property_serialize.hpp', the serialisation order of 'value' and 'base' was switched, again without changing the class serialisation version number. I was able to load the old archive by making following changes: ** adj_list_serialize.hpp ** {{{ template inline void load( Archive & ar, boost::adjacency_list &graph, const unsigned int /* file_version */ ){ typedef adjacency_list Graph; typedef typename graph_traits::vertex_descriptor Vertex; typedef typename graph_traits::edge_descriptor Edge; unsigned int V; ar >> BOOST_SERIALIZATION_NVP(V); unsigned int E; ar >> BOOST_SERIALIZATION_NVP(E); std::vector verts(V); int i = 0; while(V-- > 0){ // >>>>> BOOST_ADJ_LIST_1_42_SERIALIZATION_PATCH if( ar.get_library_version() <= 7 /* not sure about the 7, could be a greater version */){ Vertex v = add_vertex(graph); boost::property vertexAsProperty; ar >> vertexAsProperty; graph[v] = vertexAsProperty.m_value; verts[i++] = v; } else // <<<<< BOOST_ADJ_LIST_1_42_SERIALIZATION_PATCH { Vertex v = add_vertex(graph); verts[i++] = v; ar >> serialization::make_nvp(""vertex_property"", get(vertex_all_t(), graph, v) ); } } while(E-- > 0){ // >>>>> BOOST_ADJ_LIST_1_42_SERIALIZATION_PATCH if( ar.get_library_version() <= 7 /* not sure about the 7, could be a greater version */){ int u; int v; ar >> BOOST_SERIALIZATION_NVP(u); ar >> BOOST_SERIALIZATION_NVP(v); Edge e; bool inserted; boost::tie(e,inserted) = add_edge(verts[u], verts[v], graph); boost::property edgeAsProperty; ar >> edgeAsProperty; graph[e] = edgeAsProperty.m_value; } else // <<<<< BOOST_ADJ_LIST_1_42_SERIALIZATION_PATCH { int u; int v; ar >> BOOST_SERIALIZATION_NVP(u); ar >> BOOST_SERIALIZATION_NVP(v); Edge e; bool inserted; boost::tie(e,inserted) = add_edge(verts[u], verts[v], graph); ar >> serialization::make_nvp(""edge_property"", get(edge_all_t(), graph, e) ); } } // >>>>> BOOST_ADJ_LIST_1_42_SERIALIZATION_PATCH if(are_Adjacency_list_and_boost_property_in_old_format(ar) == false) ar >> serialization::make_nvp(""graph_property"", get_property(graph, graph_all_t()) ); // <<<<< BOOST_ADJ_LIST_1_42_SERIALIZATION_PATCH } }}} ** property_serialize.hpp ** {{{ template void serialize(Archive& ar, property& prop, const unsigned int /*version*/) { // >>>>> BOOST_ADJ_LIST_1_42_SERIALIZATION_PATCH if( ar.get_library_version() <= 7 /* not sure about the 7, could be a greater version */){ ar & serialization::make_nvp( ""property_base"" , prop.m_base); ar & serialization::make_nvp( ""property_value"" , prop.m_value ); } else // <<<<< BOOST_ADJ_LIST_1_42_SERIALIZATION_PATCH { ar & serialization::make_nvp( ""property_value"" , prop.m_value ); ar & serialization::make_nvp( ""property_base"" , prop.m_base ); } } }}}",Bugs,new,To Be Determined,graph,Boost 1.55.0,Regression,,,