Implementation of short path function between two actors.