diff --git a/content/posts/maps.md b/content/posts/maps.md index 9d2764a..900d9c7 100644 --- a/content/posts/maps.md +++ b/content/posts/maps.md @@ -17,8 +17,6 @@ summary = '基于独立集的区域涂色方式计数方法' 提供四种不同颜色的颜料给图中六个区域涂色,要求每个区域涂一种颜色,有公共边的两个区域不能涂相同的颜色,则不同的涂色方法共有()种。 -{{
}} - ### 常规思路 @@ -38,11 +36,51 @@ $B,F$ 同色与 $B,D$ 同色相对称,也有 $144$ 种方案。 可将A~F抽象为图中的节点,用边连接具有公共边的色块对应的节点,形成图$C_1$: -{{
}} +```mermaid +graph TD + classDef nodeStyle fill:#d3d3d3, stroke:#333, stroke-width:2px; + linkStyle default stroke:#808080, stroke-width:5.5; + + A((A)):::nodeStyle + B((B)):::nodeStyle + C((C)):::nodeStyle + D((D)):::nodeStyle + E((E)):::nodeStyle + F((F)):::nodeStyle + + A --- B + A --- D; + B --- C + B --- E; + C --- F; + D --- E + D --- F; + E --- F; +``` 将每个节点和与之相连的节点分离,和与之不相连的节点相连(即构建 $C_1$ 的独立集),形成图$C_2$: -{{
}} +```mermaid +graph TD + classDef nodeStyle fill:#d3d3d3, stroke:#333, stroke-width:2px; + linkStyle default stroke:#808080, stroke-width:5.5; + + A((A)):::nodeStyle + B((B)):::nodeStyle + C((C)):::nodeStyle + D((D)):::nodeStyle + E((E)):::nodeStyle + F((F)):::nodeStyle + + A --- C + A --- E + A --- F; + B --- D + B --- F; + C --- D + C --- E; +``` + 此时,$C_2$ 中的边所连接的节点对应的,就是“一对不具有公共边的色块”,也就是一对可以被涂上同种颜色的色块。\ 那么,对于 $C_2$ 中的任意子图,如果其任意两个顶点间都有相邻的边,该子图对应的所有色块都可以被同种颜色涂色。\ @@ -63,7 +101,24 @@ $$N = \sum_{i = 1}^{m}({n_i} \times {A_m^i})$$ 如,$A$ 节点可形成 $\{A\},\{A,C\},\{A,E\},\{A,F\},\{A,C,E\}$几个团。\ 以分割 $\{A\}$ 为例。此时,除$\{A\}$以外的部分形成了一张新的子图 $C_3$: -{{
}} +```mermaid + +graph TD + classDef nodeStyle fill:#d3d3d3, stroke:#333, stroke-width:2px; + linkStyle default stroke:#808080, stroke-width:5.5; + + B((B)):::nodeStyle + C((C)):::nodeStyle + D((D)):::nodeStyle + E((E)):::nodeStyle + F((F)):::nodeStyle + + B --- D + B --- F; + C --- D + C --- E; +``` + 选择 $C_3$ 中的节点分类讨论,最终递归地统计每种分割方案产生的团的数量,即可得到表达式中的 $n_i$。 但在实际计算过程中,这种繁琐的递归不仅效率及其低下,也很容易出错。因此,对其进行优化是有必要的。 diff --git a/static/svgs/C0.svg b/static/svgs/C0.svg deleted file mode 100644 index aa9177f..0000000 --- a/static/svgs/C0.svg +++ /dev/null @@ -1 +0,0 @@ -AAACCCBBBEEEDDDFFF \ No newline at end of file diff --git a/static/svgs/C1.svg b/static/svgs/C1.svg deleted file mode 100644 index b1fbae6..0000000 --- a/static/svgs/C1.svg +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - -CA - - - -A - -A - - - -B - -B - - - -A--B - - - - -D - -D - - - -A--D - - - - -C - -C - - - -B--C - - - - -E - -E - - - -B--E - - - - -D--E - - - - -F - -F - - - -D--F - - - - -C--F - - - - -E--F - - - - diff --git a/static/svgs/C2.svg b/static/svgs/C2.svg deleted file mode 100644 index 9dcb72b..0000000 --- a/static/svgs/C2.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - -C2 - - - -A - -A - - - -C - -C - - - -A--C - - - - -E - -E - - - -A--E - - - - -F - -F - - - -A--F - - - - -C--E - - - - -D - -D - - - -C--D - - - - -B - -B - - - -B--F - - - - -B--D - - - - diff --git a/static/svgs/C3.svg b/static/svgs/C3.svg deleted file mode 100644 index 3c7245d..0000000 --- a/static/svgs/C3.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - -C3_1 - - - -B - -B - - - -D - -D - - - -B--D - - - - -F - -F - - - -B--F - - - - -C - -C - - - -C--D - - - - -E - -E - - - -C--E - - - -