Skip to content

Constraint

Constraint dataclass

Constraint(
    int_set: set[int], min_count: int, max_count: int, weight: float = 1.0
)

Constraint indicating we want to sample at least min_count and at most max_count integers from int_set.

weight scales how strongly this constraint's violations count toward the feasibility score (default 1); a larger weight makes the solver prioritize satisfying it over lower-weight constraints.