diff --git a/draft.md b/draft.md index 4e0492b..38b713d 100644 --- a/draft.md +++ b/draft.md @@ -4,66 +4,14 @@ 对于排列组合中的区域上色问题,在中学阶段少有系统、规范的讨论方法。日常教学时老师会提到“将相同颜色的色块进行分组”,但实际操作过程中也常有遗漏,算了数分钟却发现ABCD都无法匹配的现象可谓屡见不鲜。本文将基于图论中的独立集,提出一种具有普遍性的统计方式并探讨可能的优化方向。 +例题: + 题目 对于图C1: -```dot - -graph C1 { - graph [ - layout=neato, - overlap=false, - splines=true, - ]; - - node [ - shape=circle, - style=filled, - fillcolor="grey", - width=0.4, height=0.4, fixedsize=true, - ]; - - edge [ - color="gray", - penwidth=2.5, - len=1; - ]; - 1 -- 2,4; - 2 -- 3,5; - 3 -- 6; - 4 -- 5,6; - 5 -- 6; -} - -``` +C1 考虑其独立集C2: -```dot - -graph C2{ - graph [ - layout=neato, - overlap=false, - splines=true, - ]; - - node [ - shape=circle, - style=filled, - fillcolor="grey", - width=0.4, height=0.4, fixedsize=true, - ]; - - edge [ - color="gray", - penwidth=2.5, - len=1; - ]; - 1 -- 3,5,6; - 2 -- 4,6; - 3 -- 4,5; -} - -``` +C2 \ No newline at end of file diff --git a/draft.pdf b/draft.pdf new file mode 100644 index 0000000..c5e2fb5 Binary files /dev/null and b/draft.pdf differ diff --git a/generate_maps.sh b/generate_maps.sh new file mode 100644 index 0000000..49bb8fc --- /dev/null +++ b/generate_maps.sh @@ -0,0 +1,3 @@ +for file in srcs/*.dot; do + dot -Tsvg "$file" -o "svgs/$(basename "${file%.dot}").svg" +done \ No newline at end of file diff --git a/srcs/C1.dot b/srcs/C1.dot new file mode 100644 index 0000000..d382c33 --- /dev/null +++ b/srcs/C1.dot @@ -0,0 +1,25 @@ +graph CA { + graph [ + layout=neato, + overlap=false, + splines=true, + ]; + + node [ + shape=circle, + style=filled, + fillcolor="grey", + width=0.4, height=0.4, fixedsize=true, + ]; + + edge [ + color="gray", + penwidth=2.5, + len=1; + ]; + A -- B,D; + B -- C,E; + C -- E; + D -- E,F; + E -- F; +} \ No newline at end of file diff --git a/srcs/C2.dot b/srcs/C2.dot new file mode 100644 index 0000000..108ae4d --- /dev/null +++ b/srcs/C2.dot @@ -0,0 +1,23 @@ +graph C2{ + graph [ + layout=neato, + overlap=false, + splines=true, + ]; + + node [ + shape=circle, + style=filled, + fillcolor="grey", + width=0.4, height=0.4, fixedsize=true, + ]; + + edge [ + color="gray", + penwidth=2.5, + len=1; + ]; + A -- C,E,F; + B -- D,F; + C -- D,E; +} \ No newline at end of file diff --git a/svgs/C0.svg b/svgs/C0.svg index 9e3ca91..4238e30 100644 --- a/svgs/C0.svg +++ b/svgs/C0.svg @@ -1 +1 @@ -AAACCCBBBEEEDDDFFF \ No newline at end of file +AAACCCBBBEEEDDDFFF \ No newline at end of file diff --git a/svgs/C1.svg b/svgs/C1.svg new file mode 100644 index 0000000..de7f0f5 --- /dev/null +++ b/svgs/C1.svg @@ -0,0 +1,89 @@ + + + + + + +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--E + + + + +E--F + + + + diff --git a/svgs/C2.svg b/svgs/C2.svg new file mode 100644 index 0000000..ddfedbd --- /dev/null +++ b/svgs/C2.svg @@ -0,0 +1,84 @@ + + + + + + +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 + + + +