Calculating The Minimum Distance In A Network Path