|
Boost Users : |
From: Chris Russell (cdr_at_[hidden])
Date: 2003-06-06 13:49:50
Sorry, I though you just wanted to entirely preclude graphs with parallel
edges. So given a graph that does have parallel edges you want to remove, it
sounds like you need an algorithm to search for and catalog them (a visitor
of some sort, not sure which because I don't know the semantics of your
graph). Perhaps such an algorithm exists already in the library. I can't
comment directly because I haven't had to solve this problem in my own work
(yet). My idea is to use a visitor to locate the edges that meet your
criteria, store them in some external STL container, and then when the
algorithm returns, you can enumerate the container and remove the edges
(don't be a silly fool like I was earlier this week and start removing edges
in the visitor code). HTH - Chris
"Arthur" <arthurc_at_[hidden]> wrote in message
news:bbqmq1+rtv4_at_eGroups.com...
> The section pointed out says to use a set instead of list if you
> don't want parallel edges. I guess I was hoping to have parallel
> edge removal using a list (insertion/deletion consideration appear to
> make the list a better choice for me).
>
> A
>
> --- In Boost-Users_at_[hidden], "Arthur" <arthurc_at_t...> wrote:
> > Saw that... didn't help. Too many program fragments and not enough
> > complete code examples IMHO. I guess I'll just have to figure it
> out
> > the hard way.
> >
> > A
> >
> > --- In Boost-Users_at_[hidden], "Chris Russell" <cdr_at_e...>
> wrote:
> > > Arthur,
> > >
> > > see the following:
> > >
> > > http://www.boost.org/libs/graph/doc/using_adjacency_list.html
> > > ^- see specifically "Choosing the EdgeList type".. Sequence vs.
> > > AssociativeContainer vs. UniqueAssociativeContainer
> > >
> > > http://cvs.sourceforge.net/cgi-
> > bin/viewcvs.cgi/boost/boost/libs/graph/example/container_gen.cpp?
> > rev=1.1&content-type=text/vnd.viewcvs-markup
> > > ^- container_gen.cpp example
> > >
> > > HTH - Chris
> > >
> > >
> > >
> > > "Arthur" <arthurc_at_t...> wrote in message
> > > news:bbnl0i+k498_at_e...
> > > > I'm trying to use this graph class without detailed reading. I
> > can't
> > > > find a decent, clear example of doing this. I have a simple
> > graph:
> > > >
> > > > typedef adjacency_list<list, listS, bidirectionalS> Graph;
> > > >
> > > > What do I do to prevent parallel edges to be inserted?
> > > >
> > > > Thanks for any help offered,
> > > > Arthur
>
>
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
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