Boost logo

Boost Users :

Subject: Re: [Boost-users] <BGL>Filter vertices/edges by vertex/edge attributes?
From: Ireneusz Szcześniak (irek.szczesniak_at_[hidden])
Date: 2015-12-11 02:17:11


You can use filtered_graph to filter both edges and vertexes:

filtered_graph<Graph, EdgePredicate, VertexPredicate>

You just have to pass to function objects, as in here:

https://svn.boost.org/trac/boost/attachment/ticket/11838

https://svn.boost.org/trac/boost/attachment/ticket/11838/yen_ksp.hpp

If your function objects need more information, you can pass it to the
constructors of the function objects.

Best,
Irek

On 11.12.2015 08:09, Amit Prakash Ambasta wrote:
> Hi,
>
> In a boost graph, how can I filter vertices or edges by some attribute
> of Vertex/Edge Property?
>
> I tried taking a look at FilteredGraph, but the operator function
> would also need to be able to call
>
> boost::get(boost::vertex_bundle, graph_instance)[vertex] while only
> vertex is passed to the operator.
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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