Boost logo

Boost :

Subject: Re: [boost] [BGL] To customize the graph traversing
From: Dmitry Bufistov (dmitry_at_[hidden])
Date: 2009-07-15 09:40:10


Cosimo Calabrese wrote:
>
>>
>> You also may try to use filtered graph adaptor
>> http://www.boost.org/doc/libs/1_39_0/libs/graph/doc/filtered_graph.html
>>
>
>
> Thank you Dmitry,
>
> but I can't use the filtered graph, because it completely hides edges;
> instead I would to hide an edge if I "come" from a particulary adjacent
> edge, and to show an edge if I come from another adjacent edge. In this
> other graph (I hope it's comprehensible...):

You graph drawing is very nice :-)
>
>
> _C _F
> o| /|
> o /
> o /
> A---->B------> D o o o >G
> \ ^ \
> \ | \
> _\| | _\|
> E | H
> I
>
> if the exploration goes through AB, and then BD, I can't go in DG, but
> only in DF and DH; instead if I come from ID, so I can go in DG.
>
> It is an exploration problem. I think that a Dijkstra/BFS foundation is
> that the graph must be immutable during the exploration. Instead I would
> to hide the DG edge in some cases, and to show it in other cases.
>
>
> Best regards,
> Cosimo Calabrese.
>

Yep. I see now. Sorry.
What if you just "unfold" you graph to explicitly create all possible
paths? For example, in your example you should duplicate node D to D1
and D2 and remove edge (D2->G):

          _C _ F
          o| //|\
         o / /
        o / /
A---->B------> D1/o o o >G
       | /\
       \ D2 \
        \ ^ \ \
         \ | \ \
         _\| | _\||/
           E | H
                I

Regards,
Dmitry


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk