def shortest_path(graph, start, end, path=[]):
    """Uses recursion to find the shortest path from one node to another in an
    unweighted graph.  Adapted from http://www.python.org/doc/essays/graphs.html

    Args:
        graph: A mapping of the graph to analyze, of the form
               {0: [1,2], 1:[3,4], ...} . Each key has a list of edges.
        start: The ID of the key to start the analysis from
        end:   The ID of the key to end the analysis
        path:  Optional argument used during the recursive step to keep the
        current path up to that point

    Returns:
        List of the shortest path (list) Returns None if start and end are not
        connected
    """
    path = path + [start]
    if start == end:
        return path
    if start not in graph:
        return None
    shortest = None
    for node in graph[start]:
        if node not in path:
            newpath = shortest_path(graph, node, end, path)
            if newpath:
                if not shortest or len(newpath) < len(shortest):
                    shortest = newpath
    return shortest