Fix weight bug in floyd warshall

Which was the last weight touched.