Move shortest path function to MHN module