|
Boost Users : |
Subject: Re: [Boost-users] BGL -- adjacency_matrix, graph concepts
From: Raymond Wan (r.wan_at_[hidden])
Date: 2009-10-08 02:06:04
Hi Andrew,
Andrew Sutton wrote:
> After looking, that constructor may not exist in Boost 1.39. It exists in
> trunk, but it seems to be causing problems (can't find add_edge).
>
> Your best bet is to construct the matrix over n vertices and then manually
> populate the graph with edges.
I'm not 100% sure, but it seems like I can't add_edge () with edge
weights for adjacency_matrix -- perhaps that function doesn't exist
also? In my toy example, this works:
typedef adjacency_list < vecS, vecS, undirectedS, no_property, property
< edge_weight_t, int > > Graph;
...
add_edge (edges[i].first, edges[i].second, weights[i], g1);
But when I change the typedef to:
typedef adjacency_matrix < undirectedS, no_property, property <
edge_weight_t, int > > Graph;
I get a compiler error at the add_edge line (without the weight is ok):
sample.cpp:35: error: no matching function for call to add_edge(int&,
int&, int&, main()::Graph&)
Or maybe there is something special I have to do for adjacency_matrix?
If this form of add_edge () doesn't exist, then my next option is to add
edges first and then update the properties in a separate step?
Thanks!
Ray
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