Function Repository Resource:

FindExactCover

Source Notebook

Find row subsets of an input binary matrix that sum to 1 in each column

Contributed by: Bradley Klee

ResourceFunction["FindExactCover"][mat]

finds a row subset of the binary matrix mat which sums to 1 in each column.

ResourceFunction["FindExactCover"][mat,All]

finds all row subsets with sum equal to 1 in each column.

ResourceFunction["FindExactCover"][mat,n]

finds up to n row subsets with sum equal to 1 in each column.

Details

An exact cover is a partitioning of a set of elements into disjoint subsets whose union is exactly the original set.
The exact cover (XC) problem gives an original set along with a list of allowable subsets and asks if any selection of the allowable subsets is an exact cover of the original set. It is an NP complete problem, and very similar to graph clique finding (cf. FindClique).
Here we do not deal with sets and subsets, but rather with binary matrices. The input binary matrix mat lists allowable subsets as rows and set elements as columns, by coding that the kthelement of the original set is also a member of the jth listed subset if and only if matjk=1. Thus a one's row {1,1,,1} represents a trivial exact cover.
Sometimes the terms items and options are used in place of column and row headers respectively. The exact cover problem can then be stated as follows: Choose a set of options such that every item is included in exactly one option.
If two options are not disjoint, their respective row sum will have a value exceeding 1 in at least one column. Similarly, if neither of two options includes the kth item, their respective row sum will have a 0 in the kth column. Let { j1,j2, }∈𝒪 be a set of options. It is an exact cover if and only if the respective row sum satisfies that .
Now define a graph whose vertices are options and whose edges indicate pairwise disjunction. Cliques in the graph represent maximal sets of disjoint options, which can easily be tested for the exact cover property once they are found.
FindExactCover has a Method option for switching between three distinct algorithms:
"DancingLinksX"Donald Knuth's algorithm
"CliqueToCover"transforms input to a graph and uses FindClique
"BranchAndPrune"uses a depth-first search
When using the DancingLinksX method, setting the Heuristic sub-option to either Automatic or "Increment" changes the search order:
{"DancingLinksX","Heuristic"→ Automatic}Knuth's suggested MRV heuristic
{"DancingLinksX","Heuristic"→ "Increment"}select right-nearest column
The "MRV heuristic" chooses to cover the next item with the minimal number of associated options.
ResourceFunction["FindExactCover"] ignores empty subsets, i.e. zero's rows of the form {0,0,…,0}.

Examples

Basic Examples (4) 

An IdentityMatrix has only one exact cover:

In[1]:=
ResourceFunction["FindExactCover"][IdentityMatrix[3]]
Out[1]=

List the five set partitions of three objects into disjoint sets:

In[2]:=
ResourceFunction["FindExactCover"][Most[Tuples[{1, 0}, 3]], All]
Out[2]=

Solve an example problem from Wikipedia:

