Implement Single Source Shortest Path Length Equation