// TestBGL.cpp : Defines the entry point for the console application. // #include #include #include using namespace std; using namespace boost; int _main(int argc, char* argv[]) { typedef boost::property VertexProperty; typedef boost::property EdgeProperty; typedef adjacency_list Graph; typedef pair Edge; Edge edges[] = {Edge(0, 1), Edge(1, 2)}; int weights[] = {2, 1}; // this works: int weights[] = {1, 2}; Graph g(edges, edges + sizeof(edges)/sizeof(Edge), weights, 3); std::vector predecessors(num_vertices(g)); prim_minimum_spanning_tree(g, &predecessors[0]); }