Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Serializing a filtered_graph
From: Cedric Laczny (cedric.laczny_at_[hidden])
Date: 2010-11-16 12:50:37


On Tuesday, 16. November 2010 17:50:12 Jeremiah Willcock wrote:
> On Tue, 16 Nov 2010, Cedric Laczny wrote:
> > Hi,
> >
> > I was wondering if there is a way to serialize filtered_graphs?
> >
> > My first attempts fail because keep_all seems not to be serializable:
> > /usr/include/boost/serialization/access.hpp:109: error: ‘struct
> > boost::keep_all’ has no member named ‘serialize’
> >
> > I have no problems serializing even custom adjacency_lists using the same
> > approach.
>
> Could you please try adding serialization code to the keep_all structure?
> It should be easy since IIRC it does not have any members.
>

I'm sorry, but I do not know how to do that actually. I mean, I do not know
how to add some functionality without changing the original code.
Is this actually possible?

> > Besides discussing if it actually makes sense to serialize a
> > filtered_graph, I am interested in suggestions on how to achieve it (if
> > it is indeed possible).
>
> What about the graph do you want to keep? In my view (and probably what
> actually happens), serializing a filtered_graph means serializing all of
> the input graph (even with vertices and edges that are hidden by the
> filter) and then serializing the filter function.

That would be my view too.

> That may not be what
> you want, though: you might actually want to serialize the graph after
> filtering, and thus read the data back into a normal, non-filtered graph.
> Right now, that second option would require copying the filtered_graph
> into a normal graph type then serializing that; deserialization would be
> directly into the normal graph type. It would be possible to avoid the
> copy, though, if that was important.

That second option sounds nice but it would mean to loose a lot of
information, as you probably know. Therefore, serializing the original, input
graph completely and serializing the filter function would be more like the
solution I need.

> -- Jeremiah Willcock

Thank you.

Best,

Cedric


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net