$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: David Abrahams (dave_at_[hidden])
Date: 2008-06-24 02:30:14
Abde Ali Kagalwalla wrote:
> Hi Dave,
> 
> It is still not clear.
> What should my parameters be for the function add_edge() to construct
> the graph with bbox objects as edges?
I'm not sure how to answer you helpfully because there seem to be a few
misconceptions here. To start with, the edge properties are not the
edges themselves; they're just associated properties.  Secondly, the
graph you've declared  doesn't specify any bundled edge properties; it
specifies bbox as a bundled vertex property.
...but the straightforward answer to your question is that the first two
parameters to add_edge should be vertex descriptors, usually as obtained
from the add_vertex function.
> 
> Thanks,
> 
> Abde Ali
> 
> On Tue, Jun 24, 2008 at 5:45 AM, David Abrahams <dave_at_[hidden]
> <mailto:dave_at_[hidden]>> wrote:
> 
>     Abde Ali Kagalwalla wrote:
>     > I just started using the graph library.....
>     > I want to store a class I created called bbox as vertices of a graph.
>     > So, I just used the bundled properties mentioned as mentioned in the
>     > documentation.
>     >
>     > So here is a relevant portion of the code:
>     >
>     > vector<bbox> A;
>     >
>     > boost::adjacency_list<vecS, vecS, undirectedS, bbox> G;
>     >
>     > for (int i=0; i<A.size(); i++){
>     >    for(int j=i+1; j<A.size();j++{
>     >        add_edge(A[i], A[j], G);
>     > }}
>     >
>  
HTH,
-- Dave Abrahams BoostPro Computing http://www.boostpro.com