|
| 1 | +\chapter{骨牌问题 (Tiling Problem)} |
| 2 | + |
| 3 | +\begin{introduction} |
| 4 | + \item 定义 |
| 5 | + \item 形状为$2\times1$的骨牌 |
| 6 | +\end{introduction} |
| 7 | + |
| 8 | +\section{问题定义}\label{sec:tiling-1} |
| 9 | +\begin{definition}{骨牌问题}{def:tiling-problem} |
| 10 | + 给出大小确定数量不限的骨牌,问能否不重叠的铺满整个平面 |
| 11 | +\end{definition} |
| 12 | + |
| 13 | +\section{骨牌形状为\texorpdfstring{$2\times1$}{}}\label{sec:tiling-2} |
| 14 | +骨牌形状为$2\times1$(如\autoref{fig:tiling-1}),判断使用该种骨牌能不能不重叠的铺满给定的平面。 |
| 15 | +形状为$2\times1$的骨牌的填充问题属于$P$类问题。 |
| 16 | +下面是一些用这种骨牌填充的例题。 |
| 17 | +\begin{figure}[hbt!] |
| 18 | + \centering |
| 19 | + \begin{tabular}{|c|} |
| 20 | + \hline |
| 21 | + \\ \hline |
| 22 | + \\ \hline |
| 23 | + \end{tabular} |
| 24 | + \caption{形状为$2\times1$的骨牌} |
| 25 | + \label{fig:tiling-1} |
| 26 | +\end{figure} |
| 27 | +\subsection{形状为\texorpdfstring{$M\times N$}{}的矩形}\label{subsec:tiling-2-1} |
| 28 | +这种完整的矩形(如\autoref{fig:tiling-2})是简单问题。只需要判断形状中的格子数目($M\times N$)是否为偶数。 |
| 29 | +如果格子的数目为偶数,则能填满。 |
| 30 | +如果格子的数目为奇数则不能填满。 |
| 31 | +\begin{figure}[hbt!] |
| 32 | + \centering |
| 33 | + \begin{tabular}{|c|c|c|c@{\dots}c|c|c|c|} |
| 34 | + \cline{1-3} \cline{6-8} |
| 35 | + & & & & & & & \\ |
| 36 | + \cline{1-3} \cline{6-8} |
| 37 | + & & & & & & & \\ |
| 38 | + \cline{1-3} \cline{6-8} |
| 39 | + \multicolumn{3}{c}{} & & \multicolumn{3}{c}{} \\ |
| 40 | + \cline{1-3} \cline{6-8} |
| 41 | + & & & & & & & \\ |
| 42 | + \cline{1-3} \cline{6-8} |
| 43 | + & & & & & & & \\ |
| 44 | + \cline{1-3} \cline{6-8} |
| 45 | + \end{tabular} |
| 46 | + \caption{$M\times N$的矩形}\label{fig:tiling-2} |
| 47 | +\end{figure} |
| 48 | + |
| 49 | + |
| 50 | +如果格子的数目为奇数,显然不能使用$2\times1$的骨牌铺满。而当格子的数目为偶数时,则行或列中必有一个为偶数。显然能用这种骨牌填满。 |
| 51 | +\subsection{形状为$6\times6$的矩形挖去两个对角}\label{subsec:tiling-2-2} |
| 52 | +\begin{figure}[ht!] |
| 53 | + \begin{subfigure}{0.5\textwidth} |
| 54 | + \centering |
| 55 | + \begin{tabular}{|c|c|c|c|c|c|} |
| 56 | + \cline{2-6} |
| 57 | + \multicolumn{1}{c|}{} & & & & & \\ \hline |
| 58 | + & & & & & \\ \hline |
| 59 | + & & & & & \\ \hline |
| 60 | + & & & & & \\ \hline |
| 61 | + & & & & & \\ \hline |
| 62 | + & & & & & \multicolumn{1}{c}{} \\ |
| 63 | + \cline{1-5} |
| 64 | + \end{tabular} |
| 65 | + \caption{挖去两个对角的$6\times6$的矩形}\label{fig:tiling-3} |
| 66 | + \end{subfigure} |
| 67 | + \begin{subfigure}{0.5\textwidth} |
| 68 | + \centering |
| 69 | + \begin{tabular}{|c|c|c|c|c|c|} |
| 70 | + \cline{2-6} |
| 71 | + \multicolumn{1}{c|}{} & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} \\ \hline |
| 72 | + \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & \\ \hline |
| 73 | + & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} \\ \hline |
| 74 | + \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & \\ \hline |
| 75 | + & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} \\ \hline |
| 76 | + \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & \multicolumn{1}{c}{} \\ |
| 77 | + \cline{1-5} |
| 78 | + \end{tabular} |
| 79 | + \caption{染色后的矩形}\label{fig:tiling-4} |
| 80 | + \end{subfigure} |
| 81 | + \caption{} |
| 82 | +\end{figure} |
| 83 | +这种情况下(如\autoref{fig:tiling-3}),格子的总数为34个,是个偶数。所以可以尝试通过对格子进行染色的方式判断。选取其中一个格子染成和黑色, |
| 84 | +对黑色上下左右相邻的格子染成白色,对白色上下左右相邻的格子染成黑色(结果如\autoref{fig:tiling-4})。染色是判断能否被填充的一个方法。 |
| 85 | +这种方法得到的不可填充的结论是可信的,但可填充的结论却不一定可信。 |
| 86 | + |
| 87 | +统计黑色和白色格子的数目,黑色有18个,白色有16个。而将骨牌染成黑白两色,发现需要被填充的形状中黑色和白色的个数不同。所以这种形状无法被$2\times1$的骨牌填充。 |
| 88 | +\subsection{一个奇异的形状}\label{subsec:tiling-2-3} |
| 89 | +\begin{figure}[h!] |
| 90 | + \begin{subfigure}{0.5\textwidth} |
| 91 | + \centering |
| 92 | + \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|} |
| 93 | + \cline{2-4} \cline{7-9} |
| 94 | + \multicolumn{1}{c|}{} & & & & \multicolumn{1}{c}{} & \multicolumn{1}{c|}{} & & & & \multicolumn{1}{c}{} \\ \hline |
| 95 | + & & & & & & & & & \\ \hline |
| 96 | + & & & & & & & & & \\ \hline |
| 97 | + & & & & & & & & & \\ \hline |
| 98 | + \multicolumn{1}{c|}{} & & & & \multicolumn{1}{c}{} & \multicolumn{1}{c|}{} & & & & \multicolumn{1}{c}{} \\ |
| 99 | + \cline{2-4} \cline{7-9} |
| 100 | + \end{tabular} |
| 101 | + \caption{一个例子}\label{fig:tiling-5} |
| 102 | + \end{subfigure} |
| 103 | + \begin{subfigure}{0.5\textwidth} |
| 104 | + \centering |
| 105 | + \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|} |
| 106 | + \multicolumn{5}{c!{\color[rgb]{1,0,0}\vline}}{} & \multicolumn{5}{c}{} \\ |
| 107 | + \cline{2-4} \cline{7-9} |
| 108 | + \multicolumn{1}{c|}{} & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & \multicolumn{1}{c!{\color[rgb]{1,0,0}\vline}}{} & \multicolumn{1}{c|}{} & & \cellcolor[rgb]{0,0,0} & & \multicolumn{1}{c}{} \\ \hline |
| 109 | + \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & & \multicolumn{1}{c!{\color[rgb]{1,0,0}\vline}}{\cellcolor[rgb]{0,0,0}} & & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & \\ \hline |
| 110 | + & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & \multicolumn{1}{c!{\color[rgb]{1,0,0}\vline}}{} & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} \\ \hline |
| 111 | + \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & & \multicolumn{1}{c!{\color[rgb]{1,0,0}\vline}}{\cellcolor[rgb]{0,0,0}} & & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & \\ \hline |
| 112 | + \multicolumn{1}{c|}{} & \cellcolor[rgb]{0,0,0} & & \cellcolor[rgb]{0,0,0} & \multicolumn{1}{c!{\color[rgb]{1,0,0}\vline}}{} & \multicolumn{1}{c|}{} & & \cellcolor[rgb]{0,0,0} & & \multicolumn{1}{c}{} \\ |
| 113 | + \cline{2-4} \cline{7-9} |
| 114 | + \multicolumn{5}{c!{\color[rgb]{1,0,0}\vline}}{} & \multicolumn{5}{c}{} |
| 115 | + \end{tabular} |
| 116 | + \caption{染色后}\label{fig:tiling-6} |
| 117 | + \end{subfigure} |
| 118 | +\end{figure} |
| 119 | +在这种情况下(如\autoref{fig:tiling-5}),使用上述方式染色后(如\autoref{fig:tiling-6})发现黑色与白色的块数相同,均为21块。但这个图形却是不可被填充的。 |
| 120 | + |
| 121 | +现假设骨牌能填充这个形状,那么红线左侧和红线右侧都应该是可以被填充满的。但红线左侧的黑色方块比白色方块多4个,需要从右面借4个白色方块才能使左红线侧的褐色方块与白色方块数目相同。 |
| 122 | +但红线右侧在不借出黑色方块的情况下最多借出2个白色方块,不满足需求。因此左边是不可能被填满的。所以整个平面也是不可被填满的。 |
| 123 | + |
| 124 | +这个问题还可以用网络流来求解。详见\autoref{sec:network-flows-tiling}。 |
0 commit comments