Hi,
I am trying to read an undirected_graph from a .dot file with read_graphviz,
but I seem to some problems regarding the properties of the graph, which are
*vertex_index* and *edge_weight*.
/terminate called after throwing an instance of
'boost::exception_detail::clone_implboost::exception_detail::error_info_injector<boost::dynamic_const_put_error
'
what(): Attempt to put a value into a const property map: /
The code I am using is followed:
*typedef property EdgeWeightProperty;
typedef adjacency_list
undirected_graph;
typedef property_map::type weight_map_type;
typedef property_traits::value_type weight_type;
typedef std::pair edge_t;
undirected_graph read_graph(std::string filename, dynamic_properties * dp) {
std::ifstream in(filename.c_str());
// ... check errors in file ...
undirected_graph g(0);
read_graphviz(in, g, *dp, "node_id");
in.close();
return g;
}
int main() {
boost::dynamic_properties dp;
// populate graph properties by reference
undirected_graph g = read_graph("test_boost_graph.dot", &dp);
dp.property("node_id", get(vertex_index, g));
dp.property("w", get(edge_weight, g));
// write to cout
write_graphviz_dp(cout, g, dp, "node_id");
return 0;
}*
I think the example is pretty simple and it should work. However I don't get
much when googling the resulting error.
Does someone know what's this about?
Thanks in advance
--
View this message in context: http://boost.2283326.n4.nabble.com/Properties-error-reading-undirected-graph...
Sent from the Boost - Users mailing list archive at Nabble.com.