def FP_update(L, R, t0, t1, u, v):
    """
    Lu is sorted by the value of au and we analyze temporal links in temporal order.
    :param L:
    :param t0:
    :param t1:
    :param u:
    :param v:
    :return:
    """
    su, au = L[u]
    su = -su
    new_arrival = t0
    new_start = min(t1, su)
    if v in R:
        current_best_duration = max(R[v][1] - R[v][0], 0)
        if max(new_arrival - new_start, 0) < current_best_duration:
            R[v] = new_start, new_arrival
        if v in L:
            sv, av = L[v]
            sv = -sv
            if new_start > sv:
                L[v] = -new_start, new_arrival
            elif new_start < sv:
                return False
        else:
            L[v] = -new_start, new_arrival
    else:
        L[v] = -new_start, new_arrival
        R[v] = new_start, new_arrival
    return True
