add weighted version of in algorithms.graph.merge_paths()