• + 1 comment

    It is Dijkstra's algorithm with a twist. Be sure to keep track of already connected (side path found from s) nodes and exclude them from the loop.