Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Constructor: NeighborSumConstraint(bool, int, int[], IEnumerable<UniquenessConstraint>, int, int, int, int)

Declaration

public NeighborSumConstraint(
    bool isCol,
    int rowCol,
    int[] clue,
    IEnumerable<UniquenessConstraint> furtherRestrictions = null,
    int gridWidth = 9,
    int gridHeight = 9,
    int minValue = 1,
    int maxValue = 9
)

Summary

Describes a constraint as used in Neighbor Sum Sudoku by Timwi (https://logic-masters.de/Raetselportal/Raetsel/zeigen.php?id=0005NV): Each number outside the grid gives the sum of all orthogonal neighbors of one cell in the corresponding row or column. Where multiple numbers are given, the sums must be in the same order as the clues.

Parameters

boolisCol If true, the constraint applies to a column; otherwise a row.
introwCol The row or column (depending on isCol).
int[]clue The set of neighbor sums. Currently only 1 or 2 numbers are supported.
IEnumerable<UniquenessConstraint>furtherRestrictions Pass in a UniquenessConstraint collection to restrict the number of combinations generated. This can yield profound improvements in the speed of finding solutions. For example, you can construct a Sudoku instance, then construct this NeighborSumConstraint by passing in sudoku.Constraints.OfType<UniquenessConstraint>().
intgridWidth The width of the grid (default: 9).
intgridHeight The height of the grid (default: 9).
intminValue Specifies the smallest value used in this puzzle.
intmaxValue Specifies the largest value used in this puzzle.

Remarks

This is implemented as a CombinationsConstraint, which may make it very memory-intensive on oversized puzzles.