Re: [Boost-users] [graph] problem with weight_map ? (brandes_betweenness_centrality)
Hi, ##
EdgeWeightProperty weight = getWeight(a, b); // 0f ... 2.0f
Can you just assign a double to a boost::property<...> object? That should probably not be allowed. ## I found the example here and made my code: http://programmingexamples.net/wiki/CPP/Boost/BGL/DijkstraUndirected ### What happens if you write an explicit loop over all of the edges and use put(edge_weight, g, e) directly? Does that change any of the results? -- Jeremiah Willcock ### In not sure what you mean? Im not a super expert, can you please explain your thought more? Best, Tasos
On Wed, 20 Mar 2013, The Maschine wrote:
Hi,
##
EdgeWeightProperty weight = getWeight(a, b); // 0f ... 2.0f
Can you just assign a double to a boost::property<...> object? That should probably not be allowed. ##
I found the example here and made my code:
http://programmingexamples.net/wiki/CPP/Boost/BGL/DijkstraUndirected
###
What happens if you write an explicit loop over all of the edges and use put(edge_weight, g, e) directly? Does that change any of the results?
-- Jeremiah Willcock
###
In not sure what you mean? Im not a super expert, can you please explain your thought more?
Instead of putting your weights in the add_edge calls, try using add_edge
without a weight then writing a loop such as:
BGL_FORALL_EDGES(e, g, graph_type) {
put(edge_weight, g, e, weight);
}
to initialize the weights. BGL_FORALL_EDGES is from
participants (2)
-
Jeremiah Willcock
-
The Maschine