added getShortestNodeIndex help method