def is_nonnegative_length(G, l):
    """ Checks whether a length function, defined on the arcs, satisfies the non-negative condition.

    Args:
        G: An instance of Graph class.
        l: A dictionary that defines a length function on the edge set.

    Returns:
        A boolean, True if the length function satisfies the non-negativity condition, False in other case.

    """

    assert G.directed

    # Condición de no negatividad
    for e in G.aristas:
        if l[e] < 0:
            return False

    return True