Use one variable for each cell, with . An empty cell has constraint domain ; a clue containing has singleton constraint domain . Thus all clues are retained automatically.
For every row impose , and for every column impose . For each impose an all-different constraint onThese are the nine prescribed boxes. There are 27 all-different constraints altogether. Nine pairwise distinct values chosen from a set of nine values must use every value exactly once, so these restrictions are precisely the Sudoku requirements. Equivalently, expand each all-different constraint into pairwise binary constraints for cells sharing a row, column, or box.
Choose the distinct values of and call them . There are choices. Constraint (5), on , immediately forces .
Constraints (2) and (3) require and , respectively. Since the constraint domain has exactly three values, . Constraint (2) now forces , and constraint (3) forces . Finally, constraint (4) permits or .
Every choice just described satisfies all five all-different constraints, and the forced-value argument shows there are no other possibilities. HenceIn the order , the two forms arewhere ranges over the six permutations of .
The constraint hypergraph has one vertex for each of and one hypergraph edge for each constraint scope:Here abbreviates . These five scopes follow the corrected source.[ref]
Intelligent Systems examination paper by the University of Oxford (2015). Printed p. 4, corrected Question 3(b), constraints (1)–(5)
The diagram uses the incidence representation: round nodes are the original variables, square nodes represent hypergraph edges, and a joining line means that the variable belongs to that constraint scope. The square nodes are not extra variables of .In particular, the central pattern involving forms a cycle through three constraint scopes; the scopes cannot themselves simply be joined into a valid tree decomposition without an additional bag.
Use the ordinary treewidth of the primal graph of the constraint hypergraph: two variables are adjacent whenever they occur together in an all-different constraint. Equivalently, a tree decomposition of this constraint hypergraph has a bag containing every constraint scope, together with the running-intersection requirement for each variable. This is distinct from taking the treewidth of its incidence drawing.
Every constraint scope is contained in its own bag, and every variable occurs. The nontrivial running-intersection checks are: occurs along ; along the connected branches ; along ; along ; and along . Each of the other variables occurs in just one bag. This is therefore a valid tree decomposition of width .
Conversely, any of the original three-variable constraint scopes forms a clique of size three in the primal graph. Such a clique must be contained in one bag of every tree decomposition, forcing width at least two. The upper and lower bounds agree:
Always true. An all-different constraint of arity requires distinct values. If , the pigeonhole principle makes even one such constraint impossible. Since , at least one is present, and consequently
True in some cases and false in others: the two numerical inequalities do not guarantee a solution.
For an unsatisfiable example satisfying both inequalities, take six variables, a constraint domain with five values, and , , with all-different constraints onAny pair of the six variables occurs together in at least one of these scopes: view the variables as the three pairs , and each scope as the union of two pairs. All six values must therefore be distinct. This is impossible with five available values, even though and .
For a satisfiable example with the same , take three disjoint groups of four variables and impose one all-different constraint on each group. Assign values separately in every group. All three constraints hold with .These examples concern the intended cases in which the antecedent holds; they do not rely on vacuous truth of an implication.
True in some cases and false in others. Equality of the constraint domain size and treewidth does not decide satisfiability.
For an unsatisfiable example, let and impose the three binary all-different constraints , , and . The primal graph is a triangle, with treewidth two. It needs three different values, so no solution exists despite .
For a satisfiable example, take four variables with the same constraint domain and constraintsIts primal graph is a four-cycle of treewidth two: bags and give width two, while width one would require a forest. The assignment satisfies all constraints.
Always true. Replace every all-different constraint by the pairwise inequalities on its scope. Then solutions are precisely the proper graph colourings of the primal graph using values from as colours. Put .
A graph of treewidth has a proper graph colouring with at most colours. Here is a constructive proof. In a width- tree decomposition, remove any leaf bag contained in its neighbor. If more than one bag remains, a leaf bag has a vertex absent from its neighbor. The running-intersection property means that vertex occurs only in the leaf bag, so every neighbor of the vertex belongs to that bag. It has at most neighbors. If only one bag remains, it has at most vertices and the same degree bound holds.
Remove the chosen vertex and repeat; deleting vertices cannot increase the width of the restricted tree decomposition. Now colour in reverse removal order. At most already coloured neighbors forbid colours, so one of colours is always available. Since the integer inequality gives , this produces a satisfying assignment:The common unrestricted constraint domain and the exclusively all-different constraints are essential: arbitrary constraint relations do not reduce to graph colouring in this way.
Always true for a nonempty finite constraint domain, as conventionally assumed. Write and identify its values with . For each satisfying assignment , simultaneously replace every value byThis permutation of the common constraint domain preserves every equality and inequality, hence every all-different constraint. The resulting assignments are distinct: equality of even one coordinate before and after a shift forces . There is at least one variable, since and .
The cyclic group of shifts therefore partitions the solution set into disjoint orbits of size . It follows thatThe conclusion includes an unsatisfiable instance, whose solution count is zero. Full permutation group orbits need not have size , because unused values can be permuted without changing an assignment; the cyclic-shift argument avoids that mistake.
If an empty constraint domain is permitted, there are zero assignments here, but the wording “divisible by ” then asks about divisibility by zero, which is ordinarily left undefined. The asserted divisibility uses the standard nonempty-domain convention, and the no-solution conclusion still holds for that degenerate input.
Articles by others on the same topic
There are currently no matching articles.

