Jeremiah,
Thanks for the response. I am very new to boost, so I am not quite getting the Property Map idea. It seems like you can just provide a whole list of template arguments that are of type property<> to the adjacency_list object. It the kolmogorov example (http://www.boost.org/doc/libs/1_39_0/libs/graph/doc/kolmogorov_max_flow.html) , it looks like the only property that is needed is edge_capacity, so I defined EdgeCapacityProperty (it was actually quite a complicated property, depending on edge_reverse as well as edge_residual_capacity). However, I am still getting "conversion from error_property_not_found to EdgeCapacityProperty requested" when I try to call the maxflow function. Is this getting closer?
I guess I am following the property<> stuff, but not the property_map<> idea? Here is the latest attempt:
#include <iostream> // for std::cout #include
#include using namespace boost;
typedef adjacency_list_traits
Traits; typedef property
EdgeReverseProperty; typedef property EdgeResidualCapacityProperty; typedef property EdgeCapacityProperty; typedef adjacency_list
Graph; //simple int main(int,char*[]) { // declare a graph object Graph g(2); //a graph with 2 vertices
//add an edge between node 0 and node 1 with weight (capacity) 2.3 EdgeCapacityProperty e = 2.3; add_edge(0, 1, e, g);
//find min cut
Traits::vertex_descriptor s, t; //double flow = kolmogorov_max_flow(g, s, t); // a list of sources will be returned in s, and a list of sinks will be returned in t EdgeCapacityProperty flow = kolmogorov_max_flow(g, s, t); // a list of sources will be returned in s, and a list of sinks will be returned in t std::cout << "Max flow is: " << flow << std::endl;
return 0; }
Thanks,
David
Any clues as to what I've done wrong? Maybe a simple example like this could be put on the kolmogorov documentation page?
The error message you get (the conversion error) should mention an argument number and a source location where the call with property_not_found is being used. Could you please look up that source location and argument number and see which property map the code is trying to use? You added one more map, but the documentation suggests several more that are required. The error message will probably say at least one of the missing ones. -- Jeremiah Willcock