modification related to shortest-path computation