In[3]:=
With[{coverMatrix = {
    {1, 0, 0, 1, 0, 0, 1},
    {1, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 1, 0, 1},
    {0, 0, 1, 0, 1, 1, 0},
    {0, 1, 1, 0, 0, 1, 1},
    {0, 1, 0, 0, 0, 0, 1}},
  alpha = ToUpperCase[Alphabet[]]},
 alpha[[Position[coverMatrix, #][[1, 1]] ]] & /@
  ResourceFunction["FindExactCover"][coverMatrix]]
Out[3]=

Find an exact cover of the columns of a 5×4 matrix:

In[4]:=
With[{coverMatrix = Rest[Tuples[{0, 1}, 4][[1 ;; -1 ;; 3]]]},
 MatrixForm[coverMatrix] -> MatrixForm[ResourceFunction["FindExactCover"][coverMatrix]]
 ]
Out[4]=

Test the row sum property:

In[5]:=
With[{coverMatrix = Rest[Tuples[{0, 1}, 4][[1 ;; -1 ;; 3]]]},
 MatchQ[Total@
   ResourceFunction["FindExactCover"][coverMatrix], {1 ..}]]
Out[5]=

Find all exact covers:

In[6]:=
With[{coverMatrix = Rest[Tuples[{0, 1}, 4][[1 ;; -1 ;; 3]]]},
 MatrixForm[coverMatrix] -> Map[
   MatrixForm, ResourceFunction["FindExactCover"][coverMatrix, All]
   ]]
Out[6]=

Scope (1) 

Ask for only five results:

In[7]:=
ResourceFunction["FindExactCover"][Tuples[{0, 1}, 4], 5]
Out[7]=

Options (3) 

For small simple inputs, setting the "Heuristic" suboption to "Increment" can get results faster:

In[8]:=
AbsoluteTiming[SeedRandom[9230482];
   ClearSystemCache[]; Reap[
     ResourceFunction["FindExactCover"][RandomInteger[1, { 100, 10}],
      All, Method -> {"DancingLinksX", "Heuristic" -> #}]
     ] /. {x_, y_} :> Rule[y[[1, 1]], Length[x]]
   ] & /@ {Automatic, "Increment"}
Out[8]=

The Automatic heuristic can go noticeably faster for more complex inputs:

In[9]:=
AbsoluteTiming[SeedRandom[9230482];
   ClearSystemCache[]; Reap[
     ResourceFunction["FindExactCover"][
       RandomChoice[{.3, .7} -> {1, 0}, {100, 10}],
       All, Method -> {"DancingLinksX", "Heuristic" -> #}] faster
     ] /. {x_, y_} :> Rule[y[[1, 1]], Length[x]]
   ] & /@ {Automatic, "Increment"}
Out[9]=

But alternative methods can still be faster for relatively small, unstructured inputs:

In[10]:=
AbsoluteTiming[SeedRandom[9230482];
   ClearSystemCache[]; Length@ResourceFunction["FindExactCover"][
     RandomChoice[{.3, .7} -> {1, 0}, {100, 10}],
     All, Method -> #]
   ] & /@ {"CliqueToCover", "BranchAndPrune"}
Out[10]=

Possible Issues (2) 

The default Dancing Links X method should be relatively slow when every valid choice leads to another result:

In[11]:=
ListPlot[MapApply[Divide,
  Outer[ClearSystemCache[];
   First@AbsoluteTiming[ResourceFunction["FindExactCover"][
       #1, All, Method -> #2]] &,
   Tuples[{1, 0}, #] & /@ Range[5],
   {"DancingLinksX", "CliqueToCover"}, 1 ]],
 PlotLabel -> Text["Slowdown Factor"],
 PlotRange -> {0, 10}]
Out[11]=

Dancing Links X may also be slower in the limit of small inputs:

In[12]:=
With[{tetrisData = {SparseArray[
    Automatic, {1, 4}, 0, {1, {{0, 4}, {{1}, {2}, {3}, {4}}}, {1, 1, 1, 1}}], SparseArray[
    Automatic, {21, 8}, 0, {1, {{0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
        60, 64, 68, 72, 76, 80, 84}, {{5}, {6}, {7}, {8}, {4}, {6}, {
       7}, {8}, {3}, {5}, {7}, {8}, {4}, {5}, {6}, {8}, {3}, {5}, {
       6}, {8}, {4}, {5}, {6}, {7}, {3}, {4}, {6}, {8}, {3}, {5}, {
       6}, {7}, {2}, {4}, {6}, {8}, {3}, {4}, {5}, {7}, {3}, {4}, {
       5}, {6}, {2}, {4}, {5}, {6}, {1}, {3}, {5}, {7}, {1}, {3}, {
       5}, {6}, {2}, {3}, {4}, {6}, {1}, {3}, {4}, {6}, {2}, {3}, {
       4}, {5}, {1}, {2}, {4}, {6}, {1}, {3}, {4}, {5}, {1}, {2}, {
       3}, {5}, {1}, {2}, {3}, {4}}}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}], SparseArray[
    Automatic, {65, 12}, 0, {1, {{0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
        60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 256, 260}, {{9}, {10}, {11}, {12}, {8}, {10}, {11}, {12}, {7}, {
       10}, {11}, {12}, {8}, {9}, {11}, {12}, {6}, {9}, {11}, {12}, {
       7}, {8}, {11}, {12}, {8}, {9}, {10}, {11}, {5}, {8}, {11}, {
       12}, {7}, {8}, {9}, {12}, {7}, {8}, {10}, {11}, {6}, {8}, {
       9}, {12}, {7}, {8}, {9}, {11}, {5}, {8}, {9}, {12}, {5}, {8}, {
       10}, {11}, {6}, {8}, {9}, {11}, {7}, {8}, {9}, {10}, {5}, {
       8}, {9}, {11}, {4}, {7}, {10}, {11}, {5}, {6}, {9}, {12}, {
       5}, {7}, {8}, {11}, {3}, {6}, {9}, {12}, {4}, {7}, {8}, {11}, {
       5}, {6}, {8}, {11}, {5}, {7}, {8}, {10}, {6}, {7}, {8}, {9}, {
       4}, {7}, {8}, {10}, {5}, {7}, {8}, {9}, {4}, {5}, {8}, {11}, {
       4}, {7}, {8}, {9}, {5}, {6}, {8}, {9}, {2}, {5}, {8}, {11}, {
       3}, {6}, {8}, {9}, {4}, {5}, {7}, {10}, {4}, {5}, {8}, {9}, {
       5}, {6}, {7}, {8}, {2}, {5}, {8}, {9}, {4}, {5}, {6}, {9}, {
       4}, {5}, {7}, {8}, {3}, {5}, {6}, {9}, {4}, {5}, {6}, {8}, {
       1}, {4}, {7}, {10}, {2}, {5}, {6}, {9}, {2}, {5}, {7}, {8}, {
       3}, {5}, {6}, {8}, {4}, {5}, {6}, {7}, {2}, {5}, {6}, {8}, {
       1}, {4}, {7}, {8}, {2}, {3}, {6}, {9}, {2}, {4}, {5}, {8}, {
       1}, {4}, {5}, {8}, {2}, {3}, {5}, {8}, {2}, {4}, {5}, {7}, {
       3}, {4}, {5}, {6}, {1}, {4}, {5}, {7}, {2}, {4}, {5}, {6}, {
       1}, {2}, {5}, {8}, {1}, {4}, {5}, {6}, {2}, {3}, {5}, {6}, {
       1}, {2}, {4}, {7}, {1}, {2}, {5}, {6}, {2}, {3}, {4}, {5}, {
       1}, {2}, {3}, {6}, {1}, {2}, {4}, {5}, {1}, {2}, {3}, {5}, {
       1}, {2}, {3}, {4}}}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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bR7fHS77T6YaH7mAXpuCDRt5y7qD/AFjI
EXE=
"]}, CompressedData["
1:eJxTTMoPSmJkYGA4AiQYR8GQBwDtgQQx
"]}], SparseArray[Automatic, {161, 20}, 0, {1, {CompressedData["
1:eJwl0hFzAgAABeC2C4IgCIKg3QVBEARBEARB0O2CIOh2QdBtQRAEQRAEwWAQ
dLtgMAiCIBgMBkEQBMFgEAyCwSDY1+3dfT/gvXs3dw+391eBQOA58J8gIcJE
iBIjToIkKdJkyJIjT4EiJcpUqFKjToMmLdp06NKjz4AhI8ZMeOSJKTPmvPDK
giUr1rzxzgcbtuzYc+CTL458c+KHX86X8oYIEiJMhCgx4iRIkiJNhiw58hQo
UqJMhSo16jRo0qJNhy49+gwYMmLMhEeemDJjzguvLFiyYs0b73ywYcuOPQc+
+eLINyd++OV8OcG1/oQIEyFKjDgJkqRIkyFLjjwFipQoU6FKjToNmrRo06FL
jz4DhvwBPY9Kng==
"], CompressedData["
1:eJwlj9d5wzAMhMUmAiygihfwShnBC2SJDJ4f1gN1hyv4oPfn9+cTt2374xPA
87pfi2e8yTsQbDGDkzccjZlQQ58EJ6HBU/TufHpm4Z0XeCuZMb/8auiCryD8
7sPzhn+caKBdQrazEH4qXiUjoLb1Ysab3lny8LOS1WZ3Q2M+BJ/cKuR3DqrM
wnHopzwZq86VHEeozxyCb5ncDq8ciXaQM7pLWY5+FPJVhndNWERmJrL01s6h
u2vinbaExSA76dZ+0PN5FrxIlh5eW8z43lOrLEUDlb1j0hvwkfECP0MPXS3z
c2j44r2WHj4i+VzUChpzT/jkGl08mYlD0UZ6fI3OMxmOyD5zCL4GMHIgcyej
9FouX73HVL2jiQX4EjgqOE+eKy2xCNQQd8869wx+1kgJZP5iDZTAAjrfefkf
0A8cmg==
"]}, CompressedData["
1:eJxTTMoPSmJkYGBoYWJgYBwFo2CAAQC7VQSy
"]}], SparseArray[Automatic, {209, 24}, 0, {1, {CompressedData["
1:eJwl0pGTIgAYxuHubiEIgiAIupkgCIIgCII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td0O1GOJW4zXucu9m4qGv/LkJTa7H1loca8ZfGv7a
EelmsVinvh/e3lSHHn7LYmTcubZU5Yhr0+pvkFZtp2EVWviaNzdh8gyLM9fN
uOHkBrjton7IGFNVv3kTlvp+dnJV31eM1LRR2+PFe2eOLqmfahD3eBvUjjWw
Q29D7ytmZ3TutE5s/wFJwzvs
"]}, CompressedData["
1:eJxTTMoPSmJkYGBgYWFgYBwFo2AUjGgAAOt9BbQ=
"]}], SparseArray[Automatic, {305, 32}, 0, {1, {CompressedData["
1:eJwl0xGQIgAUBuDudiEIgiAIupkgCJqbIAiCIAiamyAImpsgaO6CIAiCIAiC
IAiCIAiCIAiCIFhYCBaCIAiChYVg4b6dezPf8/9/8378/vvrz7dAIPDza5ln
goQIEyFKjDgJkqRIkyFLjjwFipQoU6FKjToNmrRo06FLjz4DhowYM2HKjDkL
lqxYs2HLjj0Hjrzwyok3zly4cuPOOx88+PwKr4NngoQIEyFKjDgJkqRIkyFL
jjwFipQoU6FKjToNmrRo06FLjz4DhowYM2HKjDkLlqxYs2HLjj0Hjrzwyok3
zly4cuPOOx88+Py6/3f5CRIiTIQoMeIkSJIiTYYsOfIUKFKiTIUqNeo0aNKi
TYcuPfoMGDJizIQpM+YsWLJizYYtO/YcOPLCKyfeOHPhyo0773zw4JPAk/wE
CREmQpQYcRIkSZEmQ5YceQoUKVGmQpUadRo0adGmQ5cefQYMGTFmwpQZcxYs
WbFmw5Ydew4ceeGVE2+cuXDlxp13Pnjw+fT/+Z8JEiJMhCgx4iRIkiJNhiw5
8hQoUqJMhSo16jRo0qJNhy49+gwYMmLMhCkz5ixYsmLNhi079hz4B6nBlVM=

"], CompressedData["
1:eJwl0VmimzAMQNGEMQFsCGbInNctdQndQDfZhfUQPhxLsn2vUH79+fv7T3Y4
HP4Vh8PR/np/fp5+rvbVWqyHwqq2WLO1Xj8/d8VFfbaW1V0Ppm/8/twczs4n
awZYPB68Sd/89e7dn9xZ1utPsk+gM5j803s/7mfvCTx6nwBnktGeSCZw+Tti
DRiX/fzVi+WfRBzmzXP9TBoYiROh+BUweyzxM9rFzr/vr920+dZ30tBFEyOx
+NnhRZx+0C95EMvdud1x1jZtvuXVD+tnwBk12e/7o8UOeNFHx7127+RqepqX
hkf+jD0+1kWzJ564x/eGo8MLBhH22q2Vqz34Nt58NgC1R4g8mDUX/sJ57TXU
YnYG0n196SG/822sSX7vAj5OxYE7c61RMyf8xiBag2m/nvEuv/Fsjqv81nbY
ONFwSg7siWsJGlFba57GgJr9zsK1edRwNRA0WeDjJp6504jaUnGcMM8GdN7v
zbVcbeWcuPQwrOfmcus0nG8OTbaakc8lT40tniq7eOHcOAOfHvql1Wi28TXX
aEY+FdgVXu1PkKdSLJ95RqyehzvO9alfT1iNpo/+gHqPU85R4lYGVO21sZCr
6S1EviSfqpoD76zpat/HjKPAKw2o3GuXXK6W+DZW4BrVUllx4OFGrqHWTI5V
GEzx9bRJPvJsnE4+FiU2Bl7g6CsNZD4+N5D8y25G+QU7ii95gedtZRhYHXYs
SeV9ZhDZfhZxQ5bjEJWawWgxQ0Emj0cffdzPAmZ3zM6XQgMYXU4gdrfqMLY7
p5zImzYDFLtTtt407tQZsOWs2M6qI4jVWGe10l78B215URQ=
"]}, CompressedData["
1:eJxTTMoPSmJkYGA4wsLAwDgKRsEoGAVDGAAAEWQHNA==
"]}], SparseArray[Automatic, {353, 36}, 0, {1, {CompressedData["
1:eJwl1CGwKQgUBuC7++7OCIIgCIKdEQRBEARBEATB7AiCYN4IgnlPEARBEARB
EARBEARBEARBEIQbbrhBEARBEARBEN53Z8/Md/p/zpzz78/f//366+3t7ed3
U+8ECBIiTIQoMeIkSJIiTYYsOfIUKFKiTIUqNeo0aNKiTYcuPfoMGDJizIQp
M+YsWLJizYYtO/Yc+OCTL46cOHPhyo07D568vsObwTsBgoQIEyFKjDgJkqRI
kyFLjjwFipQoU6FKjToNmrRo06FLjz4DhowYM2HKjDkLlqxYs2HLjj0HPvjk
iyMnzly4cuPOgyev7/3/LT8B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I8uEuS58ACyDDle6FvY48S34Mu89DLiWHOxA
BWY/sESY9sZHwNDonn5vYA6jjiN+5CCD2Dr84Rn4e0vP7HoWCc+QYZ3mylFt
1VUY8INvW7xh6YZKv3csD46GbUfC4S2bqkvf8x6uaVgM/upKpd9aFoevgmeG
sfjO7GHZqLbthOvwgFl00xY/FoSnhKX7oXhOlmOadtlbgLCKpvEWVxaCl4Ch
ur74jIajr80Nbp0VfrLtyruB3NNMRauz5L1oMG2B8duJilZn9I4Mw0gt/XLF
CH2glv6G1lO7/yxFaD0=
"]}, CompressedData["
1:eJxTTMoPSmJkYGBoYWVgYBwFo2AUjIJRMGAAAGSHB7U=
"]}]}}, Labeled[
  ListLogPlot[Outer[AbsoluteTiming[
       ResourceFunction["FindExactCover"][Normal[#2], All, Method -> #1]][[1]] &,
    {"DancingLinksX",
     {"DancingLinksX", "Heuristic" -> "Increment"},
     "BranchAndPrune", "CliqueToCover"},
    tetrisData[[1 ;; 5]], 1], PlotStyle -> {Red, Orange, Darker@Green, Blue},
   PlotLabel -> "First terms of Tetris Timing Test "],
  Grid[{{Spacer[10],
     Red, Text@"DancingLinksX", Spacer[50],
     Blue, Text@"CliqueToCover"},
    {Spacer[10],
     Orange, Text@"DLX + Increment", Spacer[50],
     Darker@Green, Text@"BranchAndPrune"
     }}, Alignment -> Left]]]
Out[12]=

But Dancing Links X can have better complexity scaling:

In[13]:=
With[{timingsData = {{{0.000126, 1}, {0.001624, 4}, {0.016606, 23}, {0.071039, 117}, {0.51405, 454}, {7.019132, 2003}, {103.378979, 9157}, {
DirectedInfinity[1], 0}, {
DirectedInfinity[1], 0}}, {{0.000273, 1}, {0.003343, 4}, {0.02751, 23}, {0.094647, 117}, {0.336667, 454}, {1.384281, 2003}, {7.586634, 9157}, {44.559014, 40899}, {251.11148, 179399}}, {{0.000788, 1}, {0.008222, 4}, {0.058785, 23}, {0.220384, 117}, {0.901261, 454}, {3.972747, 2003}, {18.658699, 9157}, {88.163207, 40899}, {405.350752, 179399}}, {{0.000613, 1}, {0.006324, 4}, {0.047467, 23}, {0.259825, 117}, {1.317492, 454}, {7.347735, 2003}, {42.384888, 9157}, {
DirectedInfinity[1], 0}, {
DirectedInfinity[1], 0}}}}, Labeled[
  ListLogPlot[Map[First, timingsData, {2}],
   PlotLabel -> "More terms of Tetris Timing Test",
   PlotStyle -> {Blue, Darker@Green, Red, Orange}],
  Grid[{{Spacer[10],
     Red, Text@"DancingLinksX", Spacer[50],
     Blue, Text@"CliqueToCover"},
    {Spacer[10],
     Orange, Text@"DLX + Increment", Spacer[50],
     Darker@Green, Text@"BranchAndPrune"
     }}, Alignment -> Left]]]
Out[13]=

Neat Examples (4) 

Find a solution to Scott's pentomino problem:

In[14]:=
With[{
  template0 = ArrayPad[ConstantArray[1, {2, 2}], 3],
  res1 = ResourceFunction["FindExactCover"][
    Normal[SparseArray[Automatic, {1568, 72}, 0, {1, {CompressedData["

1:eJwl2HEoeF2ewGFrzW9nZ6w11hprjTVGkiRJkiRJkiRJkiRJkmQlSZIkSZIk
SZIkSZIkSZIkSZIkSZIkSZIkSZL2efc99XT+vbdPt3Pu9+91/1vW8k8BAQF/
/xXw/+u3LZgwIokhniRSySCbPAopoZwqammgmTY66aGfIUaZYJo5FllhnS12
OeCYMy654Z4nXvngm0AP/UdCCCeKWBJIJo1McsiniFIqqKaORn57+Xa66GWA
YcaYZIZ5llhlg232OOSEc6645YFn3vjkh6DAgIA/EUoE0cSRSArpZJFLAcWU
UUkN9TTRSgfd9DHICONMMcsCy6yxyQ77HHHKBdfc8cgL73wR8M/6E0wYkcQQ
TxKpZJBNHoWUUE4VtTTQTBud9NDPEKNMMM0ci6ywzha7HHDMGZfccM8Tr3zw
TWCQ/oQQThSxJJBMGpnkkE8RpVRQTR2NtNBOF70MMMwYk8wwzxKrbLDNHoec
cM4VtzzwzBuf/BD0B/0JJYJo4kgkhXSyyKWAYsqopIZ6mmilg276GGSEcaaY
ZYFl1thkh32OOOWCa+545IV3vv7w+8f/i2DCiCS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Sifn1XaqC3z8l/VMv6Z/Lkv65Kumf65L+uSnpn9uS
/mmWrPmtkv5pl/TPfUn/dEv657Gkf4Yl/fNc0j/zkv5ZlPTPsqR/Xkv656Ok
fz5L+uerpH++S/rnp6R/fkveUcvD1aJkqZeHq0XJUi8PV8GSy1mzZJ2XhEtg
yYWsW7LI90sWeXm4ZpQs8qOSS5hUXDBK1vlFyfVLHq4WJUu9PFwtSpZ6ebha
lCz1vxvkT22D/KlvkD+XG+TP1Qb5c71B/txskD+NDfKnuUEetjbIn/YG+dPZ
IH/6G+TPYIP8mW6QP7MN8me+Qf6sNsif9Qb5875B/nxskD+fG+TP1wb5871B
/vz8H1C+PHk=
"]}, CompressedData["
1:eJztwUENACAMBLCbFBIUIWEGsDhpyODTdvU9XUlmJwUAAAAAAAAAAPDJAzWg
J0w=
"]}]], 1]},
 ArrayPlot[ReplacePart[template0 - 1,
   Catenate[MapIndexed[Thread[#1 -> (#2[[1]] + 1)] &,
     DeleteCases[Times[Position[template0, 0], #],
        {0, 0}] & /@ res1[[All, 13 ;; -1]]]]],
  ColorRules -> {0 -> Black, x_ :> Hue[x/5]},
  ImageSize -> 300]]
Out[14]=

Count number of length-n set partitions by enumerating them (cf. OEIS A000110):

In[15]:=
Length@ResourceFunction["FindExactCover"][Tuples[{1, 0}, #], All] & /@
  Range[6]
Out[15]=

Compute the first few terms of the Tetris sequence (cf. OEIS A174248):

In[16]:=
With[{tetrisData = {SparseArray[
    Automatic, {1, 4}, 0, {1, {{0, 4}, {{1}, {2}, {3}, {4}}}, {1, 1, 1, 1}}], SparseArray[
    Automatic, {21, 8}, 0, {1, {{0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
        60, 64, 68, 72, 76, 80, 84}, {{5}, {6}, {7}, {8}, {4}, {6}, {
       7}, {8}, {3}, {5}, {7}, {8}, {4}, {5}, {6}, {8}, {3}, {5}, {
       6}, {8}, {4}, {5}, {6}, {7}, {3}, {4}, {6}, {8}, {3}, {5}, {
       6}, {7}, {2}, {4}, {6}, {8}, {3}, {4}, {5}, {7}, {3}, {4}, {
       5}, {6}, {2}, {4}, {5}, {6}, {1}, {3}, {5}, {7}, {1}, {3}, {
       5}, {6}, {2}, {3}, {4}, {6}, {1}, {3}, {4}, {6}, {2}, {3}, {
       4}, {5}, {1}, {2}, {4}, {6}, {1}, {3}, {4}, {5}, {1}, {2}, {
       3}, {5}, {1}, {2}, {3}, {4}}}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}], SparseArray[
    Automatic, {65, 12}, 0, {1, {{0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
        60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 256, 260}, {{9}, {10}, {11}, {12}, {8}, {10}, {11}, {12}, {7}, {
       10}, {11}, {12}, {8}, {9}, {11}, {12}, {6}, {9}, {11}, {12}, {
       7}, {8}, {11}, {12}, {8}, {9}, {10}, {11}, {5}, {8}, {11}, {
       12}, {7}, {8}, {9}, {12}, {7}, {8}, {10}, {11}, {6}, {8}, {
       9}, {12}, {7}, {8}, {9}, {11}, {5}, {8}, {9}, {12}, {5}, {8}, {
       10}, {11}, {6}, {8}, {9}, {11}, {7}, {8}, {9}, {10}, {5}, {
       8}, {9}, {11}, {4}, {7}, {10}, {11}, {5}, {6}, {9}, {12}, {
       5}, {7}, {8}, {11}, {3}, {6}, {9}, {12}, {4}, {7}, {8}, {11}, {
       5}, {6}, {8}, {11}, {5}, {7}, {8}, {10}, {6}, {7}, {8}, {9}, {
       4}, {7}, {8}, {10}, {5}, {7}, {8}, {9}, {4}, {5}, {8}, {11}, {
       4}, {7}, {8}, {9}, {5}, {6}, {8}, {9}, {2}, {5}, {8}, {11}, {
       3}, {6}, {8}, {9}, {4}, {5}, {7}, {10}, {4}, {5}, {8}, {9}, {
       5}, {6}, {7}, {8}, {2}, {5}, {8}, {9}, {4}, {5}, {6}, {9}, {
       4}, {5}, {7}, {8}, {3}, {5}, {6}, {9}, {4}, {5}, {6}, {8}, {
       1}, {4}, {7}, {10}, {2}, {5}, {6}, {9}, {2}, {5}, {7}, {8}, {
       3}, {5}, {6}, {8}, {4}, {5}, {6}, {7}, {2}, {5}, {6}, {8}, {
       1}, {4}, {7}, {8}, {2}, {3}, {6}, {9}, {2}, {4}, {5}, {8}, {
       1}, {4}, {5}, {8}, {2}, {3}, {5}, {8}, {2}, {4}, {5}, {7}, {
       3}, {4}, {5}, {6}, {1}, {4}, {5}, {7}, {2}, {4}, {5}, {6}, {
       1}, {2}, {5}, {8}, {1}, {4}, {5}, {6}, {2}, {3}, {5}, {6}, {
       1}, {2}, {4}, {7}, {1}, {2}, {5}, {6}, {2}, {3}, {4}, {5}, {
       1}, {2}, {3}, {6}, {1}, {2}, {4}, {5}, {1}, {2}, {3}, {5}, {
       1}, {2}, {3}, {4}}}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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cTpOJ3P0
oG9R05f0DYzZyDs+Gm4Bd7qTHnvJ1Td+jolHnx9reOhRmfAJNzrkSq7e0fhW
OVw5Vp+cycPkyUdtMhuLdAxfG0sbR7fHS77T6YaH7mAXpuCDRt5y7qD/AFjI
EXE=
"]}, CompressedData["
1:eJxTTMoPSmJkYGA4AiQYR8GQBwDtgQQx
"]}], SparseArray[Automatic, {161, 20}, 0, {1, {CompressedData["
1:eJwl0hFzAgAABeC2C4IgCIKg3QVBEARBEARB0O2CIOh2QdBtQRAEQRAEwWAQ
dLtgMAiCIBgMBkEQBMFgEAyCwSDY1+3dfT/gvXs3dw+391eBQOA58J8gIcJE
iBIjToIkKdJkyJIjT4EiJcpUqFKjToMmLdp06NKjz4AhI8ZMeOSJKTPmvPDK
giUr1rzxzgcbtuzYc+CTL458c+KHX86X8oYIEiJMhCgx4iRIkiJNhiw58hQo
UqJMhSo16jRo0qJNhy49+gwYMmLMhEeemDJjzguvLFiyYs0b73ywYcuOPQc+
+eLINyd++OV8OcG1/oQIEyFKjDgJkqRIkyFLjjwFipQoU6FKjToNmrRo06FL
jz4DhvwBPY9Kng==
"], CompressedData["
1:eJwlj9d5wzAMhMUmAiygihfwShnBC2SJDJ4f1gN1hyv4oPfn9+cTt2374xPA
87pfi2e8yTsQbDGDkzccjZlQQ58EJ6HBU/TufHpm4Z0XeCuZMb/8auiCryD8
7sPzhn+caKBdQrazEH4qXiUjoLb1Ysab3lny8LOS1WZ3Q2M+BJ/cKuR3DqrM
wnHopzwZq86VHEeozxyCb5ncDq8ciXaQM7pLWY5+FPJVhndNWERmJrL01s6h
u2vinbaExSA76dZ+0PN5FrxIlh5eW8z43lOrLEUDlb1j0hvwkfECP0MPXS3z
c2j44r2WHj4i+VzUChpzT/jkGl08mYlD0UZ6fI3OMxmOyD5zCL4GMHIgcyej
9FouX73HVL2jiQX4EjgqOE+eKy2xCNQQd8869wx+1kgJZP5iDZTAAjrfefkf
0A8cmg==
"]}, CompressedData["
1:eJxTTMoPSm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z9Dy9mAwGBkPu
dde7jT2ugCztefbAcv9nYSrD
"]}, CompressedData["
1:eJxTTMoPSmJkYGBwYWZgYBwFo2AUUAQAuqkFMw==
"]}], SparseArray[Automatic, {257, 28}, 0, {1, {CompressedData["
1:eJwl0xGQIgAUBuDudiEIgoUg6GaCIAiChSAIgqC5CYKguQmC5i5YWAiCIAiC
IAiCIFhYCIIgCIIgCIIgCIIgCILgvr17M9/z/5/3fvz68/P3t0Ag8P1rmWeC
hAjzQoQoMeIkSJIizSsZsuTIU6BIiTIVqtSo06DJG++0aNOhS48+A4aMGDNh
ygefzJizYMmKNRu27Nhz4MiJMxeu3Ljz+Aqvg2eChAjzQoQoMeIkSJIizSsZ
suTIU6BIiTIVqtSo06DJG++0aNOhS48+A4aMGDNhygefzJizYMmKNRu27Nhz
4MiJMxeu3Ljz+HcE8hMkRJgXIkSJESdBkhRpXsmQJUeeAkVKlKlQpUadBk3e
eKdFmw5devQZMGTEmAlTPvhkxpwFS1as2bBlx54DR06cuXDlxp0HgSf5CRIi
zAsRosSIkyBJijSvZMiSI0+BIiXKVKhSo06DJm+806JNhy49+gwYMmLMhCkf
fDJjzoIlK9Zs2LJjz4EjJ85cuHLjzuPp//M/8xdv+IFD
"], CompressedData["
1:eJwl0Et24zAMRFHrb4nUl5KT2Jn0lnoJ2UD2P+sL94AHRBH1APDPz+/fn/p2
u7Xt7VaJX8/X9+V8upxicU73D0IRj9Av+unQTsUPj4f7HjVMi/eD8aAX5l2c
1W9RV6Lm4r9es9odcAc4StRez809867ifkT9+VrUi8/MO7vLX5tm+xG+E/t6
JZxtD095zjziV+LP7vLnqvmmET08F/05YczL9b1quhkk84qfE05yl3vXXz09
vGcKTT7iZUvhXKthEr/4MeCNeJOcpsY8fN4eGGUKTX63YLIo3qnHNWH0eKPo
7s08Fss88/L2H2PowbAsTsE+R4t1OAPG3V3+mJJ5DJZ4sub30Nzxr9HSOAc+
/3I5Z4vXB2vaPrDLpFnK4V0K3o5/3i2Ms2PzzufA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R/np/fp5+rvbVWqyHwqq2WLO1Xj8/d8VFfbaW1V0Ppm/8/twczs4n
awZYPB68Sd/89e7dn9xZ1utPsk+gM5j803s/7mfvCTx6nwBnktGeSCZw+Tti
DRiX/fzVi+WfRBzmzXP9TBoYiROh+BUweyzxM9rFzr/vr920+dZ30tBFEyOx
+NnhRZx+0C95EMvdud1x1jZtvuXVD+tnwBk12e/7o8UOeNFHx7127+RqepqX
hkf+jD0+1kWzJ564x/eGo8MLBhH22q2Vqz34Nt58NgC1R4g8mDUX/sJ57TXU
YnYG0n196SG/822sSX7vAj5OxYE7c61RMyf8xiBag2m/nvEuv/Fsjqv81nbY
ONFwSg7siWsJGlFba57GgJr9zsK1edRwNRA0WeDjJp6504jaUnGcMM8GdN7v
zbVcbeWcuPQwrOfmcus0nG8OTbaakc8lT40tniq7eOHcOAOfHvql1Wi28TXX
aEY+FdgVXu1PkKdSLJ95RqyehzvO9alfT1iNpo/+gHqPU85R4lYGVO21sZCr
6S1EviSfqpoD76zpat/HjKPAKw2o3GuXXK6W+DZW4BrVUllx4OFGrqHWTI5V
GEzx9bRJPvJsnE4+FiU2Bl7g6CsNZD4+N5D8y25G+QU7ii95gedtZRhYHXYs
SeV9ZhDZfhZxQ5bjEJWawWgxQ0Emj0cffdzPAmZ3zM6XQgMYXU4gdrfqMLY7
p5zImzYDFLtTtt407tQZsOWs2M6qI4jVWGe10l78B215URQ=
"]}, CompressedData["
1:eJxTTMoPSmJkYGA4wsLAwDgKRsEoGAVDGAAAEWQHNA==
"]}], SparseArray[Automatic, {353, 36}, 0, {1, {CompressedData["
1:eJwl1CGwKQgUBuC7++7OCIIgCIKdEQRBEARBEATB7AiCYN4IgnlPEARBEARB
EARBEARBEARBEIQbbrhBEARBEARBEN53Z8/Md/p/zpzz78/f//366+3t7ed3
U+8ECBIiTIQoMeIkSJIiTYYsOfIUKFKiTIUqNeo0aNKiTYcuPfoMGDJizIQp
M+YsWLJizYYtO/Yc+OCTL46cOHPhyo07D568vsObwT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Q8T/i1M+OzAZmY4
zgtZOJod2BU90YceLhmK7kc8Gziw+X6TmOPEPxG2Wwgp+AD8LXeR3nfwptnm
GT/45d4N+MNbr/zTyMAOdEQLI8uEuS58ACyDDle6FvY48S34Mu89DLiWHOxA
BWY/sESY9sZHwNDonn5vYA6jjiN+5CCD2Dr84Rn4e0vP7HoWCc+QYZ3mylFt
1VUY8INvW7xh6YZKv3csD46GbUfC4S2bqkvf8x6uaVgM/upKpd9aFoevgmeG
sfjO7GHZqLbthOvwgFl00xY/FoSnhKX7oXhOlmOadtlbgLCKpvEWVxaCl4Ch
ur74jIajr80Nbp0VfrLtyruB3NNMRauz5L1oMG2B8duJilZn9I4Mw0gt/XLF
CH2glv6G1lO7/yxFaD0=
"]}, CompressedData["
1:eJxTTMoPSmJkYGBoYWVgYBwFo2AUjIJRMGAAAGSHB7U=
"]}]}},
 Length[ResourceFunction["FindExactCover"][Normal[#], All]
    ] & /@ tetrisData[[1 ;; 5]]]
Out[16]=

Compute the first few terms of the N Queens sequence (cf. OEIS A000170):

In[17]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/b2550ade-d752-44cd-b82c-081805b83d47"]
Out[17]=

Publisher

Brad Klee

Version History

  • 1.0.0 – 18 November 2022

Source Metadata

Related Resources

License Information