Breadth First Search: Shortest Reach

  • + 8 comments

    I don't know your specifics but my Python passed all except for a runtime KeyError on that one. I fixed it by verifying that a node HAD any edges before looking to update all adjacent nodes.

    if node in edge_map.keys():  # populate BFS_map 
    

    Hope that helps trim some time for you.