def check_pre(v, g, order):
    """Check if all predecessors have already been placed."""
    if order.get_position(v) > -2:
        return False
    for v2 in g.predecessors(v):
        if order.get_position(v2) == -2:
            return False
    return True
