Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: ConstraintResult Process(SolverState)

Declaration

public abstract ConstraintResult Process(
    SolverState state
)

Summary

Constraint implementations must use SolverState.MarkImpossible(int, int) to mark values that are known to be impossible given the incomplete grid exposed by SolverState.this[int].

Returns

Implementations must return null if the constraint remains valid for the remainder of filling this grid, or a collection of constraints that this constraint shall be replaced with (can be empty).

For example, in EqualSumsConstraint, since the sum is not initially known, the constraint waits until one of its regions is filled and then uses this return value to replace itself with several SumConstraints to ensure the other regions have the same sum.

The algorithm will automatically call this method again on all the new constraints for all cells already placed in the grid. The constraints returned MUST NOT themselves return yet more constraints at that point.