def _init(graph, source):
    """
    Initialize node distances and predecessors and return two dicts.
    
    Makes two dicts, one for node distances, and one for node predecessors,
    and initializes all distances (except the source's) to infinity and all 
    predecessors to None.
    
    graph -- a networkx graph
    source -- the source node
    """
    dist, pred = dict(), dict()
    inf = float('inf')
    for node in graph.nodes_iter():
        dist[node] = inf
        pred[node] = None
    dist[source] = 0
    return dist, pred