Adding test for non negative weight on shortest path algorithm