def get_pred(succ):
    """Given a successor edge map, produce an inverted predecessor edge
    map.
    """
    out = {key: [] for key in succ}
    for p, ss in succ.items():
        for s in ss:
            out[s].append(p)
    return out