Add method to get the total value in edges in the shorthest path