graph.hpp rewrited with <T, T, double>