Weight map as function in Boost Graph Dijkstra algorithm
I'm using Boost Graph Libraries and need to use a weightmap which is not constant, but which is a function of a parameter K (i.e. the edge costs depend on K). In practice, given the following code: #include <boost/config.hpp> #include <iostream> #include <fstream> #include <boost/graph/graph_traits.hpp> #include <boost/graph/dijkstra_shortest_paths.hpp> #include <boost/graph/adjacency_list.hpp> struct Edge { Edge(float weight_) : weight(weight_) {} float weight; float getWeight(int K) { return K*weight; } }; int main(int, char**){ typedef boost::adjacency_list < boost::vecS, boost::vecS, boost