Polyomino

Author

Eric W. Weisstein
January 29, 2022

This notebook downloaded from http://mathworld.wolfram.com/notebooks/RecreationalMath/Polyomino.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Polyomino.html.

©2022 Wolfram Research, Inc. except for portions noted otherwise

Sources

Mondragon

I think it's from TMJ, Vol 9., No 3, which seems to no longer be online: https://www.mathematica-journal.com/back-issues

StackExchange

https://mathematica.stackexchange.com/questions/17416/is-there-an-easy-way-to-specify-an-arbitrary-two-dimensional-polyomino-tiling-in

Twardos

Haven't looked at it but another implementation might be:

https://demonstrations.wolfram.com/OneSidedPolyominoes/

Counts

Free

Do[Print[{n,Length[Polyominoes[n]]//Timing}],{n,11}]

Table

Timing[polys=Table[{n,Sequence@@Length/@(Polyominoes[n,Type->#]&/@{Free,OneSided,Fixed})},{n,9}]]

TableForm[polys,TableAlignments->Right
]

Graphs

Sort[{"Polyomino"/.GraphData[#,"NotationRules"],#}&/@GraphData["Polyomino"]]

polyominographs=SplitBy[DeleteCases[%,{_Missing,_}],#[[1,1]]&]

GraphicsGrid[Flatten[Partition[#,UpTo[6]]&/@Map[Show[GraphData[#]//StyleGraphs[#,VertexSize->{"Scaled",.1}]&,PlotLabel->Style[GraphData[#,"Name"],Directive[Italic,FontFamily->"Times"]]]&,polyominographs[[All,All,2]],{2}],1],Dividers->All,ImageSize->700]

Examples

PolyominoPlot[PolyominoArray[Polyominoes/@Range[5]]]

PolyominoPlot[PolyominoArray[Append[Polyominoes/@Range[4],Pentominoes]]]

GraphData["Polyomino"]

GraphicsGrid[Partition[Show[GraphData[#],PlotLabel->TextCell[GraphData[#,"Name"],PageWidth->70,TextAlignment->Center]]&/@GraphData["Polyomino"],5,5,{1,1},{}],ImageSize->500]

Domino

Polyominoes[2]

PolyominoPlot[PolyominoArray[Polyominoes[2]]]

Triominoes

Polyominoes[3]

PolyominoPlot[PolyominoArray[Polyominoes[3]]]

Tetrominoes

Polyominoes[4]

PolyominoPlot[PolyominoArray[Polyominoes[4]]]

Pentomineos

PolyominoPlot[PolyominoArray[Pentominoes]]

PolyominoPlot[PolyominoArray[Polyominoes[5]]]

Hexominoes

PolyominoPlot[PolyominoArray[Polyominoes[6],10]]

MatrixPlot[PolyominoesArray[Polyominoes[6],10],AspectRatio->Automatic,Frame->None]

Holes

PolyominoPlot[PolyominoArray[Polyominoes[7],10],ImageSize->500]

PolyominoPlot[PolyominoArray[{Polyominoes[7][[56]]}]]

PolyominoOutlineGraph[Polyominoes[7][[56]]]//ShowGraph

Graphs

ShowGraphArray[Map[PolyominoGraph,Polyominoes/@Range[5],{2}]]

Map[RecognizeGraph[PolyominoGraph[#]]&,Polyominoes/@Range[6],{2}]//ColumnForm

Partition[{1},10,10,{1,1},1]

PolyominoPlot[PolyominoArray[Polyominoes/@Range[5]]]

ShowGraphArray[Map[PolyominoOutlineGraph,Polyominoes/@Range[5],{2}]]

Map[RecognizeGraph[PolyominoOutlineGraph[#]]&,Polyominoes/@Range[6],{2}]//ColumnForm

Table[Select[FastIsomorphicSets[PolyominoOutlineGraph/@Polyominoes[n]],Length[#]>1&],{n,8}]

Length[Polyominoes[8]]

GraphData

GraphDataString

Do[Print[
GraphDataString[
PolyominoOutlineGraph[Polyominoes[n][[k]]],
"Name"->ToString[n]<>"-polyomino graph "<>ToString[k],
"StandardName"->{"Polyomino",{n,k}},
"Classes"->{"Polyomino"},
"NotationRules"->{"Polyomino"->{n,k}},
TimeConstraint->60,
Debug->True
]],{n,4},{k,Length[Polyominoes[n]]}]

pent={"f","I","L","N","P","T","U","V","W","X","Y","Z"};

Do[Print[
GraphDataString[
PolyominoOutlineGraph[Pentominoes[[k]]],
"Name"->ToString[n]<>"-polyomino graph "<>ToString[k],
"StandardName"->{"Polyomino",{n,k}},
"AlternateStandardNames"->{"Pentomino"<>ToString[ToUpperCase[pent[[k]]]]},
"Classes"->{"Polyomino"},
"NotationRules"->{"Polyomino"->{n,k}},
TimeConstraint->60,
Debug->True
]],{n,5,5},{k,Length[Polyominoes[n]]}]