我希望所有边都具有属性,权重和容量。我发现BGL已经定义了这些。所以我定义图形BGL添加具有多个属性的边缘
typedef property<vertex_name_t, string> VertexProperty;
typedef property<edge_weight_t, int, property<edge_capacity_t, int> > EdgeProperty;
typedef adjacency_list<listS,vecS, undirectedS, VertexProperty, EdgeProperty > Graph;
这里边和顶点属性是哪里我试图边缘添加到图表:
172: EdgeProperty prop = (weight, capacity);
173: add_edge(vertex1,vertex2, prop, g);
如果我刚1个属性我知道这将是道具= 5;然而,有两个我对格式化感到困惑。
这里是我收到的错误:
graph.cc: In function ‘void con_graph()’:
graph.cc:172: warning: left-hand operand of comma has no effect
你能举一个例子为最新升压图形库的捆绑性? –