def merge_dict(path, single_trans):
    """
    Merge a single transition into the total path.
    """
    for k in single_trans:
        path[k] += single_trans[k]
    return 1 - single_trans['not_done'][0]