def single_source_shortest_path(graph, node):
    """
    Finds the shortest paths from a single source to the rest of the nodes in the graph.
    """
    nodes = []
    paths = {}
    for v in graph:
        paths[v] = []
    sigma = dict.fromkeys(graph, 0.0)
    distances_dict = dict()
    sigma[node] = 1.0
    distances_dict[node] = 0
    remaining_nodes = [node]
    while remaining_nodes:   # use BFS to find shortest paths
        v = remaining_nodes.pop(0)
        nodes.append(v)
        distance_v = distances_dict[v]
        sigma_v = sigma[v]
        for edge in graph[v]:
            if edge not in distances_dict:
                remaining_nodes.append(edge)
                distances_dict[edge] = distance_v + 1
            if distances_dict[edge] == distance_v + 1:   # this is a shortest path, count paths
                sigma[edge] += sigma_v
                paths[edge].append(v)  # predecessors
    return nodes, paths, sigma