Advanced Graph Libraries: Setting Edge Weight Values

I am studying the use of accelerator libraries to apply them to various network problems that I have in mind.

In the examples that I looked at the values โ€‹โ€‹of the graph boundaries ("weights"), they are always initialized as integers, for example, in these Bellman-Ford and Kruskal , for example:

int weights[] = { 1, 1, 2, 7, 3, 1, 1, 1 };

My problem is that if I try to change the scales twice, I get a bunch of warning messages about conversions, etc., which so far I have not been able to figure out how to overcome them.

Does anyone see a way around this?

+5
source share
1 answer

weights[] , / boost.

, ,

struct EdgeProperties {
  int weight;
};
[...]
property_map<Graph, int EdgeProperties::*>::type 

struct EdgeProperties {
  double weight;
};
[...]
property_map<Graph, double EdgeProperties::*>::type 

typedef adjacency_list < vecS, vecS, undirectedS,
    no_property, property < edge_weight_t, int > > Graph;

typedef adjacency_list < vecS, vecS, undirectedS,
    no_property, property < edge_weight_t, double > > Graph;
+6

All Articles