2025,1126,0200

This commit is contained in:
starcells committed 2025-11-26 01:59:47 +08:00
1 parent ad86f4f403
commit 5e01ac46db
7 files changed
+45 -23

No files matched your search

BIN
View File
Binary file not shown.
+27 -5
View File
@@ -2,16 +2,38 @@
## 引言
对于排列组合中的区域上色问题,在中学阶段少有系统、规范的讨论方法。日常教学时老师会提到“将相同颜色的色块进行分组”,但实际操作过程中也常有遗漏,算了数分钟却发现ABCD都无法匹配的现象可谓屡见不鲜。本文将基于图论中的独立集,提出一种具有普遍性的统计方式并探讨可能的优化方向。
对于排列组合中的区域上色问题,在中学阶段少有系统、规范的讨论方法。日常教学时老师会提到“将相同颜色的色块进行分组”,但实际操作过程中也常有遗漏,算了数分钟却发现ABCD都无法匹配的现象可谓屡见不鲜。本文将基于图论中的独立集,提出一种具有普遍性的统计方式,并探讨可能的优化方向。
例题:
### 例题
提供四种不同颜色的颜料给图中六个区域涂色,要求每个区域涂一种颜色,有公共边的两个区域不能涂相同的颜色,则不同的涂色方法共有()种。
<img src="./svgs/C0.svg" alt="题目" width="400">
对于图C1:
#### 常规思路
首先,D、E、F三个区域有$A_4^3 = 144$种涂法。\
当B、F区域同色时,有$A_4^3*2*3 = 144$种涂法。\
当B、D、F均不同色时,有$A_4^3 = 96$种涂法。\
故总方案数为$144 + 144 + 96 = 384$种涂法。
这是在基于观察对区域进行分类,在面对复杂的图像时难免会存在遗漏。
#### 基于独立集的思路
可将A~F抽象为图中的节点,用边连接具有公共边的色块对应的节点,形成图C1:
<img src="./svgs/C1.svg" alt="C1" width="400">
考虑其独立集C2:
考虑其独立集[^1] C2:
<img src="./svgs/C2.svg" alt="C2" width="400">
<img src="./svgs/C2.svg" alt="C2" width="400">
此时,C2中的边所连接的节点对应的,就是“一对不具有公共边的色块”,也就是一对可以被涂上同种颜色的色块。\
那么,C2中的任意团[^2]都对应着“一些可以被涂上同种颜色的色块”。
如果能将图分解为不同的
由于对任意节点,其参与形成的不同的团
[^1]: 独立集:一个图中两两不相邻的顶点所形成的集合,见《图论导论》。
[^2]: 团:图的“任意两个顶点在图中相邻”的子集,见《图论导论》。
+1 -1
View File
@@ -14,7 +14,7 @@ graph CA {
edge [
color="gray",
penwidth=2.5,
penwidth=5.5,
len=1;
];
A -- B,D;
+1 -1
View File
@@ -14,7 +14,7 @@ graph C2{
edge [
color="gray",
penwidth=2.5,
penwidth=5.5,
len=1;
];
A -- C,E,F;
+1 -1
View File
@@ -1 +1 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="285" height="321"><defs><clipPath id="bLMtfasbAyVM"><path fill="none" stroke="none" d=" M 0 0 L 285 0 L 285 321 L 0 321 L 0 0 Z"/></clipPath></defs><g transform="scale(1,1)" clip-path="url(#bLMtfasbAyVM)"><g><rect fill="rgb(255,255,255)" stroke="none" x="0" y="0" width="285" height="321" fill-opacity="1"/><path fill="rgb(0,0,255)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 47.15375291707123 51.58696987832596 L 47.15375291707123 151.76733327869067 L 147.33411631743584 51.58696987832596 Z" fill-opacity="0.2"/><text fill="rgb(0,0,255)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="80" y="84" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">A</text><text fill="none" stroke="rgb(255,255,255)" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="80" y="84" text-anchor="start" dominant-baseline="alphabetic" stroke-opacity="1" stroke-linejoin="bevel" stroke-miterlimit="10" stroke-width="3">A</text><text fill="rgb(0,0,255)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="80" y="84" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">A</text><path fill="rgb(0,0,255)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 147.33411631743584 51.58696987832596 L 247.51447971780044 51.58696987832596 L 247.51447971780044 151.76733327869067 Z" fill-opacity="0.2"/><text fill="rgb(0,0,255)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="214" y="84" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">C</text><text fill="none" stroke="rgb(255,255,255)" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="214" y="84" text-anchor="start" dominant-baseline="alphabetic" stroke-opacity="1" stroke-linejoin="bevel" stroke-miterlimit="10" stroke-width="3">C</text><text fill="rgb(0,0,255)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="214" y="84" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">C</text><path fill="rgb(0,0,255)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 97.24393461725353 101.67715157850833 L 147.33411631743584 51.58696987832596 L 197.42429801761816 101.67715157850833 Z" fill-opacity="0.2"/><text fill="rgb(0,0,255)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="147" y="84" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">B</text><text fill="none" stroke="rgb(255,255,255)" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="147" y="84" text-anchor="start" dominant-baseline="alphabetic" stroke-opacity="1" stroke-linejoin="bevel" stroke-miterlimit="10" stroke-width="3">B</text><text fill="rgb(0,0,255)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="147" y="84" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">B</text><path fill="rgb(0,0,255)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 97.24393461725353 101.67715157850833 L 147.33411631743584 151.76733327869067 L 197.42429801761816 101.67715157850833 Z" fill-opacity="0.2"/><text fill="rgb(0,0,255)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="147" y="118" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">E</text><text fill="none" stroke="rgb(255,255,255)" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="147" y="118" text-anchor="start" dominant-baseline="alphabetic" stroke-opacity="1" stroke-linejoin="bevel" stroke-miterlimit="10" stroke-width="3">E</text><text fill="rgb(0,0,255)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="147" y="118" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">E</text><path fill="rgb(0,0,255)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 97.24393461725353 101.67715157850833 L 147.33411631743584 151.76733327869067 L 147.33411631743584 302.0378783792378 L 47.153752917071Line truncated
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="349" height="402"><defs><clipPath id="qGshPSKpuznw"><path fill="none" stroke="none" d=" M 0 0 L 349 0 L 349 402 L 0 402 L 0 0 Z"/></clipPath></defs><g transform="scale(1,1)" clip-path="url(#qGshPSKpuznw)"><g><rect fill="rgb(255,255,255)" stroke="none" x="0" y="0" width="349" height="402" fill-opacity="1"/><path fill="rgb(102,102,102)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 29.07470050178071 17.239720536349637 L 29.07470050178071 163.26106038208806 L 175.09604034751882 17.239720536349637 Z" fill-opacity="0.2"/><text fill="rgb(102,102,102)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="77" y="65" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">A</text><text fill="none" stroke="rgb(255,255,255)" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="77" y="65" text-anchor="start" dominant-baseline="alphabetic" stroke-opacity="1" stroke-linejoin="bevel" stroke-miterlimit="10" stroke-width="3">A</text><text fill="rgb(102,102,102)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="77" y="65" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">A</text><path fill="rgb(102,102,102)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 175.09604034751882 17.239720536349637 L 321.11738019325696 17.239720536349637 L 321.11738019325696 163.26106038208806 Z" fill-opacity="0.2"/><text fill="rgb(102,102,102)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="272" y="65" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">C</text><text fill="none" stroke="rgb(255,255,255)" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="272" y="65" text-anchor="start" dominant-baseline="alphabetic" stroke-opacity="1" stroke-linejoin="bevel" stroke-miterlimit="10" stroke-width="3">C</text><text fill="rgb(102,102,102)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="272" y="65" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">C</text><path fill="rgb(102,102,102)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 102.08537042464977 90.25039045921886 L 175.09604034751882 17.239720536349637 L 248.10671027038788 90.25039045921886 Z" fill-opacity="0.2"/><text fill="rgb(102,102,102)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="175" y="65" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">B</text><text fill="none" stroke="rgb(255,255,255)" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="175" y="65" text-anchor="start" dominant-baseline="alphabetic" stroke-opacity="1" stroke-linejoin="bevel" stroke-miterlimit="10" stroke-width="3">B</text><text fill="rgb(102,102,102)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="175" y="65" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">B</text><path fill="rgb(102,102,102)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 102.08537042464977 90.25039045921886 L 175.09604034751882 235.01316040246078 L 248.10671027038788 90.25039045921886 Z" fill-opacity="0.2"/><text fill="rgb(102,102,102)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="175" y="138" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">E</text><text fill="none" stroke="rgb(255,255,255)" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="175" y="138" text-anchor="start" dominant-baseline="alphabetic" stroke-opacity="1" stroke-linejoin="bevel" stroke-miterlimit="10" stroke-width="3">E</text><text fill="rgb(102,102,102)" stroke="none" font-family="geogebra-sans-serif, sans-serif" font-size="16px" font-style="normal" font-weight="normal" text-decoration="normal" x="175" y="138" text-anchor="start" dominant-baseline="alphabetic" fill-opacity="1">E</text><path fill="rgb(102,102,102)" stroke="none" paint-order="stroke fill markers" fill-rule="evenodd" d=" M 102.08537042464977 90.25039045921886 L 175.09604034751882 235.01316040246078 LLine truncated

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

+8 -8
View File
@@ -24,7 +24,7 @@
<!-- A&#45;&#45;B -->
<g id="edge1" class="edge">
<title>A&#45;&#45;B</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M108.24,-25.89C116.87,-36.81 129.78,-53.15 138.4,-64.05"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M108.24,-25.89C116.87,-36.81 129.78,-53.15 138.4,-64.05"/>
</g>
<!-- D -->
<g id="node3" class="node">
@@ -35,7 +35,7 @@
<!-- A&#45;&#45;D -->
<g id="edge2" class="edge">
<title>A&#45;&#45;D</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M87.74,-23.57C76.89,-32.29 60.65,-45.33 49.82,-54.03"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M87.74,-23.57C76.89,-32.29 60.65,-45.33 49.82,-54.03"/>
</g>
<!-- C -->
<g id="node4" class="node">
@@ -46,7 +46,7 @@
<!-- B&#45;&#45;C -->
<g id="edge3" class="edge">
<title>B&#45;&#45;C</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M149.17,-90.27C150.59,-102.51 152.61,-119.81 154.04,-132.05"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M149.17,-90.27C150.59,-102.51 152.61,-119.81 154.04,-132.05"/>
</g>
<!-- E -->
<g id="node5" class="node">
@@ -57,12 +57,12 @@
<!-- B&#45;&#45;E -->
<g id="edge4" class="edge">
<title>B&#45;&#45;E</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M136.02,-84.72C125.16,-93.5 108.91,-106.62 98.07,-115.38"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M136.02,-84.72C125.16,-93.5 108.91,-106.62 98.07,-115.38"/>
</g>
<!-- D&#45;&#45;E -->
<g id="edge6" class="edge">
<title>D&#45;&#45;E</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M47.52,-74.71C56.15,-85.69 69.05,-102.11 77.66,-113.07"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M47.52,-74.71C56.15,-85.69 69.05,-102.11 77.66,-113.07"/>
</g>
<!-- F -->
<g id="node6" class="node">
@@ -73,17 +73,17 @@
<!-- D&#45;&#45;F -->
<g id="edge7" class="edge">
<title>D&#45;&#45;F</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M33.47,-77.17C29.34,-88.78 23.5,-105.2 19.38,-116.8"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M33.47,-77.17C29.34,-88.78 23.5,-105.2 19.38,-116.8"/>
</g>
<!-- C&#45;&#45;E -->
<g id="edge5" class="edge">
<title>C&#45;&#45;E</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M141.78,-142.3C129.8,-138.45 112.63,-132.92 100.65,-129.07"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M141.78,-142.3C129.8,-138.45 112.63,-132.92 100.65,-129.07"/>
</g>
<!-- E&#45;&#45;F -->
<g id="edge8" class="edge">
<title>E&#45;&#45;F</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M72.06,-125.83C59.52,-126.91 41.54,-128.46 29.01,-129.54"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M72.06,-125.83C59.52,-126.91 41.54,-128.46 29.01,-129.54"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

+7 -7
View File
@@ -24,7 +24,7 @@
<!-- A&#45;&#45;C -->
<g id="edge1" class="edge">
<title>A&#45;&#45;C</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M28.18,-80.11C41.28,-75.21 60.86,-67.87 73.94,-62.97"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M28.18,-80.11C41.28,-75.21 60.86,-67.87 73.94,-62.97"/>
</g>
<!-- E -->
<g id="node3" class="node">
@@ -35,7 +35,7 @@
<!-- A&#45;&#45;E -->
<g id="edge2" class="edge">
<title>A&#45;&#45;E</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M17.48,-70.93C20.13,-58.63 23.92,-41.01 26.56,-28.72"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M17.48,-70.93C20.13,-58.63 23.92,-41.01 26.56,-28.72"/>
</g>
<!-- F -->
<g id="node4" class="node">
@@ -46,12 +46,12 @@
<!-- A&#45;&#45;F -->
<g id="edge3" class="edge">
<title>A&#45;&#45;F</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M15.3,-100.01C16.15,-114.02 17.43,-134.98 18.29,-148.97"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M15.3,-100.01C16.15,-114.02 17.43,-134.98 18.29,-148.97"/>
</g>
<!-- C&#45;&#45;E -->
<g id="edge7" class="edge">
<title>C&#45;&#45;E</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M75.92,-49.04C65.85,-41.51 51.42,-30.71 41.36,-23.18"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M75.92,-49.04C65.85,-41.51 51.42,-30.71 41.36,-23.18"/>
</g>
<!-- D -->
<g id="node6" class="node">
@@ -62,7 +62,7 @@
<!-- C&#45;&#45;D -->
<g id="edge6" class="edge">
<title>C&#45;&#45;D</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M96.66,-69.54C105.21,-80.67 118,-97.3 126.54,-108.41"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M96.66,-69.54C105.21,-80.67 118,-97.3 126.54,-108.41"/>
</g>
<!-- B -->
<g id="node5" class="node">
@@ -73,12 +73,12 @@
<!-- B&#45;&#45;F -->
<g id="edge5" class="edge">
<title>B&#45;&#45;F</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M80.98,-184.02C67.41,-179.55 46.86,-172.77 33.23,-168.27"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M80.98,-184.02C67.41,-179.55 46.86,-172.77 33.23,-168.27"/>
</g>
<!-- B&#45;&#45;D -->
<g id="edge4" class="edge">
<title>B&#45;&#45;D</title>
<path fill="none" stroke="gray" stroke-width="2.5" d="M102.31,-176.03C109.65,-163.66 120.78,-144.9 128.09,-132.56"/>
<path fill="none" stroke="gray" stroke-width="5.5" d="M102.31,-176.03C109.65,-163.66 120.78,-144.9 128.09,-132.56"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB