I want to change edge weight when examine an edge, but it tells
error: assignment of member ‘EdgeProperty::weight’ in read-only object g[e].weight = 1/g[e].residual_capacity;
If there is a way to change edge properties within a function of a custom visitor? Thanks.
struct EdgeProperty{
float weight;
float capacity;
float residual_capacity;
};
class custom_dijkstra_visitor : public boost::default_dijkstra_visitor
{
public:
template < typename Edge, typename Graph >
void examine_edge(Edge e, Graph const & g)
{
g[e].weight = 1/g[e].residual_capacity;
}
};