Boost logo

Boost Users :

From: Björn Lindberg (yg-boost-users_at_[hidden])
Date: 2002-09-27 06:36:57


Chris Russell wrote:
>
> Hi Björn,
> Several ideas that may or may not be appropriate to the specifics of your
> situation:
>
> First an observation: your internal property ROOT,LEAF,INNER is actually
> redundant information. Given a vertex descriptor, this information can be
> deduced by examining the number of in and out edges. If ((some in edges) AND
> (some out edges)) then INNER, if ((some in edges) AND (no out edges)) then
> LEAF, if ((no in edges)) then ROOT.

Yes, you're right. The node type property was an early design decision,
and I didn't think of this at the time. Your approach is much better I
think. Right now, I have to keep track of labeling the vertices
correctly when I construct the graph. I don't think it is cheaper in
terms of time either, since checking for in and out edges for all
practical purposes (it is a binary tree) takes constant time.

I think I'll write a predicate function for the vertex type based on
edge counting, and then use that function in a functor for use in the
filtered_graph adaptor Jeremy mentioned.

Björn


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