https://tcs.nju.edu.cn/wiki/api.php?action=feedcontributions&user=Etone&feedformat=atom
TCS Wiki - User contributions [en]
2024-03-29T08:37:10Z
User contributions
MediaWiki 1.41.0
https://tcs.nju.edu.cn/wiki/index.php?title=%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6_(Spring_2024)&diff=12211
组合数学 (Spring 2024)
2024-03-27T04:37:37Z
<p>Etone: /* Concepts */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>组合数学 <br><br />
Combinatorics</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 尹一通<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 计算机系 804<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday, 2pm-4pm <br> 仙Ⅱ-211<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = TBA <br>计算机系 804<br />
|header9 = Textbook<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = [[File:LW-combinatorics.jpeg|border|100px]]<br />
|header11 =<br />
|label11 = <br />
|data11 = van Lint and Wilson. <br> ''A course in Combinatorics, 2nd ed.'', <br> Cambridge Univ Press, 2001.<br />
|header12 =<br />
|label12 = <br />
|data12 = [[File:Jukna_book.jpg|border|100px]]<br />
|header13 =<br />
|label13 = <br />
|data13 = Jukna. ''Extremal Combinatorics: <br> With Applications in Computer Science,<br>2nd ed.'', Springer, 2011.<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Combinatorics'' class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* '''(2024/03/19)'''<font color=red size=4> 第一次作业已发布</font>,请在 2024/04/03 上课之前提交到 [mailto:njucomb24@163.com njucomb24@163.com] (文件名为'学号_姓名_A1.pdf').<br />
<br />
= Course info =<br />
* '''Instructor ''': 尹一通 ([http://tcs.nju.edu.cn/yinyt/ homepage])<br />
:*'''email''': yinyt@nju.edu.cn<br />
:*'''office''': 计算机系 804 <br />
* '''Teaching assistant''':<br />
** [https://lhy-gispzjz.github.io 刘弘洋] ([mailto:liuhongyang@smail.nju.edu.cn liuhongyang@smail.nju.edu.cn])<br />
** [https://wcysai.com 王淳扬] ([mailto:wcysai@smail.nju.edu.cn wcysai@smail.nju.edu.cn])<br />
* '''Class meeting''': Wednesday, 2pm-4pm, 仙Ⅱ-211.<br />
* '''Office hour''': TBA<br />
:* '''QQ群''': 709281027 (加入时需报姓名、专业、学号)<br />
<br />
= Syllabus =<br />
<br />
=== 先修课程 Prerequisites ===<br />
* 离散数学(Discrete Mathematics)<br />
* 线性代数(Linear Algebra)<br />
* 概率论(Probability Theory)<br />
<br />
=== Course materials ===<br />
* [[组合数学 (Spring 2024)/Course materials|<font size=3>教材和参考书清单</font>]]<br />
<br />
=== 成绩 Grades ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩 (≥ 60%) 和期末考试成绩 (≤ 40%) 综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
* [[组合数学 (Fall 2024)/Problem Set 1|Problem Set 1]]<br />
<br />
= Lecture Notes =<br />
# [[组合数学 (Fall 2024)/Basic enumeration|Basic enumeration | 基本计数]] ([http://tcs.nju.edu.cn/slides/comb2024/BasicEnumeration.pdf slides])<br />
# [[组合数学 (Fall 2024)/Generating functions|Generating functions | 生成函数]] ([http://tcs.nju.edu.cn/slides/comb2024/GeneratingFunction.pdf slides])<br />
# [[组合数学 (Fall 2024)/Sieve methods|Sieve methods | 筛法]] ([http://tcs.nju.edu.cn/slides/comb2024/PIE.pdf slides])<br />
# [[组合数学 (Fall 2024)/Pólya's theory of counting|Pólya's theory of counting | Pólya计数法]]<br />
<br />
= Resources =<br />
* [http://math.mit.edu/~fox/MAT307.html Combinatorics course] by Jacob Fox<br />
* [https://yufeizhao.com/pm/ Probabilistic Methods in Combinatorics] and [https://yufeizhao.com/gtacbook/ Graph Theory and Additive Combinatorics] by Yufei Zhao<br />
* [https://www.math.uvic.ca/~noelj/combinatoricsLectures.html Combinatorics Lecture Videos online]<br />
* [https://www.math.ucla.edu/~pak/lectures/Math-Videos/comb-videos.htm Collection of Combinatorics Videos]<br />
<br />
= Concepts =<br />
* [http://en.wikipedia.org/wiki/Binomial_coefficient Binomial coefficient]<br />
* [http://en.wikipedia.org/wiki/Twelvefold_way The twelvefold way]<br />
* [http://en.wikipedia.org/wiki/Composition_(number_theory) Composition of a number]<br />
* [http://en.wikipedia.org/wiki/Multiset#Formal_definition Multiset]<br />
* [http://en.wikipedia.org/wiki/Combination#Number_of_combinations_with_repetition Combinations with repetition], [http://en.wikipedia.org/wiki/Multiset#Counting_multisets <math>k</math>-multisets on a set]<br />
* [http://en.wikipedia.org/wiki/Multinomial_theorem#Multinomial_coefficients Multinomial coefficients]<br />
* [http://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind Stirling number of the second kind]<br />
* [http://en.wikipedia.org/wiki/Partition_(number_theory) Partition of a number]<br />
** [http://en.wikipedia.org/wiki/Young_tableau Young tableau]<br />
* [http://en.wikipedia.org/wiki/Fibonacci_number Fibonacci number]<br />
* [http://en.wikipedia.org/wiki/Catalan_number Catalan number]<br />
* [http://en.wikipedia.org/wiki/Generating_function Generating function] and [http://en.wikipedia.org/wiki/Formal_power_series formal power series]<br />
* [http://en.wikipedia.org/wiki/Binomial_series Newton's formula]<br />
* [http://en.wikipedia.org/wiki/Inclusion-exclusion_principle The principle of inclusion-exclusion] (and more generally the [http://en.wikipedia.org/wiki/Sieve_theory sieve method])<br />
* [http://en.wikipedia.org/wiki/M%C3%B6bius_inversion_formula Möbius inversion formula]<br />
* [http://en.wikipedia.org/wiki/Derangement Derangement], and [http://en.wikipedia.org/wiki/M%C3%A9nage_problem Problème des ménages]<br />
* [http://en.wikipedia.org/wiki/Ryser%27s_formula#Ryser_formula Ryser's formula]<br />
* [http://en.wikipedia.org/wiki/Euler_totient Euler totient function]<br />
* [https://en.wikipedia.org/wiki/Burnside%27s_lemma Burnside's lemma]<br />
** [https://en.wikipedia.org/wiki/Group_action Group action]<br />
** [https://en.wikipedia.org/wiki/Group_action#Orbits_and_stabilizers Orbits]<br />
* [https://en.wikipedia.org/wiki/P%C3%B3lya_enumeration_theorem Pólya enumeration theorem]<br />
** [https://en.wikipedia.org/wiki/Permutation_group Permutation group]<br />
** [https://en.wikipedia.org/wiki/Cycle_index Cycle index]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6_(Spring_2024)&diff=12210
组合数学 (Spring 2024)
2024-03-27T04:36:59Z
<p>Etone: /* Concepts */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>组合数学 <br><br />
Combinatorics</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 尹一通<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 计算机系 804<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday, 2pm-4pm <br> 仙Ⅱ-211<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = TBA <br>计算机系 804<br />
|header9 = Textbook<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = [[File:LW-combinatorics.jpeg|border|100px]]<br />
|header11 =<br />
|label11 = <br />
|data11 = van Lint and Wilson. <br> ''A course in Combinatorics, 2nd ed.'', <br> Cambridge Univ Press, 2001.<br />
|header12 =<br />
|label12 = <br />
|data12 = [[File:Jukna_book.jpg|border|100px]]<br />
|header13 =<br />
|label13 = <br />
|data13 = Jukna. ''Extremal Combinatorics: <br> With Applications in Computer Science,<br>2nd ed.'', Springer, 2011.<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Combinatorics'' class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* '''(2024/03/19)'''<font color=red size=4> 第一次作业已发布</font>,请在 2024/04/03 上课之前提交到 [mailto:njucomb24@163.com njucomb24@163.com] (文件名为'学号_姓名_A1.pdf').<br />
<br />
= Course info =<br />
* '''Instructor ''': 尹一通 ([http://tcs.nju.edu.cn/yinyt/ homepage])<br />
:*'''email''': yinyt@nju.edu.cn<br />
:*'''office''': 计算机系 804 <br />
* '''Teaching assistant''':<br />
** [https://lhy-gispzjz.github.io 刘弘洋] ([mailto:liuhongyang@smail.nju.edu.cn liuhongyang@smail.nju.edu.cn])<br />
** [https://wcysai.com 王淳扬] ([mailto:wcysai@smail.nju.edu.cn wcysai@smail.nju.edu.cn])<br />
* '''Class meeting''': Wednesday, 2pm-4pm, 仙Ⅱ-211.<br />
* '''Office hour''': TBA<br />
:* '''QQ群''': 709281027 (加入时需报姓名、专业、学号)<br />
<br />
= Syllabus =<br />
<br />
=== 先修课程 Prerequisites ===<br />
* 离散数学(Discrete Mathematics)<br />
* 线性代数(Linear Algebra)<br />
* 概率论(Probability Theory)<br />
<br />
=== Course materials ===<br />
* [[组合数学 (Spring 2024)/Course materials|<font size=3>教材和参考书清单</font>]]<br />
<br />
=== 成绩 Grades ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩 (≥ 60%) 和期末考试成绩 (≤ 40%) 综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
* [[组合数学 (Fall 2024)/Problem Set 1|Problem Set 1]]<br />
<br />
= Lecture Notes =<br />
# [[组合数学 (Fall 2024)/Basic enumeration|Basic enumeration | 基本计数]] ([http://tcs.nju.edu.cn/slides/comb2024/BasicEnumeration.pdf slides])<br />
# [[组合数学 (Fall 2024)/Generating functions|Generating functions | 生成函数]] ([http://tcs.nju.edu.cn/slides/comb2024/GeneratingFunction.pdf slides])<br />
# [[组合数学 (Fall 2024)/Sieve methods|Sieve methods | 筛法]] ([http://tcs.nju.edu.cn/slides/comb2024/PIE.pdf slides])<br />
# [[组合数学 (Fall 2024)/Pólya's theory of counting|Pólya's theory of counting | Pólya计数法]]<br />
<br />
= Resources =<br />
* [http://math.mit.edu/~fox/MAT307.html Combinatorics course] by Jacob Fox<br />
* [https://yufeizhao.com/pm/ Probabilistic Methods in Combinatorics] and [https://yufeizhao.com/gtacbook/ Graph Theory and Additive Combinatorics] by Yufei Zhao<br />
* [https://www.math.uvic.ca/~noelj/combinatoricsLectures.html Combinatorics Lecture Videos online]<br />
* [https://www.math.ucla.edu/~pak/lectures/Math-Videos/comb-videos.htm Collection of Combinatorics Videos]<br />
<br />
= Concepts =<br />
* [http://en.wikipedia.org/wiki/Binomial_coefficient Binomial coefficient]<br />
* [http://en.wikipedia.org/wiki/Twelvefold_way The twelvefold way]<br />
* [http://en.wikipedia.org/wiki/Composition_(number_theory) Composition of a number]<br />
* [http://en.wikipedia.org/wiki/Multiset#Formal_definition Multiset]<br />
* [http://en.wikipedia.org/wiki/Combination#Number_of_combinations_with_repetition Combinations with repetition], [http://en.wikipedia.org/wiki/Multiset#Counting_multisets <math>k</math>-multisets on a set]<br />
* [http://en.wikipedia.org/wiki/Multinomial_theorem#Multinomial_coefficients Multinomial coefficients]<br />
* [http://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind Stirling number of the second kind]<br />
* [http://en.wikipedia.org/wiki/Partition_(number_theory) Partition of a number]<br />
** [http://en.wikipedia.org/wiki/Young_tableau Young tableau]<br />
* [http://en.wikipedia.org/wiki/Fibonacci_number Fibonacci number]<br />
* [http://en.wikipedia.org/wiki/Catalan_number Catalan number]<br />
* [http://en.wikipedia.org/wiki/Generating_function Generating function] and [http://en.wikipedia.org/wiki/Formal_power_series formal power series]<br />
* [http://en.wikipedia.org/wiki/Binomial_series Newton's formula]<br />
* [http://en.wikipedia.org/wiki/Inclusion-exclusion_principle The principle of inclusion-exclusion] (and more generally the [http://en.wikipedia.org/wiki/Sieve_theory sieve method])<br />
* [http://en.wikipedia.org/wiki/M%C3%B6bius_inversion_formula Möbius inversion formula]<br />
* [http://en.wikipedia.org/wiki/Derangement Derangement], and [http://en.wikipedia.org/wiki/M%C3%A9nage_problem Problème des ménages]<br />
* [http://en.wikipedia.org/wiki/Ryser%27s_formula#Ryser_formula Ryser's formula]<br />
* [http://en.wikipedia.org/wiki/Euler_totient Euler totient function]<br />
* [https://en.wikipedia.org/wiki/Burnside%27s_lemma Burnside's lemma]<br />
** [https://en.wikipedia.org/wiki/Group_action Group action]<br />
* [https://en.wikipedia.org/wiki/P%C3%B3lya_enumeration_theorem Pólya enumeration theorem]<br />
** [https://en.wikipedia.org/wiki/Permutation_group Permutation group]<br />
** [https://en.wikipedia.org/wiki/Cycle_index Cycle index]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6_(Spring_2024)&diff=12209
组合数学 (Spring 2024)
2024-03-27T04:35:36Z
<p>Etone: /* Concepts */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>组合数学 <br><br />
Combinatorics</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 尹一通<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 计算机系 804<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday, 2pm-4pm <br> 仙Ⅱ-211<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = TBA <br>计算机系 804<br />
|header9 = Textbook<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = [[File:LW-combinatorics.jpeg|border|100px]]<br />
|header11 =<br />
|label11 = <br />
|data11 = van Lint and Wilson. <br> ''A course in Combinatorics, 2nd ed.'', <br> Cambridge Univ Press, 2001.<br />
|header12 =<br />
|label12 = <br />
|data12 = [[File:Jukna_book.jpg|border|100px]]<br />
|header13 =<br />
|label13 = <br />
|data13 = Jukna. ''Extremal Combinatorics: <br> With Applications in Computer Science,<br>2nd ed.'', Springer, 2011.<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Combinatorics'' class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* '''(2024/03/19)'''<font color=red size=4> 第一次作业已发布</font>,请在 2024/04/03 上课之前提交到 [mailto:njucomb24@163.com njucomb24@163.com] (文件名为'学号_姓名_A1.pdf').<br />
<br />
= Course info =<br />
* '''Instructor ''': 尹一通 ([http://tcs.nju.edu.cn/yinyt/ homepage])<br />
:*'''email''': yinyt@nju.edu.cn<br />
:*'''office''': 计算机系 804 <br />
* '''Teaching assistant''':<br />
** [https://lhy-gispzjz.github.io 刘弘洋] ([mailto:liuhongyang@smail.nju.edu.cn liuhongyang@smail.nju.edu.cn])<br />
** [https://wcysai.com 王淳扬] ([mailto:wcysai@smail.nju.edu.cn wcysai@smail.nju.edu.cn])<br />
* '''Class meeting''': Wednesday, 2pm-4pm, 仙Ⅱ-211.<br />
* '''Office hour''': TBA<br />
:* '''QQ群''': 709281027 (加入时需报姓名、专业、学号)<br />
<br />
= Syllabus =<br />
<br />
=== 先修课程 Prerequisites ===<br />
* 离散数学(Discrete Mathematics)<br />
* 线性代数(Linear Algebra)<br />
* 概率论(Probability Theory)<br />
<br />
=== Course materials ===<br />
* [[组合数学 (Spring 2024)/Course materials|<font size=3>教材和参考书清单</font>]]<br />
<br />
=== 成绩 Grades ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩 (≥ 60%) 和期末考试成绩 (≤ 40%) 综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
* [[组合数学 (Fall 2024)/Problem Set 1|Problem Set 1]]<br />
<br />
= Lecture Notes =<br />
# [[组合数学 (Fall 2024)/Basic enumeration|Basic enumeration | 基本计数]] ([http://tcs.nju.edu.cn/slides/comb2024/BasicEnumeration.pdf slides])<br />
# [[组合数学 (Fall 2024)/Generating functions|Generating functions | 生成函数]] ([http://tcs.nju.edu.cn/slides/comb2024/GeneratingFunction.pdf slides])<br />
# [[组合数学 (Fall 2024)/Sieve methods|Sieve methods | 筛法]] ([http://tcs.nju.edu.cn/slides/comb2024/PIE.pdf slides])<br />
# [[组合数学 (Fall 2024)/Pólya's theory of counting|Pólya's theory of counting | Pólya计数法]]<br />
<br />
= Resources =<br />
* [http://math.mit.edu/~fox/MAT307.html Combinatorics course] by Jacob Fox<br />
* [https://yufeizhao.com/pm/ Probabilistic Methods in Combinatorics] and [https://yufeizhao.com/gtacbook/ Graph Theory and Additive Combinatorics] by Yufei Zhao<br />
* [https://www.math.uvic.ca/~noelj/combinatoricsLectures.html Combinatorics Lecture Videos online]<br />
* [https://www.math.ucla.edu/~pak/lectures/Math-Videos/comb-videos.htm Collection of Combinatorics Videos]<br />
<br />
= Concepts =<br />
* [http://en.wikipedia.org/wiki/Binomial_coefficient Binomial coefficient]<br />
* [http://en.wikipedia.org/wiki/Twelvefold_way The twelvefold way]<br />
* [http://en.wikipedia.org/wiki/Composition_(number_theory) Composition of a number]<br />
* [http://en.wikipedia.org/wiki/Multiset#Formal_definition Multiset]<br />
* [http://en.wikipedia.org/wiki/Combination#Number_of_combinations_with_repetition Combinations with repetition], [http://en.wikipedia.org/wiki/Multiset#Counting_multisets <math>k</math>-multisets on a set]<br />
* [http://en.wikipedia.org/wiki/Multinomial_theorem#Multinomial_coefficients Multinomial coefficients]<br />
* [http://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind Stirling number of the second kind]<br />
* [http://en.wikipedia.org/wiki/Partition_(number_theory) Partition of a number]<br />
** [http://en.wikipedia.org/wiki/Young_tableau Young tableau]<br />
* [http://en.wikipedia.org/wiki/Fibonacci_number Fibonacci number]<br />
* [http://en.wikipedia.org/wiki/Catalan_number Catalan number]<br />
* [http://en.wikipedia.org/wiki/Generating_function Generating function] and [http://en.wikipedia.org/wiki/Formal_power_series formal power series]<br />
* [http://en.wikipedia.org/wiki/Binomial_series Newton's formula]<br />
* [http://en.wikipedia.org/wiki/Inclusion-exclusion_principle The principle of inclusion-exclusion] (and more generally the [http://en.wikipedia.org/wiki/Sieve_theory sieve method])<br />
* [http://en.wikipedia.org/wiki/M%C3%B6bius_inversion_formula Möbius inversion formula]<br />
* [http://en.wikipedia.org/wiki/Derangement Derangement], and [http://en.wikipedia.org/wiki/M%C3%A9nage_problem Problème des ménages]<br />
* [http://en.wikipedia.org/wiki/Ryser%27s_formula#Ryser_formula Ryser's formula]<br />
* [http://en.wikipedia.org/wiki/Euler_totient Euler totient function]<br />
* [https://en.wikipedia.org/wiki/Burnside%27s_lemma Burnside's lemma]<br />
** [https://en.wikipedia.org/wiki/Group_action Group action]<br />
** [https://en.wikipedia.org/wiki/Symmetric_group]<br />
* [https://en.wikipedia.org/wiki/P%C3%B3lya_enumeration_theorem Pólya enumeration theorem]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6_(Spring_2024)&diff=12208
组合数学 (Spring 2024)
2024-03-27T04:28:07Z
<p>Etone: /* Concepts */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>组合数学 <br><br />
Combinatorics</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 尹一通<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 计算机系 804<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday, 2pm-4pm <br> 仙Ⅱ-211<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = TBA <br>计算机系 804<br />
|header9 = Textbook<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = [[File:LW-combinatorics.jpeg|border|100px]]<br />
|header11 =<br />
|label11 = <br />
|data11 = van Lint and Wilson. <br> ''A course in Combinatorics, 2nd ed.'', <br> Cambridge Univ Press, 2001.<br />
|header12 =<br />
|label12 = <br />
|data12 = [[File:Jukna_book.jpg|border|100px]]<br />
|header13 =<br />
|label13 = <br />
|data13 = Jukna. ''Extremal Combinatorics: <br> With Applications in Computer Science,<br>2nd ed.'', Springer, 2011.<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Combinatorics'' class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* '''(2024/03/19)'''<font color=red size=4> 第一次作业已发布</font>,请在 2024/04/03 上课之前提交到 [mailto:njucomb24@163.com njucomb24@163.com] (文件名为'学号_姓名_A1.pdf').<br />
<br />
= Course info =<br />
* '''Instructor ''': 尹一通 ([http://tcs.nju.edu.cn/yinyt/ homepage])<br />
:*'''email''': yinyt@nju.edu.cn<br />
:*'''office''': 计算机系 804 <br />
* '''Teaching assistant''':<br />
** [https://lhy-gispzjz.github.io 刘弘洋] ([mailto:liuhongyang@smail.nju.edu.cn liuhongyang@smail.nju.edu.cn])<br />
** [https://wcysai.com 王淳扬] ([mailto:wcysai@smail.nju.edu.cn wcysai@smail.nju.edu.cn])<br />
* '''Class meeting''': Wednesday, 2pm-4pm, 仙Ⅱ-211.<br />
* '''Office hour''': TBA<br />
:* '''QQ群''': 709281027 (加入时需报姓名、专业、学号)<br />
<br />
= Syllabus =<br />
<br />
=== 先修课程 Prerequisites ===<br />
* 离散数学(Discrete Mathematics)<br />
* 线性代数(Linear Algebra)<br />
* 概率论(Probability Theory)<br />
<br />
=== Course materials ===<br />
* [[组合数学 (Spring 2024)/Course materials|<font size=3>教材和参考书清单</font>]]<br />
<br />
=== 成绩 Grades ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩 (≥ 60%) 和期末考试成绩 (≤ 40%) 综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
* [[组合数学 (Fall 2024)/Problem Set 1|Problem Set 1]]<br />
<br />
= Lecture Notes =<br />
# [[组合数学 (Fall 2024)/Basic enumeration|Basic enumeration | 基本计数]] ([http://tcs.nju.edu.cn/slides/comb2024/BasicEnumeration.pdf slides])<br />
# [[组合数学 (Fall 2024)/Generating functions|Generating functions | 生成函数]] ([http://tcs.nju.edu.cn/slides/comb2024/GeneratingFunction.pdf slides])<br />
# [[组合数学 (Fall 2024)/Sieve methods|Sieve methods | 筛法]] ([http://tcs.nju.edu.cn/slides/comb2024/PIE.pdf slides])<br />
# [[组合数学 (Fall 2024)/Pólya's theory of counting|Pólya's theory of counting | Pólya计数法]]<br />
<br />
= Resources =<br />
* [http://math.mit.edu/~fox/MAT307.html Combinatorics course] by Jacob Fox<br />
* [https://yufeizhao.com/pm/ Probabilistic Methods in Combinatorics] and [https://yufeizhao.com/gtacbook/ Graph Theory and Additive Combinatorics] by Yufei Zhao<br />
* [https://www.math.uvic.ca/~noelj/combinatoricsLectures.html Combinatorics Lecture Videos online]<br />
* [https://www.math.ucla.edu/~pak/lectures/Math-Videos/comb-videos.htm Collection of Combinatorics Videos]<br />
<br />
= Concepts =<br />
* [http://en.wikipedia.org/wiki/Binomial_coefficient Binomial coefficient]<br />
* [http://en.wikipedia.org/wiki/Twelvefold_way The twelvefold way]<br />
* [http://en.wikipedia.org/wiki/Composition_(number_theory) Composition of a number]<br />
* [http://en.wikipedia.org/wiki/Multiset#Formal_definition Multiset]<br />
* [http://en.wikipedia.org/wiki/Combination#Number_of_combinations_with_repetition Combinations with repetition], [http://en.wikipedia.org/wiki/Multiset#Counting_multisets <math>k</math>-multisets on a set]<br />
* [http://en.wikipedia.org/wiki/Multinomial_theorem#Multinomial_coefficients Multinomial coefficients]<br />
* [http://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind Stirling number of the second kind]<br />
* [http://en.wikipedia.org/wiki/Partition_(number_theory) Partition of a number]<br />
** [http://en.wikipedia.org/wiki/Young_tableau Young tableau]<br />
* [http://en.wikipedia.org/wiki/Fibonacci_number Fibonacci number]<br />
* [http://en.wikipedia.org/wiki/Catalan_number Catalan number]<br />
* [http://en.wikipedia.org/wiki/Generating_function Generating function] and [http://en.wikipedia.org/wiki/Formal_power_series formal power series]<br />
* [http://en.wikipedia.org/wiki/Binomial_series Newton's formula]<br />
* [http://en.wikipedia.org/wiki/Inclusion-exclusion_principle The principle of inclusion-exclusion] (and more generally the [http://en.wikipedia.org/wiki/Sieve_theory sieve method])<br />
* [http://en.wikipedia.org/wiki/M%C3%B6bius_inversion_formula Möbius inversion formula]<br />
* [http://en.wikipedia.org/wiki/Derangement Derangement], and [http://en.wikipedia.org/wiki/M%C3%A9nage_problem Problème des ménages]<br />
* [http://en.wikipedia.org/wiki/Ryser%27s_formula#Ryser_formula Ryser's formula]<br />
* [http://en.wikipedia.org/wiki/Euler_totient Euler totient function]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6_(Fall_2024)/P%C3%B3lya%27s_theory_of_counting&diff=12207
组合数学 (Fall 2024)/Pólya's theory of counting
2024-03-27T04:27:10Z
<p>Etone: Created page with "== Groups == A group <math>(G,\cdot)</math> is set <math>G</math> along with a binary operator <math>\cdot</math> which satisfies the following axioms: * ''closure'': <math>\forall g,h\in G, g\cdot h \in G</math>; * ''associativity'': <math>\forall f,g,h\in G, f\cdot(g\cdot h)=(f\cdot g)\cdot h</math>; * ''identity'': there exists a special element <math>e\in G</math>, called the '''identity''', such that <math>e\cdot g=g</math> for any <math>g\in G</math>; * ''inverse''..."</p>
<hr />
<div>== Groups ==<br />
A group <math>(G,\cdot)</math> is set <math>G</math> along with a binary operator <math>\cdot</math> which satisfies the following axioms:<br />
* ''closure'': <math>\forall g,h\in G, g\cdot h \in G</math>;<br />
* ''associativity'': <math>\forall f,g,h\in G, f\cdot(g\cdot h)=(f\cdot g)\cdot h</math>;<br />
* ''identity'': there exists a special element <math>e\in G</math>, called the '''identity''', such that <math>e\cdot g=g</math> for any <math>g\in G</math>;<br />
* ''inverse'': <math>\forall g\in G</math>, there exists an <math>h\in G</math> such that <math>g\cdot h=e</math>, and we denote that <math>h=g^{-1}</math>.<br />
<br />
=== Permutation groups===<br />
A permutation is a bijection <math>\pi:[n]\xrightarrow[\text{onto}]{\text{1-1}}[n]</math>. We can define a natural operator "<math>\cdot</math>" between permutations by function composition, i.e. for any <math>\pi,\sigma\in S_n</math>, <math>(\pi\cdot\sigma)(i)=\pi(\sigma(i))</math> for all <math>i\in[n]</math>.<br />
<br />
;Symmetric group <math>S_n</math><br />
:Let <math>S_n</math> denote the set of all permutations of <math>[n]</math>. It is easy to verify that <math>S_n</math> together with function composition <math>\cdot</math> form a group. This group is called the '''symmetric group''' on <math>n</math> elements.<br />
<br />
Subgroups of <math>S_n</math> are called '''permutation groups'''. The most basic permutation group is <math>S_n</math> itself (since a group is a subgroup of itself). Besides it, there are several typical permutation groups related to natural symmetric operations.<br />
<br />
;Cyclic group <math>C_n</math><br />
:Given a permutation <math>\pi\in S_n</math>, denote that <br />
::<math>\pi^t=\underbrace{\pi\cdot\pi\cdots\pi}_t</math>, <br />
:and <math>\pi^0=e</math> is the identity. <br />
:We define a special permutation <math>\sigma\,</math> as that <math>\sigma(i)=(i+1)\bmod n\,</math> for any <math>i</math>, and let <math>C_n=\{\sigma^t\mid t\ge 0\}</math>. We say that <math>C_n</math> is ''generated'' by the permutation <math>\sigma</math>. It is easy to verify that <math>C_n</math> is a subgroup of <math>S_n</math>. The group <math>C_n</math> is called the '''cyclic group''' of order <math>n</math>, which is the group formed by all '''rotational symmetries''' of a regular polygon of <math>n</math> sides.<br />
:It is easy to see that <math>|C_n|=n</math>, that is, there are <math>n</math> rotations of a regular <math>n</math>-gon.<br />
<br />
;Dihedral group <math>D_n</math><br />
:Define another special permutation <math>\rho\,</math> as that <math>\rho(i)=n-i-1\,</math> for all <math>i\in[n]</math>. The '''Dihedral group''' <math>D_n</math> is obtained by adding <math>\rho</math> into <math>C_n</math> and then take a ''closure'' (under operations of "<math>\cdot</math>"). This group is the group of symmetries, including '''rotations''' as well as '''reflections''', of a regular polygon of <math>n</math> sides.<br />
:It is an exercise to check that <math>|D_n|=2n</math>.<br />
<br />
==== Cycle decomposition ====<br />
A permutation <math>\pi:[n]\xrightarrow[\text{onto}]{\text{1-1}}[n]</math> can be written in the following form:<br />
:<math>\begin{pmatrix}<br />
1 & 2 & \cdots & n \\<br />
\pi(1) & \pi(2) & \cdots & \pi(n) <br />
\end{pmatrix}</math>.<br />
For example,<br />
:<math>\begin{pmatrix}<br />
1 & 2 & 3 & 4 & 5 \\<br />
3 & 5 & 1 & 2 & 4 <br />
\end{pmatrix}</math>.<br />
The permutation can be equivalently described as a composition of a number of '''cycles'''. For example, in the above permutation, we have two cycles:<br />
:<math>1\rightarrow 3\rightarrow 1</math> and <math>2\rightarrow5\rightarrow4\rightarrow2</math>.<br />
We can denote the permutation by<br />
:<math>(13)(254)</math>.<br />
<br />
=== Group action ===<br />
{{Theorem|Definition (group action)|<br />
:A '''group action''' of a group <math>G</math> on a set <math>X</math> is a binary operator:<br />
::<math>\circ:G\times X\rightarrow X</math><br />
:satisfying:<br />
:* Associativity: <math>(g\cdot h)\circ x=g\circ (h\circ x)</math> for all <math>g,h\in G</math> and <math>x\in X</math>;<br />
:* Identity: <math>e\circ x=x</math> for all <math>x\in X</math>.<br />
}}<br />
<br />
==== Example: coloring a necklace ====<br />
Suppose a necklace is made of <math>n</math> beads, each with one of the <math>m</math> colors. Formally, a necklace is an assignment <math>x:[n]\rightarrow[m]</math> of <math>m</math> colors to <math>n</math> positions. Let <math>X=\{x:[n]\rightarrow[m]\}</math> be the set of all such assignments.<br />
<br />
For example, when <math>n=4</math> and <math>m=2</math>, <math>X</math> contains all possible 2-colorings (say red and blue) of 4 positions.<br />
:<math>X=\{{\color{blue}bbbb}, {\color{blue}bbb}{\color{red}r}, {\color{blue}bb}{\color{red}r}{\color{blue}b}, {\color{blue}bb}{\color{red}rr}, {\color{blue}b}{\color{red}r}{\color{blue}b}{\color{red}r}, {\color{blue}b}{\color{red}rr}{\color{blue}b}, {\color{blue}b}{\color{red}rrr}, {\color{red}r}{\color{blue}bbb}, {\color{red}r}{\color{blue}bb}{\color{red}r}, {\color{red}r}{\color{blue}b}{\color{red}r}{\color{blue}b}, {\color{red}r}{\color{blue}b}{\color{red}rr}, {\color{red}rr}{\color{blue}bb}, {\color{red}rr}{\color{blue}b}{\color{red}r}, {\color{red}rrr}{\color{blue}b}, {\color{red}rrrr}\}</math><br />
<br />
We consider two kinds of symmetric operations on necklaces:<br />
* Rotation: the corresponding group is the cyclic group <math>C_n</math>.<br />
* Rotation and reflection: the corresponding group is the dihedral group <math>D_n</math>.<br />
<br />
Mathematically, these operations on necklaces are described as group actions on <math>X</math>. Recall that each member <math>x\in X</math> is an <math>m</math>-coloring <math>x:[n]\rightarrow[m]</math> of <math>n</math> positions. Suppose the permutation group is <math>G</math>, for any <math>\pi\in G</math> and any <math>x\in X</math>, the group action <math>\pi\circ x</math> is naturally defined as such:<br />
:<math>(\pi\circ x)(i)=x(\pi(i))</math>.<br />
<br />
== Burnside's Lemma ==<br />
<br />
=== Orbits ===<br />
{{Theorem|Definition|<br />
:Let <math>G</math> be a permutation group acting on a set <math>X</math>. For any <math>x\in X</math>. The '''orbit''' of <math>x</math> under action of <math>G</math>, denoted <math>Gx</math>, is defined as<br />
::<math>Gx=\{\pi\circ x\mid \pi\in G\}</math>.<br />
}}<br />
<br />
For any <math>x,y,z\in X</math>, the followings can be verified for orbits<br />
* ''reflexivity'': <math>x\in Gx</math> since <math>e\circ x=x</math>;<br />
* ''symmetric'': if <math>y\in Gx</math> then there is a <math>\pi\in G</math> such that <math>\pi\circ x=y</math>, thus <math>\pi^{-1}\circ y=\pi^{-1}\circ(\pi\circ x) =(\pi^{-1}\cdot \pi)\circ x=e\circ x=x</math>, hence <math>x\in Gy</math>;<br />
* ''transitivity'': if <math>y\in Gx</math> and <math>z\in Gy</math>, then there exist <math>\pi,\sigma\in G</math> such that <math>\pi\circ x=y</math> and <math>\sigma\circ y=z</math>, thus <math>(\sigma\cdot \pi)\circ x=\sigma\circ(\pi\circ x)=\sigma\circ y=z</math>, hence <math>z\in Gx</math>.<br />
<br />
Therefore, <math>x\in Gy</math> defines an equivalent relation between <math>x</math> and <math>y</math>, and orbits partition the set <math>X</math>.<br />
<br />
;Example<br />
:Back to the example of coloring necklaces.<br />
<br />
:<math>X</math> contains all possible 2-colorings (say red and blue) of 4 positions.<br />
::<math>X=\{{\color{blue}bbbb}, {\color{blue}bbb}{\color{red}r}, {\color{blue}bb}{\color{red}r}{\color{blue}b}, {\color{blue}bb}{\color{red}rr}, {\color{blue}b}{\color{red}r}{\color{blue}bb}, {\color{blue}b}{\color{red}r}{\color{blue}b}{\color{red}r}, {\color{blue}b}{\color{red}rr}{\color{blue}b}, {\color{blue}b}{\color{red}rrr}, {\color{red}r}{\color{blue}bbb}, {\color{red}r}{\color{blue}bb}{\color{red}r}, {\color{red}r}{\color{blue}b}{\color{red}r}{\color{blue}b}, {\color{red}r}{\color{blue}b}{\color{red}rr}, {\color{red}rr}{\color{blue}bb}, {\color{red}rr}{\color{blue}b}{\color{red}r}, {\color{red}rrr}{\color{blue}b}, {\color{red}rrrr}\}</math><br />
<br />
:We consider the rotations of necklaces. The cyclic group <math>C_4</math> acting on <math>X</math> partitions the <math>X</math> into the following equivalent classes:<br />
::<math>\begin{align}<br />
&\{{\color{blue}bbbb}\},\\<br />
&\{ {\color{blue}bbb}{\color{red}r}, {\color{blue}bb}{\color{red}r}{\color{blue}b}, {\color{blue}b}{\color{red}r}{\color{blue}bb}, {\color{red}r}{\color{blue}bbb}\},\\<br />
&\{ {\color{blue}bb}{\color{red}rr}, {\color{blue}b}{\color{red}rr}{\color{blue}b}, {\color{red}r}{\color{blue}bb}{\color{red}r}, {\color{red}rr}{\color{blue}bb}, \},\\<br />
&\{ {\color{blue}b}{\color{red}r}{\color{blue}b}{\color{red}r}, {\color{red}r}{\color{blue}b}{\color{red}r}{\color{blue}b}\},\\<br />
&\{ {\color{blue}b}{\color{red}rrr}, {\color{red}r}{\color{blue}b}{\color{red}rr}, {\color{red}rr}{\color{blue}b}{\color{red}r}, {\color{red}rrr}{\color{blue}b}\},\\<br />
&\{ {\color{red}rrrr}\}<br />
\end{align}<br />
</math><br />
<br />
=== Invariant sets and stabilizers ===<br />
Let <math>G</math> be a permutation group acting on a set <math>X</math>. Let <math>\pi\in G, x\in X</math>.<br />
* The '''invariant set''' of <math>\pi</math>:<br />
::<math>X_\pi=\{x\in X\mid \pi\circ x=x\}</math>.<br />
* The '''stabilizer''' of <math>x</math>:<br />
::<math>G_x=\{\pi\in G\mid \pi\circ x=x\}</math>.<br />
<br />
There is a beautiful identity for invariant sets and stabilizers.<br />
{{Theorem|Lemma|<br />
:Let <math>G</math> be a permutation group acting on a set <math>X</math>. For any <math>x\in X</math>,<br />
::<math>|G_x||Gx|=|G|\,</math>.<br />
}}<br />
{{Proof|<br />
Recall that the orbit <math>Gx=\{\pi\circ x\mid \pi\in G\}</math>. Suppose that <math>Gx=\{x_1,x_2,\ldots,x_t\}</math>. Then there exist a set <math>P=\{\pi_1,\pi_2,\ldots,\pi_t\}</math> of permutations such that <math>\pi_i\circ x=x_i\,</math> for <math>i=1,2,\ldots,t</math>. We construct a bijection between <math>G</math> and <math>P\times G_x</math>, which will prove the lemma.<br />
<br />
For any <math>\pi\in G</math>, it holds that <math>\pi\circ x=x_i</math> for some <math>x_i</math>, and since <math>\pi_i\circ x=x_i</math>, we have <br />
<math>\pi_i\circ x=\pi\circ x</math>, hence <br />
:<math>(\pi_i^{-1}\cdot\pi)\circ x=\pi_i^{-1}\circ(\pi\circ x)=\pi_i^{-1}\circ(\pi_i\circ x)=(\pi_i^{-1}\cdot\pi_i)\circ x=e\circ x=x</math>. <br />
Denote that <math>\sigma=\pi_i^{-1}\cdot \pi</math>. Then <br />
*<math>\pi_i\cdot\sigma=\pi_i\cdot(\pi_i^{-1}\cdot\pi)=\pi</math>, and <br />
*<math>\sigma\circ x=(\pi_i^{-1}\cdot\pi)\circ x=x</math>, which implies that <math>\sigma\in G_x</math>. <br />
Therefore, each <math>\pi\in G</math> corresponds to a unique pair <math>(\pi_i,\sigma)\in P\times G_x</math>. We have a 1-1 mapping from <math>G</math> to <math>P\times G_x</math>.<br />
<br />
For every <math>\pi_i\in P</math> and every <math>\sigma\in G_x</math>, <math>\pi=\pi_i\cdot\sigma\in G</math>. We show that this is a 1-1 mapping. Suppose that <math>\pi_i\cdot\sigma=\pi_j\cdot\tau</math> for some <math>\pi_i,\pi_j\in P</math> and <math>\sigma,\tau\in G_x</math>. Then <math>(\pi_i\cdot\sigma)\circ x=\pi_i\circ(\sigma\circ x)=\pi_i\circ x=x_i</math> and <math>(\pi_j\cdot \tau)\circ x=\pi_j\circ(\tau\circ x)=\pi_j\circ x=x_j</math>, which implies <math>x_i=x_j</math> and correspondingly <math>\pi_i=\pi_j</math>. Since <math>\pi_i\cdot\sigma=\pi_j\cdot\tau</math>, <math>\sigma=\tau</math>. Therefore, we show that the mapping is 1-1.<br />
<br />
In conclusion, there exists a bijection between <math>P\times G_x</math> and <math>G</math>. As a consequence, <math>|Gx||G_x|=|P||G_x|=|P\times G_x|=|G|</math>.<br />
}}<br />
<br />
=== Counting orbits===<br />
<br />
{{Theorem|Burnside's Lemma|<br />
:Let <math>G</math> be a permutation group acting on a set <math>X</math>. The number of orbits, denoted <math>|X/G|</math>, is <br />
::<math>|X/G|=\frac{1}{|G|}\sum_{\pi\in G}|X_{\pi}|.</math><br />
}}<br />
{{Proof|<br />
Let <br />
:<math>A(\pi,x)=\begin{cases}1 & \pi\circ x=x,\\ 0 & \text{otherwise.}\end{cases}</math><br />
Basically <math>A(\pi,x)</math> indicates whether <math>x</math> is invariant under action of <math>\pi</math>. We can think of <math>A</math> as a matrix indexed by <math>G\times X</math>. An important observation is that the row sums and column sums of <math>A</math> are <math>|X_\pi|</math> and <math>|G_x|</math> respectively, namely,<br />
:<math>|X_\pi|=\sum_{x\in X}A(\pi,x)</math> and <math>|G_x|=\sum_{\pi\in G}A(\pi,x)</math>.<br />
Then a double counting gives that<br />
:<math>\sum_{\pi\in G}|X_\pi|=\sum_{\pi\in G}\sum_{x\in X}A(\pi,x)=\sum_{x\in X}\sum_{\pi\in G}A(\pi,x)=\sum_{x\in X}|G_x|</math>.<br />
<br />
Due to the above lemma, <math>|G_x|=\frac{|G|}{|Gx|}</math>, thus<br />
:<math>\sum_{x\in X}|G_x|=\sum_{x\in X}\frac{|G|}{|Gx|}=|G|\sum_{x\in X}\frac{1}{|Gx|}</math>.<br />
We may enumerate the <math>x\in X</math> in the sum by first enumerating the orbits and then the elements in each orbit. Denote the orbits by <math>X_1,X_2,\ldots,X_{|X/G|}</math>. They forms a partition of <math>X</math>, and for any <math>X_i</math> and every <math>x\in X_i</math>, <math>X_i=Gx</math>. Thus,<br />
:<math>|G|\sum_{x\in X}\frac{1}{|Gx|}=|G|\sum_{i=1}^{|X/G|}\sum_{x\in X_i}\frac{1}{|Gx|}=|G|\sum_{i=1}^{|X/G|}\sum_{x\in X_i}\frac{1}{|X_i|}=|G|\sum_{i=1}^{|X/G|}1=|G|{|X/G|}</math>.<br />
Combining everything together<br />
:<math>\sum_{\pi\in G}|X_\pi|=\sum_{x\in X}|G_x|=|G|\sum_{x\in X}\frac{1}{|Gx|}=|G|{|X/G|}</math>,<br />
which gives us that the number of orbits is<br />
:<math>{|X/G|}=\frac{1}{|G|}\sum_{\pi\in G}|X_\pi|</math>.<br />
}}<br />
<br />
==Pólya's Theory of Counting ==<br />
=== The cycle index ===<br />
Suppose we want to count the number of ways to color <math>n</math> objects using up to <math>m</math> colors, discounting symmetries on the objects described by a group <math>G</math>. If a coloring <math>x:[n]\rightarrow[m]</math> is invariant under the action of a permutation <math>\pi\in G</math>, then every position in the same cycle of <math>\pi</math> must have the same color. Therefore, if <math>\pi</math> is decomposed to <math>k</math> disjoint cycles, the number of colorings invariant under the action of <math>\pi</math> is <math>|X_\pi|=m^k</math>.<br />
<br />
We define the cycle index of a permutation group <math>G</math>.<br />
For a permutation <math>\pi\in G</math> of <math>[n]</math>, if <math>\pi</math> is a product of <math>k</math> cycles, and the <math>i</math>th cycle has length <math>\ell_i</math>, let<br />
:<math>M_\pi(x_1,x_2,\ldots,x_n)=\prod_{i=1}^k x_{\ell_i}</math>.<br />
The '''cycle index''' of <math>G</math> is defined by <br />
:<math>P_G(x_1,x_2,\ldots,x_n)=\frac{1}{|G|}\sum_{\pi\in G}M_\pi(x_1,x_2,\ldots,x_n)</math>.<br />
<br />
Due to Burnside's lemma, the number of equivalent classes of <math>m</math>-colorings of <math>n</math> objects, discounting the symmetries described by permutation group <math>G</math>, is given by<br />
:<math>P_G(\underbrace{m,m,\ldots,m}_{n})</math><br />
<br />
=== Pólya's enumeration formula ===<br />
For any tuple <math>\mathbf{v}=(n_1,n_2,\ldots,n_m)</math> of nonnegative integers satisfying that <math>n_1+n_2+\cdots +n_m=n</math>, let <math>a_{\mathbf{v}}</math> represent the number of nonequivalent (with respect to a permutation group <math>G</math>) <math>m</math>-colorings of the <math>n</math> objects, where the <math>i</math>th color occurs precisely <math>n_i</math> times. The '''pattern inventory''' is the (multivariate) generating function for the sequence <math>a_{\mathbf{v}}</math>, defined as<br />
:<math>F_G(y_1,y_2,\ldots,y_m)=\sum_{\mathbf{v}}a_{\mathbf{v}}y_1^{n_1}y_2^{n_2}\cdots y_m^{n_m}</math>,<br />
where the sum runs over all <math>\mathbf{v}=(n_1,n_2,\ldots,n_m)</math> satisfying that <math>n_1+n_2+\cdots +n_m=n</math> and <math>n_i\ge 0, 1\le i\le m</math>.<br />
<br />
{{Theorem|Theorem (Pólya's enumeration formula)|<br />
:Let <math>G</math> be a permutation group. The pattern inventory for the nonequivalent <math>m</math>-colorings of <math>n</math> objects under the action of <math>G</math> is:<br />
::<math>F_G(y_1,y_2,\ldots,y_m)=P_G\left(\sum_{i=1}^m y_i, \sum_{i=1}^m y_i^2,\ldots, \sum_{i=1}^m y_i^n\right)</math>.<br />
}}<br />
{{Proof|<br />
Let <math>\mathbf{v}=(n_1,\ldots,n_m)</math> be a vector of nonnegative integers satisfying that <math>n_1+\cdots+n_m=n</math>, and let <math>a_{\mathbf{v}}</math> represent the number of nonequivalent (with respect to a permutation group <math>G</math>) <math>m</math>-colorings of the <math>n</math> objects, such that the <math>i</math>th color occurs precisely <math>n_i</math> times.<br />
<br />
The set of configurations is now<br />
:<math>X^{\mathbf{v}}=\{x:[n]\rightarrow[m]\mid \forall i\in[m], x^{-1}(i)=n_i\}</math>,<br />
which contains all <math>m</math>-colorings of the <math>n</math> objects such that the <math>i</math>th color occurs precisely <math>n_i</math> times, without considering symmetries.<br />
<br />
For every <math>\pi\in G</math>, the invariant set is now<br />
:<math>X_\pi^{\mathbf{v}}=\{x\in X^{\mathbf{v}}\mid \pi\circ x=x\}</math>.<br />
<br />
;Claim 1<nowiki>:</nowiki> <math>a_{\mathbf{v}}=\frac{1}{|G|}\sum_{\pi\in G}|X_\pi^{\mathbf{v}}|</math>.<br />
{{Proofbox|<br />
;Proof of Claim 1.<br />
For <math>\mathbf{v}=(n_1,\ldots,n_m)</math>, given any permutation <math>\pi\in G</math>, <math>|X^{\mathbf{v}}_\pi|</math> gives the number of colorings <math>x</math> in <math>X^\mathbf{v}</math> invariant under action of <math>\pi</math>, and <math>a_\mathbf{v}</math> is the number of orbits of <math>X^\mathbf{v}</math> induced by the action of permutation group <math>G</math>. Due to Burnside's lemma,<br />
:<math>a_{\mathbf{v}}=\frac{1}{|G|}\sum_{\pi\in G}|X_\pi^{\mathbf{v}}|</math>.<br />
}}<br />
;Claim 2<nowiki>:</nowiki> <math>M_\pi\left(\sum_{i=1}^m y_i, \sum_{i=1}^my_i^2,\ldots,\sum_{i=1}^my_i^n\right)=\sum_{\mathbf{v}=(n_1,\ldots,n_m)\atop n_1+\cdots+n_m=n}|X^{\mathbf{v}}_\pi|y_1^{n_1}y_2^{n_2}\cdots y_m^{n_m}</math>.<br />
{{Proofbox|<br />
;Proof of Claim 2.<br />
Supposed that a permutation <math>\pi\in G</math> can be represented as a composition of <math>k</math> cycles, the <math>i</math>th cycle of length <math>\ell_i</math>.<br />
:<math>\pi=\overbrace{\underbrace{(\cdots\cdots)}_{\ell_1}\underbrace{(\cdots)}_{\ell_2}\cdots\underbrace{(\cdots)}_{\ell_k}}^{k \text{ cycles}}</math><br />
The permutation <math>\pi</math> does not change a coloring <math>x</math>, if and only if every cycle of <math>\pi</math> are assigned the same color. Then <math>|X^{\mathbf{v}}_\pi|</math> equals the number of <math>m</math>-colorings of <math>k</math> cycles, where the <math>i</math>th cycle is of length <math>\ell_i</math>, satisfying that the <math>i</math>th color occurs precisely <math>n_i</math> times. The following generalized version of multinomial theorem generates <math>|X^{\mathbf{v}}_\pi|</math> for all <math>\mathbf{v}=(n_1,\ldots,n_m)</math>.<br />
:<math><br />
\begin{align}<br />
&\quad\, (y_1^{\ell_1}+y_2^{\ell_1}+\cdots+y_m^{\ell_1})(y_1^{\ell_2}+y_2^{\ell_2}+\cdots+y_m^{\ell_2})\cdots(y_1^{\ell_m}+y_2^{\ell_m}+\cdots+y_m^{\ell_m})\\<br />
&=\sum_{\mathbf{v}=(n_1,\ldots,n_m)\atop n_1+\cdots+n_m=n}|X^{\mathbf{v}}_\pi|y_1^{n_1}y_2^{n_2}\cdots y_m^{n_m}.<br />
\end{align}<br />
</math><br />
<br />
On the other hand,<br />
:<math>\begin{align}<br />
&\quad\, (y_1^{\ell_1}+y_2^{\ell_1}+\cdots+y_m^{\ell_1})(y_1^{\ell_2}+y_2^{\ell_2}+\cdots+y_m^{\ell_2})\cdots(y_1^{\ell_m}+y_2^{\ell_m}+\cdots+y_m^{\ell_m})\\<br />
&=M_\pi\left(\sum_{i=1}^m y_i, \sum_{i=1}^my_i^2,\ldots,\sum_{i=1}^my_i^n\right).<br />
\end{align}</math><br />
Therefore,<br />
:<math>M_\pi\left(\sum_{i=1}^m y_i, \sum_{i=1}^my_i^2,\ldots,\sum_{i=1}^my_i^n\right)=\sum_{\mathbf{v}=(n_1,\ldots,n_m)\atop n_1+\cdots+n_m=n}|X^{\mathbf{v}}_\pi|y_1^{n_1}y_2^{n_2}\cdots y_m^{n_m}</math>.<br />
}}<br />
<br />
Combining everything together,<br />
:<math><br />
\begin{align}<br />
&\quad\, F_G(y_1,y_2,\ldots,y_m)\\<br />
&=\sum_{\mathbf{v}=(n_1,\ldots,n_m)\atop n_1+\cdots+n_m=n}a_{\mathbf{v}}y_1^{n_1}y_2^{n_2}\cdots y_m^{n_m}\\<br />
&=\sum_{\mathbf{v}=(n_1,\ldots,n_m)\atop n_1+\cdots+n_m=n}\left(\frac{1}{|G|}\sum_{\pi\in G}|X_\pi^{\mathbf{v}}|\right)y_1^{n_1}y_2^{n_2}\cdots y_m^{n_m}<br />
&\quad\text{(due to Claim 1)}\\<br />
&=\frac{1}{|G|}\sum_{\pi\in G}\sum_{\mathbf{v}=(n_1,\ldots,n_m)\atop n_1+\cdots+n_m=n} |X_\pi^{\mathbf{v}}|y_1^{n_1}y_2^{n_2}\cdots y_m^{n_m}\\<br />
&=\frac{1}{|G|}\sum_{\pi\in G}M_\pi\left(\sum_{i=1}^m y_i, \sum_{i=1}^my_i^2,\ldots,\sum_{i=1}^my_i^n\right)<br />
&\quad\text{(due to Claim 2)}\\<br />
&=P_G\left(\sum_{i=1}^m y_i, \sum_{i=1}^m y_i^2,\ldots, \sum_{i=1}^m y_i^n\right).<br />
\end{align}<br />
</math><br />
}}</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6_(Spring_2024)&diff=12206
组合数学 (Spring 2024)
2024-03-27T04:26:46Z
<p>Etone: /* Lecture Notes */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>组合数学 <br><br />
Combinatorics</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 尹一通<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 计算机系 804<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday, 2pm-4pm <br> 仙Ⅱ-211<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = TBA <br>计算机系 804<br />
|header9 = Textbook<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = [[File:LW-combinatorics.jpeg|border|100px]]<br />
|header11 =<br />
|label11 = <br />
|data11 = van Lint and Wilson. <br> ''A course in Combinatorics, 2nd ed.'', <br> Cambridge Univ Press, 2001.<br />
|header12 =<br />
|label12 = <br />
|data12 = [[File:Jukna_book.jpg|border|100px]]<br />
|header13 =<br />
|label13 = <br />
|data13 = Jukna. ''Extremal Combinatorics: <br> With Applications in Computer Science,<br>2nd ed.'', Springer, 2011.<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Combinatorics'' class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* '''(2024/03/19)'''<font color=red size=4> 第一次作业已发布</font>,请在 2024/04/03 上课之前提交到 [mailto:njucomb24@163.com njucomb24@163.com] (文件名为'学号_姓名_A1.pdf').<br />
<br />
= Course info =<br />
* '''Instructor ''': 尹一通 ([http://tcs.nju.edu.cn/yinyt/ homepage])<br />
:*'''email''': yinyt@nju.edu.cn<br />
:*'''office''': 计算机系 804 <br />
* '''Teaching assistant''':<br />
** [https://lhy-gispzjz.github.io 刘弘洋] ([mailto:liuhongyang@smail.nju.edu.cn liuhongyang@smail.nju.edu.cn])<br />
** [https://wcysai.com 王淳扬] ([mailto:wcysai@smail.nju.edu.cn wcysai@smail.nju.edu.cn])<br />
* '''Class meeting''': Wednesday, 2pm-4pm, 仙Ⅱ-211.<br />
* '''Office hour''': TBA<br />
:* '''QQ群''': 709281027 (加入时需报姓名、专业、学号)<br />
<br />
= Syllabus =<br />
<br />
=== 先修课程 Prerequisites ===<br />
* 离散数学(Discrete Mathematics)<br />
* 线性代数(Linear Algebra)<br />
* 概率论(Probability Theory)<br />
<br />
=== Course materials ===<br />
* [[组合数学 (Spring 2024)/Course materials|<font size=3>教材和参考书清单</font>]]<br />
<br />
=== 成绩 Grades ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩 (≥ 60%) 和期末考试成绩 (≤ 40%) 综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
* [[组合数学 (Fall 2024)/Problem Set 1|Problem Set 1]]<br />
<br />
= Lecture Notes =<br />
# [[组合数学 (Fall 2024)/Basic enumeration|Basic enumeration | 基本计数]] ([http://tcs.nju.edu.cn/slides/comb2024/BasicEnumeration.pdf slides])<br />
# [[组合数学 (Fall 2024)/Generating functions|Generating functions | 生成函数]] ([http://tcs.nju.edu.cn/slides/comb2024/GeneratingFunction.pdf slides])<br />
# [[组合数学 (Fall 2024)/Sieve methods|Sieve methods | 筛法]] ([http://tcs.nju.edu.cn/slides/comb2024/PIE.pdf slides])<br />
# [[组合数学 (Fall 2024)/Pólya's theory of counting|Pólya's theory of counting | Pólya计数法]]<br />
<br />
= Resources =<br />
* [http://math.mit.edu/~fox/MAT307.html Combinatorics course] by Jacob Fox<br />
* [https://yufeizhao.com/pm/ Probabilistic Methods in Combinatorics] and [https://yufeizhao.com/gtacbook/ Graph Theory and Additive Combinatorics] by Yufei Zhao<br />
* [https://www.math.uvic.ca/~noelj/combinatoricsLectures.html Combinatorics Lecture Videos online]<br />
* [https://www.math.ucla.edu/~pak/lectures/Math-Videos/comb-videos.htm Collection of Combinatorics Videos]<br />
<br />
= Concepts =<br />
* TBA</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6_(Spring_2024)&diff=12205
组合数学 (Spring 2024)
2024-03-26T18:55:01Z
<p>Etone: /* Lecture Notes */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>组合数学 <br><br />
Combinatorics</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 尹一通<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 计算机系 804<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday, 2pm-4pm <br> 仙Ⅱ-211<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = TBA <br>计算机系 804<br />
|header9 = Textbook<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = [[File:LW-combinatorics.jpeg|border|100px]]<br />
|header11 =<br />
|label11 = <br />
|data11 = van Lint and Wilson. <br> ''A course in Combinatorics, 2nd ed.'', <br> Cambridge Univ Press, 2001.<br />
|header12 =<br />
|label12 = <br />
|data12 = [[File:Jukna_book.jpg|border|100px]]<br />
|header13 =<br />
|label13 = <br />
|data13 = Jukna. ''Extremal Combinatorics: <br> With Applications in Computer Science,<br>2nd ed.'', Springer, 2011.<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Combinatorics'' class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* '''(2024/03/19)'''<font color=red size=4> 第一次作业已发布</font>,请在 2024/04/03 上课之前提交到 [mailto:njucomb24@163.com njucomb24@163.com] (文件名为'学号_姓名_A1.pdf').<br />
<br />
= Course info =<br />
* '''Instructor ''': 尹一通 ([http://tcs.nju.edu.cn/yinyt/ homepage])<br />
:*'''email''': yinyt@nju.edu.cn<br />
:*'''office''': 计算机系 804 <br />
* '''Teaching assistant''':<br />
** [https://lhy-gispzjz.github.io 刘弘洋] ([mailto:liuhongyang@smail.nju.edu.cn liuhongyang@smail.nju.edu.cn])<br />
** [https://wcysai.com 王淳扬] ([mailto:wcysai@smail.nju.edu.cn wcysai@smail.nju.edu.cn])<br />
* '''Class meeting''': Wednesday, 2pm-4pm, 仙Ⅱ-211.<br />
* '''Office hour''': TBA<br />
:* '''QQ群''': 709281027 (加入时需报姓名、专业、学号)<br />
<br />
= Syllabus =<br />
<br />
=== 先修课程 Prerequisites ===<br />
* 离散数学(Discrete Mathematics)<br />
* 线性代数(Linear Algebra)<br />
* 概率论(Probability Theory)<br />
<br />
=== Course materials ===<br />
* [[组合数学 (Spring 2024)/Course materials|<font size=3>教材和参考书清单</font>]]<br />
<br />
=== 成绩 Grades ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩 (≥ 60%) 和期末考试成绩 (≤ 40%) 综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
* [[组合数学 (Fall 2024)/Problem Set 1|Problem Set 1]]<br />
<br />
= Lecture Notes =<br />
# [[组合数学 (Fall 2024)/Basic enumeration|Basic enumeration | 基本计数]] ([http://tcs.nju.edu.cn/slides/comb2024/BasicEnumeration.pdf slides])<br />
# [[组合数学 (Fall 2024)/Generating functions|Generating functions | 生成函数]] ([http://tcs.nju.edu.cn/slides/comb2024/GeneratingFunction.pdf slides])<br />
# [[组合数学 (Fall 2024)/Sieve methods|Sieve methods | 筛法]] ([http://tcs.nju.edu.cn/slides/comb2024/PIE.pdf slides])<br />
<br />
= Resources =<br />
* [http://math.mit.edu/~fox/MAT307.html Combinatorics course] by Jacob Fox<br />
* [https://yufeizhao.com/pm/ Probabilistic Methods in Combinatorics] and [https://yufeizhao.com/gtacbook/ Graph Theory and Additive Combinatorics] by Yufei Zhao<br />
* [https://www.math.uvic.ca/~noelj/combinatoricsLectures.html Combinatorics Lecture Videos online]<br />
* [https://www.math.ucla.edu/~pak/lectures/Math-Videos/comb-videos.htm Collection of Combinatorics Videos]<br />
<br />
= Concepts =<br />
* TBA</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)&diff=12204
概率论与数理统计 (Spring 2024)
2024-03-25T09:59:18Z
<p>Etone: /* Concepts */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>'''概率论与数理统计'''<br><br />
'''Probability Theory''' <br> & '''Mathematical Statistics'''</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = '''尹一通'''<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4 = office<br />
|data4 = 计算机系 804<br />
|header5 = <br />
|label5 = <br />
|data5 = '''刘景铖'''<br />
|header6 = <br />
|label6 = Email<br />
|data6 = liu@nju.edu.cn <br />
|header7 =<br />
|label7 = office<br />
|data7 = 计算机系 516<br />
|header8 = Class<br />
|label8 = <br />
|data8 = <br />
|header9 =<br />
|label9 = Class meeting<br />
|data9 = Monday, 2pm-4pm<br><br />
Wednesday (双), 10am-12pm<br><br />
仙Ⅰ-204<br />
|header10=<br />
|label10 = Office hour<br />
|data10 = Monday, 4pm-5pm <br>计算机系 804(尹一通)<br>计算机系 516(刘景铖)<br />
|header11= Textbook<br />
|label11 = <br />
|data11 = <br />
|header12=<br />
|label12 = <br />
|data12 = [[File:概率导论.jpeg|border|100px]]<br />
|header13=<br />
|label13 = <br />
|data13 = '''概率导论'''(第2版·修订版)<br> Dimitri P. Bertsekas and John N. Tsitsiklis<br> 郑忠国 童行伟 译;人民邮电出版社 (2022)<br />
|header14=<br />
|label14 = <br />
|data14 = [[File:Grimmett_probability.jpg|border|100px]]<br />
|header15=<br />
|label15 = <br />
|data15 = '''Probability and Random Processes''' (4E) <br> Geoffrey Grimmett and David Stirzaker <br> Oxford University Press (2020)<br />
|header16=<br />
|label16 = <br />
|data16 = [[File:Probability_and_Computing_2ed.jpg|border|100px]]<br />
|header17=<br />
|label17 = <br />
|data17 = '''Probability and Computing''' (2E) <br> Michael Mitzenmacher and Eli Upfal <br> Cambridge University Press (2017)<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Probability Theory and Mathematical Statistics'' (概率论与数理统计) class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* TBA<br />
<br />
= Course info =<br />
* '''Instructor ''': <br />
:* [http://tcs.nju.edu.cn/yinyt/ 尹一通]:[mailto:yinyt@nju.edu.cn <yinyt@nju.edu.cn>],计算机系 804 <br />
:* [https://liuexp.github.io 刘景铖]:[mailto:liu@nju.edu.cn <liu@nju.edu.cn>],计算机系 516 <br />
* '''Teaching assistant''':<br />
** [https://sites.google.com/view/xinyuanzhang 张昕渊]:[mailto:zhangxy@smail.nju.edu.cn <zhangxy@smail.nju.edu.cn>],计算机系 410<br />
** 邹宗瑞:[mailto:zou.zongrui@smail.nju.edu.cn <zou.zongrui@smail.nju.edu.cn>],计算机系 410<br />
* '''Class meeting''':<br />
** 周一:2pm-4pm,仙Ⅰ-204<br />
** 周三(双):10am-12pm,仙Ⅰ-204<br />
* '''Office hour''': <br />
:* Monday, 4pm-5pm, 计算机系 804(尹一通)<br />
:* Tuesday, 3pm-4pm, 计算机系 516(刘景铖)<br />
:* '''QQ群''': 629856946(申请加入需提供姓名、院系、学号)<br />
<br />
= Syllabus =<br />
课程内容分为三大部分:<br />
* '''经典概率论''':概率空间、随机变量及其数字特征、多维与连续随机变量、极限定理等内容<br />
* '''概率与计算''':测度集中现象 (concentration of measure)、概率法 (the probabilistic method)、离散随机过程的相关专题<br />
* '''数理统计''':参数估计、假设检验、贝叶斯估计、线性回归等统计推断等概念<br />
<br />
对于第一和第二部分,要求清楚掌握基本概念,深刻理解关键的现象与规律以及背后的原理,并可以灵活运用所学方法求解相关问题。对于第三部分,要求熟悉数理统计的若干基本概念,以及典型的统计模型和统计推断问题。<br />
<br />
经过本课程的训练,力求使学生能够熟悉掌握概率的语言,并会利用概率思维来理解客观世界并对其建模,以及驾驭概率的数学工具来分析和求解专业问题。<br />
<br />
=== 教材与参考书 Course Materials ===<br />
* '''[BT]''' 概率导论(第2版·修订版),[美]伯特瑟卡斯(Dimitri P.Bertsekas)[美]齐齐克利斯(John N.Tsitsiklis)著,郑忠国 童行伟 译,人民邮电出版社(2022)。<br />
* '''[GS]''' ''Probability and Random Processes'', by Geoffrey Grimmett and David Stirzaker; Oxford University Press; 4th edition (2020).<br />
* '''[MU]''' ''Probability and Computing: Randomization and Probabilistic Techniques in Algorithms and Data Analysis'', by Michael Mitzenmacher, Eli Upfal; Cambridge University Press; 2nd edition (2017).<br />
<br />
=== 成绩 Grading Policy ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩和期末考试成绩综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
*[[概率论与数理统计 (Spring 2024)/Problem Set 1|Problem Set 1]] 请在 2024/4/3 上课之前(10am UTC+8)提交到 [mailto:pr2024_nju@163.com pr2024_nju@163.com] (文件名为'<font color=red >学号_姓名_A1.pdf</font>').<br />
<br />
= Lectures =<br />
# [http://tcs.nju.edu.cn/slides/prob2024/Intro.pdf 课程简介]<br />
# [http://tcs.nju.edu.cn/slides/prob2024/ProbSpace.pdf 概率空间]<br />
#* 阅读:'''[BT] 第1章''' 或 '''[GS] Chapter 1'''<br />
#* [[概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm| Karger's min-cut algorithm]]<br />
# [http://tcs.nju.edu.cn/slides/prob2024/RandVar.pdf 随机变量]<br />
#* 阅读:'''[BT] 第2章''' 或 '''[GS] Chapter 2, Sections 3.1~3.5, 3.7'''<br />
#* 阅读:'''[MU] Chapter 2'''<br />
#* the [http://tcs.nju.edu.cn/slides/prob2024/discrete-pmf.nb '''Mathematica notebook file'''] for the PMFs of basic discrete distributions<br />
<br />
= Concepts =<br />
* [https://plato.stanford.edu/entries/probability-interpret/ Interpretations of probability]<br />
* [https://en.wikipedia.org/wiki/History_of_probability History of probability]<br />
* Example problems:<br />
** [https://dornsifecms.usc.edu/assets/sites/520/docs/VonNeumann-ams12p36-38.pdf von Neumann's Bernoulli factory] and other [https://peteroupc.github.io/bernoulli.html Bernoulli factory algorithms]<br />
** [https://en.wikipedia.org/wiki/Boy_or_Girl_paradox Boy or Girl paradox]<br />
** [https://en.wikipedia.org/wiki/Monty_Hall_problem Monty Hall problem]<br />
** [https://en.wikipedia.org/wiki/Bertrand_paradox_(probability) Bertrand paradox]<br />
** [https://en.wikipedia.org/wiki/Hard_spheres Hard spheres model] and [https://en.wikipedia.org/wiki/Ising_model Ising model]<br />
** [https://en.wikipedia.org/wiki/PageRank ''PageRank''] and stationary [https://en.wikipedia.org/wiki/Random_walk random walk]<br />
** [https://en.wikipedia.org/wiki/Diffusion_process Diffusion process] and [https://en.wikipedia.org/wiki/Diffusion_model diffusion model]<br />
*[https://en.wikipedia.org/wiki/Probability_space Probability space]<br />
** [https://en.wikipedia.org/wiki/Sample_space Sample space]<br />
** [https://en.wikipedia.org/wiki/Event_(probability_theory) Event] and [https://en.wikipedia.org/wiki/Σ-algebra <math>\sigma</math>-algebra]<br />
** Kolmogorov's [https://en.wikipedia.org/wiki/Probability_axioms axioms of probability]<br />
* [https://en.wikipedia.org/wiki/Discrete_uniform_distribution Classical] and [https://en.wikipedia.org/wiki/Geometric_probability goemetric probability]<br />
* [https://en.wikipedia.org/wiki/Boole%27s_inequality Union bound]<br />
** [https://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle Inclusion-Exclusion principle]<br />
** [https://en.wikipedia.org/wiki/Boole%27s_inequality#Bonferroni_inequalities Bonferroni inequalities]<br />
* [https://en.wikipedia.org/wiki/Conditional_probability Conditional probability]<br />
** [https://en.wikipedia.org/wiki/Chain_rule_(probability) Chain rule]<br />
** [https://en.wikipedia.org/wiki/Law_of_total_probability Law of total probability]<br />
** [https://en.wikipedia.org/wiki/Bayes%27_theorem Bayes' law]<br />
* [https://en.wikipedia.org/wiki/Independence_(probability_theory) Independence] <br />
** [https://en.wikipedia.org/wiki/Pairwise_independence Pairwise independence]<br />
* [https://en.wikipedia.org/wiki/Random_variable Random variable]<br />
** [https://en.wikipedia.org/wiki/Cumulative_distribution_function Cumulative distribution function]<br />
** [https://en.wikipedia.org/wiki/Probability_mass_function Probability mass function]<br />
** [https://en.wikipedia.org/wiki/Probability_density_function Probability density function]<br />
* [https://en.wikipedia.org/wiki/Multivariate_random_variable Random vector]<br />
** [https://en.wikipedia.org/wiki/Joint_probability_distribution Joint probability distribution]<br />
** [https://en.wikipedia.org/wiki/Conditional_probability_distribution Conditional probability distribution]<br />
** [https://en.wikipedia.org/wiki/Marginal_distribution Marginal distribution]<br />
* Some '''discrete''' probability distributions<br />
** [https://en.wikipedia.org/wiki/Bernoulli_trial Bernoulli trial] and [https://en.wikipedia.org/wiki/Bernoulli_distribution Bernoulli distribution]<br />
** [https://en.wikipedia.org/wiki/Discrete_uniform_distribution Discrete uniform distribution]<br />
** [https://en.wikipedia.org/wiki/Binomial_distribution Binomial distribution]<br />
** [https://en.wikipedia.org/wiki/Geometric_distribution Geometric distribution]<br />
** [https://en.wikipedia.org/wiki/Negative_binomial_distribution Negative binomial distribution]<br />
** [https://en.wikipedia.org/wiki/Hypergeometric_distribution Hypergeometric distribution]<br />
** [https://en.wikipedia.org/wiki/Poisson_distribution Poisson distribution]<br />
** and [https://en.wikipedia.org/wiki/List_of_probability_distributions#Discrete_distributions others]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)&diff=12203
概率论与数理统计 (Spring 2024)
2024-03-25T09:58:33Z
<p>Etone: /* Lectures */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>'''概率论与数理统计'''<br><br />
'''Probability Theory''' <br> & '''Mathematical Statistics'''</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = '''尹一通'''<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4 = office<br />
|data4 = 计算机系 804<br />
|header5 = <br />
|label5 = <br />
|data5 = '''刘景铖'''<br />
|header6 = <br />
|label6 = Email<br />
|data6 = liu@nju.edu.cn <br />
|header7 =<br />
|label7 = office<br />
|data7 = 计算机系 516<br />
|header8 = Class<br />
|label8 = <br />
|data8 = <br />
|header9 =<br />
|label9 = Class meeting<br />
|data9 = Monday, 2pm-4pm<br><br />
Wednesday (双), 10am-12pm<br><br />
仙Ⅰ-204<br />
|header10=<br />
|label10 = Office hour<br />
|data10 = Monday, 4pm-5pm <br>计算机系 804(尹一通)<br>计算机系 516(刘景铖)<br />
|header11= Textbook<br />
|label11 = <br />
|data11 = <br />
|header12=<br />
|label12 = <br />
|data12 = [[File:概率导论.jpeg|border|100px]]<br />
|header13=<br />
|label13 = <br />
|data13 = '''概率导论'''(第2版·修订版)<br> Dimitri P. Bertsekas and John N. Tsitsiklis<br> 郑忠国 童行伟 译;人民邮电出版社 (2022)<br />
|header14=<br />
|label14 = <br />
|data14 = [[File:Grimmett_probability.jpg|border|100px]]<br />
|header15=<br />
|label15 = <br />
|data15 = '''Probability and Random Processes''' (4E) <br> Geoffrey Grimmett and David Stirzaker <br> Oxford University Press (2020)<br />
|header16=<br />
|label16 = <br />
|data16 = [[File:Probability_and_Computing_2ed.jpg|border|100px]]<br />
|header17=<br />
|label17 = <br />
|data17 = '''Probability and Computing''' (2E) <br> Michael Mitzenmacher and Eli Upfal <br> Cambridge University Press (2017)<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Probability Theory and Mathematical Statistics'' (概率论与数理统计) class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* TBA<br />
<br />
= Course info =<br />
* '''Instructor ''': <br />
:* [http://tcs.nju.edu.cn/yinyt/ 尹一通]:[mailto:yinyt@nju.edu.cn <yinyt@nju.edu.cn>],计算机系 804 <br />
:* [https://liuexp.github.io 刘景铖]:[mailto:liu@nju.edu.cn <liu@nju.edu.cn>],计算机系 516 <br />
* '''Teaching assistant''':<br />
** [https://sites.google.com/view/xinyuanzhang 张昕渊]:[mailto:zhangxy@smail.nju.edu.cn <zhangxy@smail.nju.edu.cn>],计算机系 410<br />
** 邹宗瑞:[mailto:zou.zongrui@smail.nju.edu.cn <zou.zongrui@smail.nju.edu.cn>],计算机系 410<br />
* '''Class meeting''':<br />
** 周一:2pm-4pm,仙Ⅰ-204<br />
** 周三(双):10am-12pm,仙Ⅰ-204<br />
* '''Office hour''': <br />
:* Monday, 4pm-5pm, 计算机系 804(尹一通)<br />
:* Tuesday, 3pm-4pm, 计算机系 516(刘景铖)<br />
:* '''QQ群''': 629856946(申请加入需提供姓名、院系、学号)<br />
<br />
= Syllabus =<br />
课程内容分为三大部分:<br />
* '''经典概率论''':概率空间、随机变量及其数字特征、多维与连续随机变量、极限定理等内容<br />
* '''概率与计算''':测度集中现象 (concentration of measure)、概率法 (the probabilistic method)、离散随机过程的相关专题<br />
* '''数理统计''':参数估计、假设检验、贝叶斯估计、线性回归等统计推断等概念<br />
<br />
对于第一和第二部分,要求清楚掌握基本概念,深刻理解关键的现象与规律以及背后的原理,并可以灵活运用所学方法求解相关问题。对于第三部分,要求熟悉数理统计的若干基本概念,以及典型的统计模型和统计推断问题。<br />
<br />
经过本课程的训练,力求使学生能够熟悉掌握概率的语言,并会利用概率思维来理解客观世界并对其建模,以及驾驭概率的数学工具来分析和求解专业问题。<br />
<br />
=== 教材与参考书 Course Materials ===<br />
* '''[BT]''' 概率导论(第2版·修订版),[美]伯特瑟卡斯(Dimitri P.Bertsekas)[美]齐齐克利斯(John N.Tsitsiklis)著,郑忠国 童行伟 译,人民邮电出版社(2022)。<br />
* '''[GS]''' ''Probability and Random Processes'', by Geoffrey Grimmett and David Stirzaker; Oxford University Press; 4th edition (2020).<br />
* '''[MU]''' ''Probability and Computing: Randomization and Probabilistic Techniques in Algorithms and Data Analysis'', by Michael Mitzenmacher, Eli Upfal; Cambridge University Press; 2nd edition (2017).<br />
<br />
=== 成绩 Grading Policy ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩和期末考试成绩综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
*[[概率论与数理统计 (Spring 2024)/Problem Set 1|Problem Set 1]] 请在 2024/4/3 上课之前(10am UTC+8)提交到 [mailto:pr2024_nju@163.com pr2024_nju@163.com] (文件名为'<font color=red >学号_姓名_A1.pdf</font>').<br />
<br />
= Lectures =<br />
# [http://tcs.nju.edu.cn/slides/prob2024/Intro.pdf 课程简介]<br />
# [http://tcs.nju.edu.cn/slides/prob2024/ProbSpace.pdf 概率空间]<br />
#* 阅读:'''[BT] 第1章''' 或 '''[GS] Chapter 1'''<br />
#* [[概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm| Karger's min-cut algorithm]]<br />
# [http://tcs.nju.edu.cn/slides/prob2024/RandVar.pdf 随机变量]<br />
#* 阅读:'''[BT] 第2章''' 或 '''[GS] Chapter 2, Sections 3.1~3.5, 3.7'''<br />
#* 阅读:'''[MU] Chapter 2'''<br />
#* the [http://tcs.nju.edu.cn/slides/prob2024/discrete-pmf.nb '''Mathematica notebook file'''] for the PMFs of basic discrete distributions<br />
<br />
= Concepts =<br />
* [https://plato.stanford.edu/entries/probability-interpret/ Interpretations of probability]<br />
* [https://en.wikipedia.org/wiki/History_of_probability History of probability]<br />
* Example problems:<br />
** [https://dornsifecms.usc.edu/assets/sites/520/docs/VonNeumann-ams12p36-38.pdf von Neumann's Bernoulli factory] and other [https://peteroupc.github.io/bernoulli.html Bernoulli factory algorithms]<br />
** [https://en.wikipedia.org/wiki/Boy_or_Girl_paradox Boy or Girl paradox]<br />
** [https://en.wikipedia.org/wiki/Monty_Hall_problem Monty Hall problem]<br />
** [https://en.wikipedia.org/wiki/Bertrand_paradox_(probability) Bertrand paradox]<br />
** [https://en.wikipedia.org/wiki/Hard_spheres Hard spheres model] and [https://en.wikipedia.org/wiki/Ising_model Ising model]<br />
** [https://en.wikipedia.org/wiki/PageRank ''PageRank''] and stationary [https://en.wikipedia.org/wiki/Random_walk random walk]<br />
** [https://en.wikipedia.org/wiki/Diffusion_process Diffusion process] and [https://en.wikipedia.org/wiki/Diffusion_model diffusion model]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)&diff=12202
概率论与数理统计 (Spring 2024)
2024-03-25T09:58:24Z
<p>Etone: /* Lectures */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>'''概率论与数理统计'''<br><br />
'''Probability Theory''' <br> & '''Mathematical Statistics'''</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = '''尹一通'''<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4 = office<br />
|data4 = 计算机系 804<br />
|header5 = <br />
|label5 = <br />
|data5 = '''刘景铖'''<br />
|header6 = <br />
|label6 = Email<br />
|data6 = liu@nju.edu.cn <br />
|header7 =<br />
|label7 = office<br />
|data7 = 计算机系 516<br />
|header8 = Class<br />
|label8 = <br />
|data8 = <br />
|header9 =<br />
|label9 = Class meeting<br />
|data9 = Monday, 2pm-4pm<br><br />
Wednesday (双), 10am-12pm<br><br />
仙Ⅰ-204<br />
|header10=<br />
|label10 = Office hour<br />
|data10 = Monday, 4pm-5pm <br>计算机系 804(尹一通)<br>计算机系 516(刘景铖)<br />
|header11= Textbook<br />
|label11 = <br />
|data11 = <br />
|header12=<br />
|label12 = <br />
|data12 = [[File:概率导论.jpeg|border|100px]]<br />
|header13=<br />
|label13 = <br />
|data13 = '''概率导论'''(第2版·修订版)<br> Dimitri P. Bertsekas and John N. Tsitsiklis<br> 郑忠国 童行伟 译;人民邮电出版社 (2022)<br />
|header14=<br />
|label14 = <br />
|data14 = [[File:Grimmett_probability.jpg|border|100px]]<br />
|header15=<br />
|label15 = <br />
|data15 = '''Probability and Random Processes''' (4E) <br> Geoffrey Grimmett and David Stirzaker <br> Oxford University Press (2020)<br />
|header16=<br />
|label16 = <br />
|data16 = [[File:Probability_and_Computing_2ed.jpg|border|100px]]<br />
|header17=<br />
|label17 = <br />
|data17 = '''Probability and Computing''' (2E) <br> Michael Mitzenmacher and Eli Upfal <br> Cambridge University Press (2017)<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Probability Theory and Mathematical Statistics'' (概率论与数理统计) class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* TBA<br />
<br />
= Course info =<br />
* '''Instructor ''': <br />
:* [http://tcs.nju.edu.cn/yinyt/ 尹一通]:[mailto:yinyt@nju.edu.cn <yinyt@nju.edu.cn>],计算机系 804 <br />
:* [https://liuexp.github.io 刘景铖]:[mailto:liu@nju.edu.cn <liu@nju.edu.cn>],计算机系 516 <br />
* '''Teaching assistant''':<br />
** [https://sites.google.com/view/xinyuanzhang 张昕渊]:[mailto:zhangxy@smail.nju.edu.cn <zhangxy@smail.nju.edu.cn>],计算机系 410<br />
** 邹宗瑞:[mailto:zou.zongrui@smail.nju.edu.cn <zou.zongrui@smail.nju.edu.cn>],计算机系 410<br />
* '''Class meeting''':<br />
** 周一:2pm-4pm,仙Ⅰ-204<br />
** 周三(双):10am-12pm,仙Ⅰ-204<br />
* '''Office hour''': <br />
:* Monday, 4pm-5pm, 计算机系 804(尹一通)<br />
:* Tuesday, 3pm-4pm, 计算机系 516(刘景铖)<br />
:* '''QQ群''': 629856946(申请加入需提供姓名、院系、学号)<br />
<br />
= Syllabus =<br />
课程内容分为三大部分:<br />
* '''经典概率论''':概率空间、随机变量及其数字特征、多维与连续随机变量、极限定理等内容<br />
* '''概率与计算''':测度集中现象 (concentration of measure)、概率法 (the probabilistic method)、离散随机过程的相关专题<br />
* '''数理统计''':参数估计、假设检验、贝叶斯估计、线性回归等统计推断等概念<br />
<br />
对于第一和第二部分,要求清楚掌握基本概念,深刻理解关键的现象与规律以及背后的原理,并可以灵活运用所学方法求解相关问题。对于第三部分,要求熟悉数理统计的若干基本概念,以及典型的统计模型和统计推断问题。<br />
<br />
经过本课程的训练,力求使学生能够熟悉掌握概率的语言,并会利用概率思维来理解客观世界并对其建模,以及驾驭概率的数学工具来分析和求解专业问题。<br />
<br />
=== 教材与参考书 Course Materials ===<br />
* '''[BT]''' 概率导论(第2版·修订版),[美]伯特瑟卡斯(Dimitri P.Bertsekas)[美]齐齐克利斯(John N.Tsitsiklis)著,郑忠国 童行伟 译,人民邮电出版社(2022)。<br />
* '''[GS]''' ''Probability and Random Processes'', by Geoffrey Grimmett and David Stirzaker; Oxford University Press; 4th edition (2020).<br />
* '''[MU]''' ''Probability and Computing: Randomization and Probabilistic Techniques in Algorithms and Data Analysis'', by Michael Mitzenmacher, Eli Upfal; Cambridge University Press; 2nd edition (2017).<br />
<br />
=== 成绩 Grading Policy ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩和期末考试成绩综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
*[[概率论与数理统计 (Spring 2024)/Problem Set 1|Problem Set 1]] 请在 2024/4/3 上课之前(10am UTC+8)提交到 [mailto:pr2024_nju@163.com pr2024_nju@163.com] (文件名为'<font color=red >学号_姓名_A1.pdf</font>').<br />
<br />
= Lectures =<br />
# [http://tcs.nju.edu.cn/slides/prob2024/Intro.pdf 课程简介]<br />
# [http://tcs.nju.edu.cn/slides/prob2024/ProbSpace.pdf 概率空间]<br />
#* 阅读:'''[BT] 第1章''' 或 '''[GS] Chapter 1'''<br />
#* [[概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm| Karger's min-cut algorithm]]<br />
# [http://tcs.nju.edu.cn/slides/prob2024/RandVar.pdf 随机变量]<br />
#* 阅读:'''[BT] 第2章''' 或 '''[GS] Chapter 2, Sections 3.1~3.5, 3.7'''<br />
#* 阅读:'''[MU] Chapter 2'''<br />
#* the [http://tcs.nju.edu.cn/slides/prob2023/discrete-pmf.nb '''Mathematica notebook file'''] for the PMFs of basic discrete distributions<br />
<br />
= Concepts =<br />
* [https://plato.stanford.edu/entries/probability-interpret/ Interpretations of probability]<br />
* [https://en.wikipedia.org/wiki/History_of_probability History of probability]<br />
* Example problems:<br />
** [https://dornsifecms.usc.edu/assets/sites/520/docs/VonNeumann-ams12p36-38.pdf von Neumann's Bernoulli factory] and other [https://peteroupc.github.io/bernoulli.html Bernoulli factory algorithms]<br />
** [https://en.wikipedia.org/wiki/Boy_or_Girl_paradox Boy or Girl paradox]<br />
** [https://en.wikipedia.org/wiki/Monty_Hall_problem Monty Hall problem]<br />
** [https://en.wikipedia.org/wiki/Bertrand_paradox_(probability) Bertrand paradox]<br />
** [https://en.wikipedia.org/wiki/Hard_spheres Hard spheres model] and [https://en.wikipedia.org/wiki/Ising_model Ising model]<br />
** [https://en.wikipedia.org/wiki/PageRank ''PageRank''] and stationary [https://en.wikipedia.org/wiki/Random_walk random walk]<br />
** [https://en.wikipedia.org/wiki/Diffusion_process Diffusion process] and [https://en.wikipedia.org/wiki/Diffusion_model diffusion model]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Assignment_1,_Spring_2024&diff=12190
Assignment 1, Spring 2024
2024-03-20T02:40:08Z
<p>Etone: </p>
<hr />
<div>==Question #1==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the vertical-latitudinal distributions of the zonal mean temperature and zonal mean zonal wind of each seasons (at least the winter and summer mean), and briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
<font size="1.5">请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。</font><br />
<br />
==Question #2==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the horizontal distributions of the temperature and zonal wind at 850, 500 and 100 hPa. For temperature, please also plot the horizontal distributions at 1000 hPa. And briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
<font size="1.5">请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画出1000hPa)上的水平分布,并简述其分布特征和季节变化特征。</font><br />
<br />
==On the netcdf file==<br />
<br />
Netcdf (Network Common Data Form) is a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. The project homepage is hosted by the [https://www.unidata.ucar.edu/software/netcdf Unidata program] at the University Corporation for Atmospheric Research (UCAR). They are also the chief source of netCDF software, standards development, updates etc..<br />
[https://psl.noaa.gov/data/gridded_help/read-our-files.html methods to reading netcdf files]<br />
<br />
==Read .nc using Matlab==<br />
Since <font color="red"> Matlab 2008b </font> ,Matlab offers its own function to read and write .nc files. Here we provide a sample Matlab file to work with dataset stored as .nc files. For figures,Matlab offers multiple formats to save. You can choose the figure format to save from the drop-down of the popup window for figures,or you can use the command “print” to save figures(you may input "help print" for more help). For more info on Matlab, see [http://www.mathworks.com/help Matlab website].<br />
<br />
==Files to download==<br />
The dataset used for the homework are the monthly mean data from NCEP-DOE Reanalysis 2, with the time span from 1979/1 to 2009/12. For more info on the dataset, please go to the [https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html web]. Followings are the data and matlab files that you would need for the homework.<br />
<br />
NCEP-DOE monthly mean data of Temperature(1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/air.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/air_readme.txt ReadMe]<br />
<br />
NCEP-DOE monthly mean data of zonal wind U (1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/uwnd.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/uwnd_readme.txt ReadMe]<br />
<br />
NCEP-land mask(used to plot the land-sea boundary): [http://tcs.nju.edu.cn/yzhang/land.nc nc file]<br />
<br />
Matlab files for Questions 1 and 2: [http://tcs.nju.edu.cn/yzhang/sample_for_Q1.m matlab file for Q1], [http://tcs.nju.edu.cn/yzhang/sample_for_Q2.m matlab file for Q2]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Assignment_1,_Spring_2024&diff=12189
Assignment 1, Spring 2024
2024-03-20T02:38:46Z
<p>Etone: /* Question #2 */</p>
<hr />
<div>==Question #1==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the vertical-latitudinal distributions of the zonal mean temperature and zonal mean zonal wind of each seasons (at least the winter and summer mean), and briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
<font size="1.5">请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。</font><br />
<br />
==Question #2==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the horizontal distributions of the temperature and zonal wind at 850, 500 and 100 hPa. For temperature, please also plot the horizontal distributions at 1000 hPa. And briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
<font size="1.5">请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画出1000hPa)上的水平分布,并简述其分布特征和季节变化特征。</font><br />
<br />
==On the netcdf file==<br />
<br />
Netcdf (Network Common Data Form) is a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. The project homepage is hosted by the [https://www.unidata.ucar.edu/software/netcdf Unidata program] at the University Corporation for Atmospheric Research (UCAR). They are also the chief source of netCDF software, standards development, updates etc.。<br />
[https://psl.noaa.gov/data/gridded_help/read-our-files.html methods to reading netcdf files]<br />
<br />
==Read .nc using Matlab==<br />
Since <font color="red"> Matlab 2008b </font> ,Matlab offers its own function to read and write .nc files. Here we provide a sample Matlab file to work with dataset stored as .nc files. For figures,Matlab offers multiple formats to save. You can choose the figure format to save from the drop-down of the popup window for figures,or you can use the command “print” to save figures(you may input "help print" for more help). For more info on Matlab, see [http://www.mathworks.com/help Matlab website]。<br />
<br />
==Files to download==<br />
The dataset used for the homework are the monthly mean data from NCEP-DOE Reanalysis 2, with the time span from 1979/1 to 2009/12. For more info on the dataset, please go to the [https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html web]. Followings are the data and matlab files that you would need for the homework.<br />
<br />
NCEP-DOE monthly mean data of Temperature(1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/air.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/air_readme.txt ReadMe]<br />
<br />
NCEP-DOE monthly mean data of zonal wind U (1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/uwnd.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/uwnd_readme.txt ReadMe]<br />
<br />
NCEP-land mask(used to plot the land-sea boundary): [http://tcs.nju.edu.cn/yzhang/land.nc nc file]<br />
<br />
Matlab files for Questions 1 and 2: [http://tcs.nju.edu.cn/yzhang/sample_for_Q1.m matlab file for Q1], [http://tcs.nju.edu.cn/yzhang/sample_for_Q2.m matlab file for Q2]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Assignment_1,_Spring_2024&diff=12188
Assignment 1, Spring 2024
2024-03-20T02:38:05Z
<p>Etone: /* Question #1 */</p>
<hr />
<div>==Question #1==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the vertical-latitudinal distributions of the zonal mean temperature and zonal mean zonal wind of each seasons (at least the winter and summer mean), and briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
<font size="1.5">请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。</font><br />
<br />
==Question #2==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the horizontal distributions of the temperature and zonal wind at 850, 500 and 100 hPa. For temperature, please also plot the horizontal distributions at 1000 hPa. And briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画出1000hPa)上的水平分布,并简述其分布特征和季节变化特征。<br />
<br />
<br />
==On the netcdf file==<br />
<br />
Netcdf (Network Common Data Form) is a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. The project homepage is hosted by the [https://www.unidata.ucar.edu/software/netcdf Unidata program] at the University Corporation for Atmospheric Research (UCAR). They are also the chief source of netCDF software, standards development, updates etc.。<br />
[https://psl.noaa.gov/data/gridded_help/read-our-files.html methods to reading netcdf files]<br />
<br />
==Read .nc using Matlab==<br />
Since <font color="red"> Matlab 2008b </font> ,Matlab offers its own function to read and write .nc files. Here we provide a sample Matlab file to work with dataset stored as .nc files. For figures,Matlab offers multiple formats to save. You can choose the figure format to save from the drop-down of the popup window for figures,or you can use the command “print” to save figures(you may input "help print" for more help). For more info on Matlab, see [http://www.mathworks.com/help Matlab website]。<br />
<br />
==Files to download==<br />
The dataset used for the homework are the monthly mean data from NCEP-DOE Reanalysis 2, with the time span from 1979/1 to 2009/12. For more info on the dataset, please go to the [https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html web]. Followings are the data and matlab files that you would need for the homework.<br />
<br />
NCEP-DOE monthly mean data of Temperature(1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/air.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/air_readme.txt ReadMe]<br />
<br />
NCEP-DOE monthly mean data of zonal wind U (1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/uwnd.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/uwnd_readme.txt ReadMe]<br />
<br />
NCEP-land mask(used to plot the land-sea boundary): [http://tcs.nju.edu.cn/yzhang/land.nc nc file]<br />
<br />
Matlab files for Questions 1 and 2: [http://tcs.nju.edu.cn/yzhang/sample_for_Q1.m matlab file for Q1], [http://tcs.nju.edu.cn/yzhang/sample_for_Q2.m matlab file for Q2]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Assignment_1,_Spring_2024&diff=12187
Assignment 1, Spring 2024
2024-03-20T02:31:58Z
<p>Etone: /* Files to download */</p>
<hr />
<div>==Question #1==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the vertical-latitudinal distributions of the zonal mean temperature and zonal mean zonal wind of each seasons (at least the winter and summer mean), and briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。<br />
<br />
==Question #2==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the horizontal distributions of the temperature and zonal wind at 850, 500 and 100 hPa. For temperature, please also plot the horizontal distributions at 1000 hPa. And briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画出1000hPa)上的水平分布,并简述其分布特征和季节变化特征。<br />
<br />
<br />
==On the netcdf file==<br />
<br />
Netcdf (Network Common Data Form) is a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. The project homepage is hosted by the [https://www.unidata.ucar.edu/software/netcdf Unidata program] at the University Corporation for Atmospheric Research (UCAR). They are also the chief source of netCDF software, standards development, updates etc.。<br />
[https://psl.noaa.gov/data/gridded_help/read-our-files.html methods to reading netcdf files]<br />
<br />
==Read .nc using Matlab==<br />
Since <font color="red"> Matlab 2008b </font> ,Matlab offers its own function to read and write .nc files. Here we provide a sample Matlab file to work with dataset stored as .nc files. For figures,Matlab offers multiple formats to save. You can choose the figure format to save from the drop-down of the popup window for figures,or you can use the command “print” to save figures(you may input "help print" for more help). For more info on Matlab, see [http://www.mathworks.com/help Matlab website]。<br />
<br />
==Files to download==<br />
The dataset used for the homework are the monthly mean data from NCEP-DOE Reanalysis 2, with the time span from 1979/1 to 2009/12. For more info on the dataset, please go to the [https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html web]. Followings are the data and matlab files that you would need for the homework.<br />
<br />
NCEP-DOE monthly mean data of Temperature(1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/air.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/air_readme.txt ReadMe]<br />
<br />
NCEP-DOE monthly mean data of zonal wind U (1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/uwnd.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/uwnd_readme.txt ReadMe]<br />
<br />
NCEP-land mask(used to plot the land-sea boundary): [http://tcs.nju.edu.cn/yzhang/land.nc nc file]<br />
<br />
Matlab files for Questions 1 and 2: [http://tcs.nju.edu.cn/yzhang/sample_for_Q1.m matlab file for Q1], [http://tcs.nju.edu.cn/yzhang/sample_for_Q2.m matlab file for Q2]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Assignment_1,_Spring_2024&diff=12186
Assignment 1, Spring 2024
2024-03-20T02:30:18Z
<p>Etone: </p>
<hr />
<div>==Question #1==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the vertical-latitudinal distributions of the zonal mean temperature and zonal mean zonal wind of each seasons (at least the winter and summer mean), and briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。<br />
<br />
==Question #2==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the horizontal distributions of the temperature and zonal wind at 850, 500 and 100 hPa. For temperature, please also plot the horizontal distributions at 1000 hPa. And briefly describe the features of their spacial distributions and seasonal variations. <br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画出1000hPa)上的水平分布,并简述其分布特征和季节变化特征。<br />
<br />
<br />
==On the netcdf file==<br />
<br />
Netcdf (Network Common Data Form) is a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. The project homepage is hosted by the [https://www.unidata.ucar.edu/software/netcdf Unidata program] at the University Corporation for Atmospheric Research (UCAR). They are also the chief source of netCDF software, standards development, updates etc.。<br />
[https://psl.noaa.gov/data/gridded_help/read-our-files.html methods to reading netcdf files]<br />
<br />
==Read .nc using Matlab==<br />
Since <font color="red"> Matlab 2008b </font> ,Matlab offers its own function to read and write .nc files. Here we provide a sample Matlab file to work with dataset stored as .nc files. For figures,Matlab offers multiple formats to save. You can choose the figure format to save from the drop-down of the popup window for figures,or you can use the command “print” to save figures(you may input "help print" for more help). For more info on Matlab, see [http://www.mathworks.com/help Matlab website]。<br />
<br />
==Files to download==<br />
The dataset used for the homework are the monthly mean data from NCEP-DOE Reanalysis 2, with the time span from 1979/1 to 2009/12. For more info on the dataset, please go to the [https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html web]. Followings are the data and matlab files that you would need for the homework.<br />
<br />
NCEP-DOE monthly mean data of Temperature(1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/air.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/air_readme.txt Readme]<br />
<br />
NCEP-DOE monthly mean data of zonal wind U (1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/uwnd.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/uwnd_readme.txt Readme]<br />
<br />
NCEP-land mask(used to plot the land-sea boundary): [http://tcs.nju.edu.cn/yzhang/land.nc nc file]<br />
<br />
Matlab files for Questions 1 and 2: [http://tcs.nju.edu.cn/yzhang/sample_for_Q1.m matlab file for Q1], [http://tcs.nju.edu.cn/yzhang/sample_for_Q2.m matlab file for Q2]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Assignment_1,_Spring_2024&diff=12185
Assignment 1, Spring 2024
2024-03-20T02:26:53Z
<p>Etone: /* Question #1 */</p>
<hr />
<div>==Question #1==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the vertical-latitudinal distributions of the zonal mean temperature and zonal mean zonal wind of each seasons (at least the winter and summer mean), and briefly describe their features of spacial distributions and seasonal variations. <br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。<br />
<br />
==Question #2==<br />
<br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画出1000hPa)上的水平分布,并简述其分布特征和季节变化特征。<br />
<br />
<br />
==On the netcdf file==<br />
<br />
Netcdf (Network Common Data Form) is a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. The project homepage is hosted by the [https://www.unidata.ucar.edu/software/netcdf Unidata program] at the University Corporation for Atmospheric Research (UCAR). They are also the chief source of netCDF software, standards development, updates etc.。<br />
[https://psl.noaa.gov/data/gridded_help/read-our-files.html methods to reading netcdf files]<br />
<br />
==Read .nc using Matlab==<br />
Since <font color="red"> Matlab 2008b </font> ,Matlab offers its own function to read and write .nc files. Here we provide a sample Matlab file to work with dataset stored as .nc files. For figures,Matlab offers multiple formats to save. You can choose the figure format to save from the drop-down of the popup window for figures,or you can use the command “print” to save figures(you may input "help print" for more help). For more info on Matlab, see [http://www.mathworks.com/help Matlab website]。<br />
<br />
==Files to download==<br />
The dataset used for the homework are the monthly mean data from NCEP-DOE Reanalysis 2, with the time span from 1979/1 to 2009/12. For more info on the dataset, please go to the [https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html web]. Followings are the data and matlab files that you would need for the homework.<br />
<br />
NCEP-DOE monthly mean data of Temperature(1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/air.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/air_readme.txt Readme]<br />
<br />
NCEP-DOE monthly mean data of zonal wind U (1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/uwnd.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/uwnd_readme.txt Readme]<br />
<br />
NCEP-land mask(used to plot the land-sea boundary): [http://tcs.nju.edu.cn/yzhang/land.nc nc file]<br />
<br />
Matlab files for Questions 1 and 2: [http://tcs.nju.edu.cn/yzhang/sample_for_Q1.m matlab file for Q1], [http://tcs.nju.edu.cn/yzhang/sample_for_Q2.m matlab file for Q2]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Assignment_1,_Spring_2024&diff=12184
Assignment 1, Spring 2024
2024-03-20T02:26:45Z
<p>Etone: /* Question #1 */</p>
<hr />
<div>==Question #1==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the vertical-latitudinal distributions of the zonal mean temperature and zonal mean zonal wind of each seasons (at least the winter and summer mean), and briefly describe their features of spacial distributions and seasonal variations. <br />
<br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。<br />
<br />
==Question #2==<br />
<br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画出1000hPa)上的水平分布,并简述其分布特征和季节变化特征。<br />
<br />
<br />
==On the netcdf file==<br />
<br />
Netcdf (Network Common Data Form) is a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. The project homepage is hosted by the [https://www.unidata.ucar.edu/software/netcdf Unidata program] at the University Corporation for Atmospheric Research (UCAR). They are also the chief source of netCDF software, standards development, updates etc.。<br />
[https://psl.noaa.gov/data/gridded_help/read-our-files.html methods to reading netcdf files]<br />
<br />
==Read .nc using Matlab==<br />
Since <font color="red"> Matlab 2008b </font> ,Matlab offers its own function to read and write .nc files. Here we provide a sample Matlab file to work with dataset stored as .nc files. For figures,Matlab offers multiple formats to save. You can choose the figure format to save from the drop-down of the popup window for figures,or you can use the command “print” to save figures(you may input "help print" for more help). For more info on Matlab, see [http://www.mathworks.com/help Matlab website]。<br />
<br />
==Files to download==<br />
The dataset used for the homework are the monthly mean data from NCEP-DOE Reanalysis 2, with the time span from 1979/1 to 2009/12. For more info on the dataset, please go to the [https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html web]. Followings are the data and matlab files that you would need for the homework.<br />
<br />
NCEP-DOE monthly mean data of Temperature(1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/air.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/air_readme.txt Readme]<br />
<br />
NCEP-DOE monthly mean data of zonal wind U (1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/uwnd.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/uwnd_readme.txt Readme]<br />
<br />
NCEP-land mask(used to plot the land-sea boundary): [http://tcs.nju.edu.cn/yzhang/land.nc nc file]<br />
<br />
Matlab files for Questions 1 and 2: [http://tcs.nju.edu.cn/yzhang/sample_for_Q1.m matlab file for Q1], [http://tcs.nju.edu.cn/yzhang/sample_for_Q2.m matlab file for Q2]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Assignment_1,_Spring_2024&diff=12183
Assignment 1, Spring 2024
2024-03-20T02:26:31Z
<p>Etone: /* Question #1 */</p>
<hr />
<div>==Question #1==<br />
<br />
Please apply the multi-year (> 20 years) monthly mean NCEP/NCAR reanalysis data, plot the vertical-latitudinal distributions of the zonal mean temperature and zonal mean zonal wind of each seasons (at least the winter and summer mean), and briefly describe their features of spacial distributions and seasonal variations. <br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。<br />
<br />
==Question #2==<br />
<br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画出1000hPa)上的水平分布,并简述其分布特征和季节变化特征。<br />
<br />
<br />
==On the netcdf file==<br />
<br />
Netcdf (Network Common Data Form) is a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. The project homepage is hosted by the [https://www.unidata.ucar.edu/software/netcdf Unidata program] at the University Corporation for Atmospheric Research (UCAR). They are also the chief source of netCDF software, standards development, updates etc.。<br />
[https://psl.noaa.gov/data/gridded_help/read-our-files.html methods to reading netcdf files]<br />
<br />
==Read .nc using Matlab==<br />
Since <font color="red"> Matlab 2008b </font> ,Matlab offers its own function to read and write .nc files. Here we provide a sample Matlab file to work with dataset stored as .nc files. For figures,Matlab offers multiple formats to save. You can choose the figure format to save from the drop-down of the popup window for figures,or you can use the command “print” to save figures(you may input "help print" for more help). For more info on Matlab, see [http://www.mathworks.com/help Matlab website]。<br />
<br />
==Files to download==<br />
The dataset used for the homework are the monthly mean data from NCEP-DOE Reanalysis 2, with the time span from 1979/1 to 2009/12. For more info on the dataset, please go to the [https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html web]. Followings are the data and matlab files that you would need for the homework.<br />
<br />
NCEP-DOE monthly mean data of Temperature(1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/air.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/air_readme.txt Readme]<br />
<br />
NCEP-DOE monthly mean data of zonal wind U (1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/uwnd.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/uwnd_readme.txt Readme]<br />
<br />
NCEP-land mask(used to plot the land-sea boundary): [http://tcs.nju.edu.cn/yzhang/land.nc nc file]<br />
<br />
Matlab files for Questions 1 and 2: [http://tcs.nju.edu.cn/yzhang/sample_for_Q1.m matlab file for Q1], [http://tcs.nju.edu.cn/yzhang/sample_for_Q2.m matlab file for Q2]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Assignment_1,_Spring_2024&diff=12182
Assignment 1, Spring 2024
2024-03-20T02:21:37Z
<p>Etone: Created page with "==Question #1== 请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。 ==Question #2== 请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画..."</p>
<hr />
<div>==Question #1==<br />
<br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)纬向平均温度场、纬向平均纬向风场的高度-纬度剖面分布,并简述其分布特征和季节变化特征。<br />
<br />
==Question #2==<br />
<br />
<br />
请使用多年(>20年)的NCEP/NCAR月平均再分析资料,画出各季节(至少画出冬夏两季)温度场、纬向风场在各高度(850、500、100 hPa, 对于温度场请再画出1000hPa)上的水平分布,并简述其分布特征和季节变化特征。<br />
<br />
<br />
==On the netcdf file==<br />
<br />
Netcdf (Network Common Data Form) is a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. The project homepage is hosted by the [https://www.unidata.ucar.edu/software/netcdf Unidata program] at the University Corporation for Atmospheric Research (UCAR). They are also the chief source of netCDF software, standards development, updates etc.。<br />
[https://psl.noaa.gov/data/gridded_help/read-our-files.html methods to reading netcdf files]<br />
<br />
==Read .nc using Matlab==<br />
Since <font color="red"> Matlab 2008b </font> ,Matlab offers its own function to read and write .nc files. Here we provide a sample Matlab file to work with dataset stored as .nc files. For figures,Matlab offers multiple formats to save. You can choose the figure format to save from the drop-down of the popup window for figures,or you can use the command “print” to save figures(you may input "help print" for more help). For more info on Matlab, see [http://www.mathworks.com/help Matlab website]。<br />
<br />
==Files to download==<br />
The dataset used for the homework are the monthly mean data from NCEP-DOE Reanalysis 2, with the time span from 1979/1 to 2009/12. For more info on the dataset, please go to the [https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.html web]. Followings are the data and matlab files that you would need for the homework.<br />
<br />
NCEP-DOE monthly mean data of Temperature(1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/air.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/air_readme.txt Readme]<br />
<br />
NCEP-DOE monthly mean data of zonal wind U (1979/1-2009/12): [http://tcs.nju.edu.cn/yzhang/uwnd.mon.mean.nc nc file],[http://tcs.nju.edu.cn/yzhang/uwnd_readme.txt Readme]<br />
<br />
NCEP-land mask(used to plot the land-sea boundary): [http://tcs.nju.edu.cn/yzhang/land.nc nc file]<br />
<br />
Matlab files for Questions 1 and 2: [http://tcs.nju.edu.cn/yzhang/sample_for_Q1.m matlab file for Q1], [http://tcs.nju.edu.cn/yzhang/sample_for_Q2.m matlab file for Q2]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=General_Circulation(Spring_2024)&diff=12181
General Circulation(Spring 2024)
2024-03-20T01:39:15Z
<p>Etone: /* Assignments */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = 大气环流 <br><br />
General Circulation of the Atmosphere<br />
|titlestyle = <br />
<br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 张洋<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yangzhang@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 仙林大气楼 B410<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday 2:00-4:00 PM,<br>仙I-116<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = Friday 3:30-5:00 PM <br>仙林大气楼 B410 <br />
|header9 = Reference book<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:James-Circulating.jpg|border|100px]]<br />
|imagestyle = <br />
|caption = Introduction to Circulating Atmospheres, <br>''I. James'', Cambridge Press, 1995<br />
|captionstyle = }}<br />
|header11 =<br />
|label11 = <br />
|data11 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:Oort.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Physics of Climate, ''Peixoto, J. P.'' and ''A. H. Oort'', Springer-Verlag New York, 1992<br />
|captionstyle = <br />
}}<br />
|header12 =<br />
|label12 = <br />
|data12 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:geoff.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Atmospheric and Oceanic Fluid Dynamics: Fundamentals and Large-scale Circulation, ''Vallis, G. K.'', Cambridge University Press, 2006<br />
|captionstyle = <br />
}}<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
<br />
This is the page for the class ''General Circulation of the Atmosphere (大气环流)'' for the Spring 2024 semester. Students who take this class should check this page periodically for content updates and new announcements.<br />
<br />
= Course info =<br />
* '''Instructor ''': 张洋,<br />
:*office: 仙林气象楼 B410<br />
:*email: yangzhang@nju.edu.cn<br />
* '''Class meeting''': Wednesday 2:00-4:00 PM;仙I-116<br />
* '''Office hour''': Friday <font size="2>3:30-5:00 PM,仙林大气楼 B410</font><br />
* '''Prerequisites''': 动力气象,天气学,气候学<br />
* '''Grading''': homework(50%)+ final exam(50%)<br />
<br />
= Assignments =<br />
# [[Assignment 1, Spring 2024|Reanalysis data and the earth's climatology]] [Due:2024.04.03]<font color="red" size="1.5">请在本次作业的截止日期前将本次作业的图片部分和文字部分打包作为附件发送至邮箱 circulation_nju@126.com </font></div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=General_Circulation(Spring_2024)&diff=12180
General Circulation(Spring 2024)
2024-03-20T01:37:16Z
<p>Etone: </p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = 大气环流 <br><br />
General Circulation of the Atmosphere<br />
|titlestyle = <br />
<br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 张洋<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yangzhang@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 仙林大气楼 B410<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday 2:00-4:00 PM,<br>仙I-116<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = Friday 3:30-5:00 PM <br>仙林大气楼 B410 <br />
|header9 = Reference book<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:James-Circulating.jpg|border|100px]]<br />
|imagestyle = <br />
|caption = Introduction to Circulating Atmospheres, <br>''I. James'', Cambridge Press, 1995<br />
|captionstyle = }}<br />
|header11 =<br />
|label11 = <br />
|data11 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:Oort.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Physics of Climate, ''Peixoto, J. P.'' and ''A. H. Oort'', Springer-Verlag New York, 1992<br />
|captionstyle = <br />
}}<br />
|header12 =<br />
|label12 = <br />
|data12 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:geoff.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Atmospheric and Oceanic Fluid Dynamics: Fundamentals and Large-scale Circulation, ''Vallis, G. K.'', Cambridge University Press, 2006<br />
|captionstyle = <br />
}}<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
<br />
This is the page for the class ''General Circulation of the Atmosphere (大气环流)'' for the Spring 2024 semester. Students who take this class should check this page periodically for content updates and new announcements.<br />
<br />
= Course info =<br />
* '''Instructor ''': 张洋,<br />
:*office: 仙林气象楼 B410<br />
:*email: yangzhang@nju.edu.cn<br />
* '''Class meeting''': Wednesday 2:00-4:00 PM;仙I-116<br />
* '''Office hour''': Friday <font size="2>3:30-5:00 PM,仙林大气楼 B410</font><br />
* '''Prerequisites''': 动力气象,天气学,气候学<br />
* '''Grading''': homework(50%)+ final exam(50%)<br />
<br />
= Assignments =<br />
# [[Assignment 1, Fall 2022|Reanalysis data and the earth's climatology]] [Due:2024.04.03]<font color="red" size="1.5">请在本次作业的截止日期前将本次作业的图片部分和文字部分打包作为附件发送至邮箱 circulation_nju@126.com </font></div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=General_Circulation(Spring_2024)&diff=12179
General Circulation(Spring 2024)
2024-03-19T16:02:48Z
<p>Etone: </p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = 大气环流 <br><br />
General Circulation of the Atmosphere<br />
|titlestyle = <br />
<br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 张洋<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yangzhang@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 仙林大气楼 B410<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday 2:00-4:00 PM,仙II-116<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = Friday 3:30-5:00 PM <br>仙林大气楼 B410 <br />
|header9 = Reference book<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:James-Circulating.jpg|border|100px]]<br />
|imagestyle = <br />
|caption = Introduction to Circulating Atmospheres, <br>''I. James'', Cambridge Press, 1995<br />
|captionstyle = }}<br />
|header11 =<br />
|label11 = <br />
|data11 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:Oort.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Physics of Climate, ''Peixoto, J. P.'' and ''A. H. Oort'', Springer-Verlag New York, 1992<br />
|captionstyle = <br />
}}<br />
|header12 =<br />
|label12 = <br />
|data12 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:geoff.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Atmospheric and Oceanic Fluid Dynamics: Fundamentals and Large-scale Circulation, ''Vallis, G. K.'', Cambridge University Press, 2006<br />
|captionstyle = <br />
}}<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
<br />
This is the page for the class ''General Circulation of the Atmosphere (大气环流)'' for the Spring 2024 semester. Students who take this class should check this page periodically for content updates and new announcements.<br />
<br />
= Course info =<br />
* '''Instructor ''': 张洋,<br />
:*office: 仙林气象楼 B410<br />
:*email: yangzhang@nju.edu.cn<br />
* '''Class meeting''': Wednesday 2:00-4:00 PM;仙II-116<br />
* '''Office hour''': Friday <font size="2>3:30-5:00 PM,仙林气象楼 B410</font><br />
* '''Prerequisites''': 动力气象,天气学,气候学<br />
* '''Grading''': homework(50%)+ final exam(50%)<br />
<br />
= Assignments =<br />
# [[Assignment 1, Fall 2022|Reanalysis data and the earth's climatology]] [Due:2024.04.03]<font color="red" size="1.5">请在本次作业的截止日期前将本次作业的图片部分和文字部分打包作为附件发送至邮箱 circulation_nju@126.com </font></div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=General_Circulation(Spring_2024)&diff=12178
General Circulation(Spring 2024)
2024-03-19T16:01:24Z
<p>Etone: </p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = 大气环流 <br><br />
General Circulation of the Atmosphere<br />
|titlestyle = <br />
<br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 张洋<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yangzhang@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 仙林大气楼 B410<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday 2:00-4:00 PM,仙II-116<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = Friday 3:30-5:00 PM <br>仙林大气楼 B410 <br />
|header9 = Reference book<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:James-Circulating.jpg|border|100px]]<br />
|imagestyle = <br />
|caption = Introduction to Circulating Atmospheres, <br>''I. James'', Cambridge Press, 1995<br />
|captionstyle = }}<br />
|header11 =<br />
|label11 = <br />
|data11 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:Oort.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Physics of Climate, ''Peixoto, J. P.'' and ''A. H. Oort'', Springer-Verlag New York, 1992<br />
|captionstyle = <br />
}}<br />
|header12 =<br />
|label12 = <br />
|data12 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:geoff.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Atmospheric and Oceanic Fluid Dynamics: Fundamentals and Large-scale Circulation, ''Vallis, G. K.'', Cambridge University Press, 2006<br />
|captionstyle = <br />
}}<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
<br />
This is the page for the class ''General Circulation of the Atmosphere (大气环流)'' for the Spring 2024 semester. Students who take this class should check this page periodically for content updates and new announcements.<br />
<br />
= Course info =<br />
* '''Instructor ''': 张洋,<br />
:*office: 仙林气象楼 B410<br />
:*email: yangzhang@nju.edu.cn<br />
* '''Class meeting''': Wednesday 2:00-4:00 PM;仙II-116<br />
* '''Office hour''': Friday <font color="red" size="2>3:30-5:00 PM,仙林气象楼 B410</font><br />
* '''Prerequisites''': 动力气象,天气学,气候学<br />
* '''Grading''': homework(50%)+ final exam(50%)<br />
<br />
= Assignments =<br />
# [[Assignment 1, Fall 2022|Reanalysis data and the earth's climatology]] [Due:2022.10.20]<font color="red" size="1.5">请在本次作业的截止日期前将本次作业的图片部分和文字部分打包作为附件发送至邮箱 circulation_nju@126.com </font></div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=General_Circulation(Spring_2024)&diff=12177
General Circulation(Spring 2024)
2024-03-19T15:57:44Z
<p>Etone: </p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = 大气环流 <br><br />
General Circulation of the Atmosphere<br />
|titlestyle = <br />
<br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 张洋<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yangzhang@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 仙林大气楼 B410<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday 2:00-4:00 PM,仙II-116<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = Friday 3:30-5:00 PM <br>仙林大气楼 B410 <br />
|header9 = Reference book<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:James-Circulating.jpg|border|100px]]<br />
|imagestyle = <br />
|caption = Introduction to Circulating Atmospheres, <br>''I. James'', Cambridge Press, 1995<br />
|captionstyle = }}<br />
|header11 =<br />
|label11 = <br />
|data11 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:Oort.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Physics of Climate, ''Peixoto, J. P.'' and ''A. H. Oort'', Springer-Verlag New York, 1992<br />
|captionstyle = <br />
}}<br />
|header12 =<br />
|label12 = <br />
|data12 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:geoff.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Atmospheric and Oceanic Fluid Dynamics: Fundamentals and Large-scale Circulation, ''Vallis, G. K.'', Cambridge University Press, 2006<br />
|captionstyle = <br />
}}<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
<br />
This is the page for the class ''General Circulation of the Atmosphere (大气环流)'' for the Spring 2024 semester. Students who take this class should check this page periodically for content updates and new announcements.</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=General_Circulation(Spring_2024)&diff=12176
General Circulation(Spring 2024)
2024-03-19T15:55:15Z
<p>Etone: Created page with "{{Infobox |name = Infobox |bodystyle = |title = 大气环流 <br> General Circulation of the Atmosphere |titlestyle = |headerstyle = background:#ccf; |labelstyle = background:#ddf; |datastyle = |header1 =Instructor |label1 = |data1 = |header2 = |label2 = |data2 = 张洋 |header3 = |label3 = Email |data3 = yangzhang@nju.edu.cn |header4 = |label4= office |data4= 仙林大气楼 B410 |header5 = Class |label5 = |data5 = |hea..."</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = 大气环流 <br><br />
General Circulation of the Atmosphere<br />
|titlestyle = <br />
<br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 张洋<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yangzhang@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 仙林大气楼 B410<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = 周四 下午 2:00-4:00,逸B-301;线上课程腾讯会议号:5966863228<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = 周四 下午4:00-4:30 <br>线上线下答疑 <br />
|header9 = Reference book<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:James-Circulating.jpg|border|100px]]<br />
|imagestyle = <br />
|caption = Introduction to Circulating Atmospheres, <br>''I. James'', Cambridge Press, 1995<br />
|captionstyle = }}<br />
|header11 =<br />
|label11 = <br />
|data11 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:Oort.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Physics of Climate, ''Peixoto, J. P.'' and ''A. H. Oort'', Springer-Verlag New York, 1992<br />
|captionstyle = <br />
}}<br />
|header12 =<br />
|label12 = <br />
|data12 = {{Infobox<br />
|name = <br />
|bodystyle = <br />
|title = <br />
|titlestyle = <br />
|image = [[File:geoff.jpg|border|100px]]<br />
|imagestyle = <br />
|caption =Atmospheric and Oceanic Fluid Dynamics: Fundamentals and Large-scale Circulation, ''Vallis, G. K.'', Cambridge University Press, 2006<br />
|captionstyle = <br />
}}<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
<br />
This is the page for the class ''General Circulation of the Atmosphere (大气环流)'' for the Fall 2022 semester. Students who take this class should check this page periodically for content updates and new announcements.</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=Main_Page&diff=12175
Main Page
2024-03-19T15:53:34Z
<p>Etone: </p>
<hr />
<div>This is a course/seminar wiki run by the [http://tcs.nju.edu.cn theory group] in the Department of Computer Science and Technology at Nanjing University.<br />
<br />
== Home Pages for Courses and Seminars==<br />
<br />
*[https://tcs.nju.edu.cn/shili/courses/2024spring-algo/ 算法设计与分析 Algorithm Design and Analysis (Spring 2024) ]<br />
<br />
*[[组合数学 (Spring 2024)|组合数学 Combinatorics (Spring 2024)]]<br />
<br />
*[[计算复杂性 (Spring 2024)|计算复杂性 Computational Complexity (Spring 2024)]]<br />
<br />
*[[计算方法 Numerical method (Spring 2024)]]<br />
<br />
*[[概率论与数理统计 (Spring 2024)]]<br />
<br />
*[[Theory Seminar|理论计算机科学讨论班]]<br />
<br />
*[[Study Group|理论计算机科学学习小组]]<br />
<br />
;Past courses<br />
<br />
* Advanced Algorithms: [[高级算法 (Fall 2023)|Fall 2023]], [[高级算法 (Fall 2022)|Fall 2022]], [[高级算法 (Fall 2021)|Fall 2021]], [[高级算法 (Fall 2020)|Fall 2020]], [[高级算法 (Fall 2019)|Fall 2019]], [[高级算法 (Fall 2018)|Fall 2018]], [[高级算法 (Fall 2017)|Fall 2017]], [[随机算法 \ 高级算法 (Fall 2016)|Fall 2016]].<br />
<br />
* Combinatorics: [[组合数学 (Spring 2023)|Spring 2023]], [[组合数学 (Fall 2019)|Fall 2019]], [[组合数学 (Fall 2017)|Fall 2017]], [[组合数学 (Fall 2016)|Fall 2016]], [[组合数学 (Fall 2015)|Fall 2015]], [[组合数学 (Spring 2014)|Spring 2014]], [[组合数学 (Spring 2013)|Spring 2013]], [[组合数学 (Fall 2011)|Fall 2011]], [[Combinatorics (Fall 2010)|Fall 2010]].<br />
<br />
* Computational Complexity: [[计算复杂性 (Spring 2024)|Spring 2024]], [[计算复杂性 (Spring 2023)|Spring 2023]], [[计算复杂性 (Fall 2019)|Fall 2019]], [[计算复杂性 (Fall 2018)|Fall 2018]].<br />
<br />
* Numerical Method: [[计算方法 Numerical method (Spring 2023)|Spring 2023]], [https://liuexp.github.io/numerical.html Spring 2022].<br />
<br />
* Probability Theory: [[概率论与数理统计 (Spring 2023)|Spring 2023]].<br />
<br />
* Quantum Computation: [[量子计算 (Spring 2022)|Spring 2022]], [[量子计算 (Spring 2021)|Spring 2021]], [[量子计算 (Fall 2019)|Fall 2019]].<br />
<br />
* Randomized Algorithms: [[随机算法 (Fall 2015)|Fall 2015]], [[随机算法 (Spring 2014)|Spring 2014]], [[随机算法 (Spring 2013)|Spring 2013]], [[随机算法 (Fall 2011)|Fall 2011]], [[Randomized Algorithms (Spring 2010)|Spring 2010]].<br />
<br />
;Past seminars, workshops and summer schools<br />
*[[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]<br />
*[[TCSPhD2020| 理论计算机科学优秀博士生论坛2020]]<br />
*[[Quantum|量子算法与物理实现研讨会]]<br />
*[[Theory@Nanjing 2019| 2019 Nanjing Theory Day]]<br />
*[[Theory@Nanjing 2018| 2018 Nanjing Theory Day]]<br />
*[[Theory@Nanjing 2017| 2017 Nanjing Theory Day]]<br />
*[[\Delta Seminar on Logic, Philosophy, and Computer Science|Δ Seminar on Logic, Philosophy, and Computer Science]]<br />
*[[近似算法讨论班 (Fall 2011)|近似算法 Approximation Algorithms, Fall 2011.]]<br />
<br />
; 其它链接<br />
* [[General Circulation(Spring 2024)|大气环流 General Circulation of the Atmosphere, Spring 2024]]<br />
* [[General Circulation(Fall 2022)|大气环流 General Circulation of the Atmosphere, Fall 2022]]<br />
<br />
* [[概率论 (Summer 2014)| 概率与计算 (上海交大 Summer 2014)]]</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12173
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T14:44:04Z
<p>Etone: /* Karger算法的分析 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges'''),也称为'''重'''(读音chóng)'''边'''。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus\{u,v\}</math> 的边,用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中均匀分布地选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math>.<br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math>.<br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>.<br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}.<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}.<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下:<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下:<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math>.<br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math>.<br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>,例如:<math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12172
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T14:42:58Z
<p>Etone: /* Karger算法的分析 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges'''),也称为'''重'''(读音chóng)'''边'''。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus\{u,v\}</math> 的边,用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中均匀分布地选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}.<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下:<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下:<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math>.<br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math>.<br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>,例如:<math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12171
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T14:42:46Z
<p>Etone: /* 一个概率法推论 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges'''),也称为'''重'''(读音chóng)'''边'''。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus\{u,v\}</math> 的边,用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中均匀分布地选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下:<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下:<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math>.<br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math>.<br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>,例如:<math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12168
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:50:27Z
<p>Etone: /* Karger算法 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges'''),也称为'''重'''(读音chóng)'''边'''。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus\{u,v\}</math> 的边,用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中均匀分布地选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math><br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math><br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>,例如:<math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12167
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:48:56Z
<p>Etone: /* Karger算法 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges'''),也称为'''重'''(读音chóng)'''边'''。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus\{u,v\}</math> 的边,用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中均匀分布地选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math><br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math><br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>,例如:<math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12166
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:46:08Z
<p>Etone: </p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges'''),也称为'''重'''(读音chóng)'''边'''。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus\{u,v\}</math> 的边,用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math><br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math><br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>,例如:<math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12165
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:44:28Z
<p>Etone: /* Karger算法 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus\{u,v\}</math> 的边,用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math><br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math><br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>,例如:<math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12164
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:44:12Z
<p>Etone: /* Karger算法 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus\{u,v\}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math><br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math><br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>,例如:<math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12163
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:42:00Z
<p>Etone: /* 一个概率法推论 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math><br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math><br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>,例如:<math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12162
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:41:47Z
<p>Etone: /* 一个概率法推论 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math><br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math><br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。而且这个结论给出的界是紧的:存在 <math>n</math> 个顶点的图 <math>G</math>,其最小割的个数刚好为 <math>\frac{n(n-1)}{2}</math>——例如 <math>n</math> 个顶点的环。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12159
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:39:11Z
<p>Etone: /* 一个概率法推论 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于图 <math>G</math> 中的不同最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math><br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math><br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12158
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:38:26Z
<p>Etone: /* 一个概率法推论 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
首先定义事件 <math>A</math> 如下<br />
:<math>A:</math> “收缩算法输出了图 <math>G</math> 的某个最小割”。<br />
并对 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 如下<br />
:<math>A_C:</math> “收缩算法输出了 <math>C</math>”。<br />
容易验证,对于不同的最小割 <math>C</math>,事件 <math>A_C</math> 彼此不相容;而且,事件 <math>A</math> 是对所有最小割 <math>C</math> 事件 <math>A_C</math> 的并,即<br />
:<math>A=\bigcup_{G\text{中所有最小割}C}A_C</math><br />
于是根据概率的 <math>\sigma</math>可加性,有:<br />
:<math>\Pr(A)=\sum_{G\text{中所有最小割}C}\Pr(A_C)</math><br />
<br />
由我们对于Karger算法的分析可得,对任何最小割 <math>C</math>,都有 <math>\Pr(A_c)\ge\frac{2}{n(n-1)}</math>。而作为良定义的概率,必然有 <math>\Pr(A)\le 1</math>。因此可知,图 <math>G</math> 中最小割的总数不会超过 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12157
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:24:46Z
<p>Etone: /* 一个概率法推论 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论(最小割数量上界)|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
对于 <math>G</math> 中每一个不同的最小割 <math>C</math>,定义事件 <math>A_C</math> 为“收缩算法返回 <math>C</math>”。<br />
<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12156
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:19:02Z
<p>Etone: /* Karger算法的分析 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理(收缩算法的正确概率)|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12155
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:17:38Z
<p>Etone: /* Karger算法的分析 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理|<br />
:对于 <math>n</math> 个顶点的任意多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12154
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:17:15Z
<p>Etone: /* A Consequence of the Probabilistic Method */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理|<br />
:对于任意 <math>n</math> 个顶点的多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== 一个概率法推论 ==<br />
上述对Karger算法的分析可以导出如下关于图中最小割数量的推论。<br />
{{Theorem|推论|<br />
:对于 <math>n</math> 个顶点的任意多重图 <math>G(V,E)</math>,<math>G</math> 中最小割的数量至多为 <math>\frac{n(n-1)}{2}</math>。<br />
}}<br />
{{Proof|<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
上述推论是一个'''概率法'''('''the probabilistic method''')的实例:结论本身不具有任何随机性,但是其证明过程引入了概率论。</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12153
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:12:32Z
<p>Etone: /* Karger算法的分析 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理|<br />
:对于任意 <math>n</math> 个顶点的多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)}{2}\cdot \ln n} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== A Consequence of the Probabilistic Method ==<br />
The analysis of Karger's algorithm implies the following combinatorial proposition for the number of distinct minimum cuts in a graph.<br />
{{Theorem|Corollary|<br />
:For any graph <math>G(V,E)</math> of <math>n</math> vertices, the number of distinct minimum cuts in <math>G</math> is at most <math>\frac{n(n-1)}{2}</math>.<br />
}}<br />
{{Proof|<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
Note that the statement of this theorem has no randomness at all, while the proof consists of a randomized procedure. This is an example of [http://en.wikipedia.org/wiki/Probabilistic_method the probabilistic method].</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12152
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:12:03Z
<p>Etone: /* Karger算法的分析 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理|<br />
:对于任意 <math>n</math> 个顶点的多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)\ln n}{2}} \\<br />
\ge <br />
&1-\left(\frac{1}{\mathrm{e}}\right)^{\ln n}\\<br />
=<br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== A Consequence of the Probabilistic Method ==<br />
The analysis of Karger's algorithm implies the following combinatorial proposition for the number of distinct minimum cuts in a graph.<br />
{{Theorem|Corollary|<br />
:For any graph <math>G(V,E)</math> of <math>n</math> vertices, the number of distinct minimum cuts in <math>G</math> is at most <math>\frac{n(n-1)}{2}</math>.<br />
}}<br />
{{Proof|<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
Note that the statement of this theorem has no randomness at all, while the proof consists of a randomized procedure. This is an example of [http://en.wikipedia.org/wiki/Probabilistic_method the probabilistic method].</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12151
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T13:10:55Z
<p>Etone: /* Analysis of Karger's Algorithm */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Karger算法的分析 ==<br />
假设输入图 <math>G</math> 为一任意给定的多重图。Karger算法输出了该图的一个随机的割。我们需要分析该随机割是最小割的概率,即如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]</math><br />
<br />
对此,我们证明如下更强的结论。令 <math>C</math> 是输入图 <math>G</math> 中的某个特定的最小割。我们将分析如下概率的下界:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]</math><br />
显然这一概率是收缩算法成功输出最小割的概率的下界(在这里我们使用了如下概率法则:对任意事件 <math>A</math> 和 <math>B</math>,若 <math>A\subseteq B</math>,则<math>\Pr(A)\le \Pr(B)</math>)。<br />
<br />
我们引入以下记号:<br />
* 令 <math>e_1,e_2,\ldots,e_{n-2}</math> 表示在运行收缩算法时,依次选中进行收缩的随机边的序列;<br />
* 令 <math>G_1=G</math> 表示最初输入的多重图。对于 <math>i=1,2,\ldots,n-2</math>,令 <math>G_{i+1}=\mathsf{Contract}(G_{i},e_i)</math> 表示第 <math>i</math> 轮收缩后的多重图。<br />
<br />
我们可以做出如下的观察:<br />
{{Theorem<br />
|引理 1|<br />
:如果 <math>C</math> 是多重图 <math>G</math> 中的一个最小割,且 <math>e\not\in C</math>,那么 <math>C</math> 在收缩图 <math>G'=\mathsf{Contract}(G,e)</math> 中仍然是一个最小割。}}<br />
{{Proof|<br />
我们首先观察到,收缩永远不会创建新的割:收缩图 <math>G'</math> 中的每个割也必定是原图 <math>G</math> 中的一个割。<br />
<br />
然后我们观察到,原始图 <math>G</math> 中的割 <math>C</math> 能在收缩图 <math>G'</math> 中幸存,当且仅当收缩边 <math>e\not\in C</math>。<br />
<br />
这两个观察都很容易通过收缩操作的定义进行验证(特别是在考虑顶点等价类的解释时更容易验证)。<br />
}}<br />
<br />
根据'''引理1''',我们有:<br />
:<math>\Pr[\,\text{收缩算法输出了 }C\,]=\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]</math>;<br />
再根据链式法则,这一概率可被计算如下:<br />
:<math>\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]=\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math><br />
<br />
接下来我们的任务是对每个条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 给出下界。注意到:根据'''引理1''',条件 <math>e_1,e_2,\ldots,e_{i-1}\not\in C</math> 的发生意味着 <math>C</math> 仍是当前图 <math>G_i</math> 中的最小割;而 <math>e_i</math> 是图 <math>G_i</math> 中的一条均匀分布的随机边。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math> 即为图 <math>G_i</math> 中一条均匀随机边未命中其某个最小割 <math>C</math> 的概率。直观上:“最小”割应该在边集中相对稀疏,因此这一概率应该有下界。如下引理严格印证了这一直觉。<br />
<br />
{{Theorem<br />
|引理 2|<br />
:如果 <math>C</math> 是多重图 <math>G(V,E)</math> 中的一个最小割,那么 <math>|E|\ge \frac{|V||C|}{2}</math>。<br />
}}<br />
{{Proof| <br />
:注意到每个顶点 <math>v\in V</math> 的度数必然至少为 <math>|C|</math>,否则所有与 <math>v</math> 邻接的边即构成了一个割(将点 <math>v</math> 与其余所有点分开),而且这个割比 <math>|C|</math> 更小,这就与 <math>C</math> 是一个最小割相矛盾。<br />
:现在由于每个顶点的度至少为 <math>|C|</math>,应用[https://en.wikipedia.org/wiki/Handshaking_lemma 握手引理],所有顶点度数之和是 <math>2|E|\ge |V||C|</math>。(容易验证握手引理对于多重图仍旧成立。)<br />
}}<br />
<br />
令 <math>V_i</math> 和 <math>E_i</math> 分别表示多重图 <math>G_i</math> 的顶点集和边集。注意到 <math>|V_{i}|=n-i+1</math>。根据'''引理2''',若 <math>C</math> 在 <math>G_i</math> 中仍然是一个最小割,则有 <math>|E_i|\ge \frac{(n-i+2)|C|}{2}</math>。于是条件概率 <math>\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]</math>可被计算如下:<br />
<br />
:<math><br />
\begin{align}<br />
\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge 1-\frac{2}{n-i+1}<br />
\end{align}</math><br />
<br />
将上述分析归总,可得:<br />
:<math>\begin{align}<br />
\Pr[\,\text{收缩算法输出了 }G\text{ 的一个最小割}\,]<br />
&\ge<br />
\Pr[\,\text{收缩算法输出了 }C\,]\\<br />
&=<br />
\Pr[\,e_1,e_2,\ldots,e_{n-2}\not\in C\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[\,e_i\not\in C\mid e_1,e_2,\ldots,e_{i-1}\not\in C\,]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
这证明了如下定理:<br />
{{Theorem<br />
|定理|<br />
:对于任意 <math>n</math> 个顶点的多重图,收缩算法返回一个最小割的概率至少为 <math>\frac{2}{n(n-1)}</math>。<br />
}}<br />
初看之下,这一成功概率似乎相当小。然而请注意,一个图中可能存在指数多的割(因为潜在地,每个非空点集 <math>S\subset V</math> 都可以对应一个将 <math>S</math> 与其补集分开的割),而Karger算法有效地将这个指数级的解空间事实上缩小到了平方级别。<br />
<br />
我们可以独立地运行上述收缩算法 <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> 次,将所有返回的割中最小的一个作为最终结果返回。最终正确得到最小割的概率至少是:<br />
:<math>\begin{align}<br />
&1-\Pr[\,\text{全部 }t\text{ 次独立运行收缩算法都没有找到 }G\text{ 的最小割}\,] \\<br />
= <br />
&1-\Pr[\,\text{一次运行收缩算法没有成功输出 }G\text{ 的最小割}\,]^{t} \\<br />
\ge <br />
&1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)\ln n}{2}} \\<br />
\ge <br />
&1-\frac{1}{n}<br />
\end{align}</math><br />
<br />
== A Consequence of the Probabilistic Method ==<br />
The analysis of Karger's algorithm implies the following combinatorial proposition for the number of distinct minimum cuts in a graph.<br />
{{Theorem|Corollary|<br />
:For any graph <math>G(V,E)</math> of <math>n</math> vertices, the number of distinct minimum cuts in <math>G</math> is at most <math>\frac{n(n-1)}{2}</math>.<br />
}}<br />
{{Proof|<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
Note that the statement of this theorem has no randomness at all, while the proof consists of a randomized procedure. This is an example of [http://en.wikipedia.org/wiki/Probabilistic_method the probabilistic method].</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12144
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T12:05:17Z
<p>Etone: /* Karger算法 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角的效果如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Analysis of Karger's Algorithm ==<br />
We now analyze the above algorithm. Since the algorithm is '''''randomized''''', its output cut is random even when the input is fixed, so ''the output may not always be correct''. We want to give a theoretical guarantee of the chance that the algorithm returns a correct answer on an arbitrary input.<br />
<br />
More precisely, on an arbitrarily fixed input multi-graph <math>G</math>, we want to answer the following question rigorously:<br />
:<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by }RandomContract\,]\ge ?</math><br />
<br />
To answer this question, we prove a stronger statement: for arbitrarily fixed input multi-graph <math>G</math> and a particular minimum cut <math>C</math> in <math>G</math>, <br />
:<math>p_{C}=\Pr[\,C\mbox{ is returned by }RandomContract\,]\ge ?</math><br />
Obviously this will imply the previous lower bound for <math>p_{\text{correct}}</math> because the event in <math>p_{C}</math> implies the event in <math>p_{\text{correct}}</math>.<br />
:{|border="2" width="100%" cellspacing="4" cellpadding="3" rules="all" style="margin:1em 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse;empty-cells:show;"<br />
|<br />
*In above argument we use the simple law in probability that <math>\Pr(A)\le \Pr(B)</math> if <math>A\subseteq B</math>, i.e. event <math>A</math> implies event <math>B</math>.<br />
|}<br />
<br />
We introduce the following notations:<br />
*Let <math>e_1,e_2,\ldots,e_{n-2}</math> denote the sequence of random edges chosen to contract in a running of ''RandomContract'' algorithm. <br />
*Let <math>G_1=G</math> denote the original input multi-graph. And for <math>i=1,2,\ldots,n-2</math>, let <math>G_{i+1}=Contract(G_{i},e_i)</math> be the multigraph after <math>i</math>th contraction.<br />
Obviously <math>e_1,e_2,\ldots,e_{n-2}</math> are random, and they are the ''only'' random choices used in the algorithm: meaning that they along with the input <math>G</math>, uniquely determine the sequence of multi-graphs <math>G_1,G_2,\ldots,G_{n-2}</math> in every iteration as well as the final output. <br />
<br />
We now compute the probability <math>p_C</math> by decompose it into more elementary events involving <math>e_1,e_2,\ldots,e_{n-2}</math>. This is due to the following proposition.<br />
{{Theorem<br />
|Proposition 1|<br />
:If <math>C</math> is a minimum cut in a multi-graph <math>G</math> and <math>e\not\in C</math>, then <math>C</math> is still a minimum cut in the contracted graph <math>G'=contract(G,e)</math>.<br />
}}<br />
{{Proof|<br />
We first observe that contraction will never create new cuts: every cut in the contracted graph <math>G'</math> must also be a cut in the original graph <math>G</math>.<br />
<br />
We then observe that a cut <math>C</math> in <math>G</math> "survives" in the contracted graph <math>G'</math> if and only if the contracted edge <math>e\not\in C</math>.<br />
<br />
Both observations are easy to verify by the definition of contraction operator (in particular, easier to verify if we take the vertex class interpretation).<br />
}}<br />
<br />
Recall that <math>e_1,e_2,\ldots,e_{n-2}</math> denote the sequence of random edges chosen to contract in a running of ''RandomContract'' algorithm.<br />
<br />
By Proposition 1, the event <math>\mbox{``}C\mbox{ is returned by }RandomContract\mbox{''}\,</math> is equivalent to the event <math>\mbox{``}e_i\not\in C\mbox{ for all }i=1,2,\ldots,n-2\mbox{''}</math>. Therefore:<br />
:<math><br />
\begin{align}<br />
p_C <br />
&=<br />
\Pr[\,C\mbox{ is returned by }{RandomContract}\,]\\<br />
&=<br />
\Pr[\,e_i\not\in C\mbox{ for all }i=1,2,\ldots,n-2\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C].<br />
\end{align}<br />
</math><br />
The last equation is due to the '''chain rule'''.<br />
<br />
Now our task is to give lower bound to each <math>p_i=\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]</math>. The condition <math>\mbox{``}\forall j<i, e_j\not\in C\mbox{''}</math> means the min-cut <math>C</math> survives all first <math>i-1</math> contractions <math>e_1,e_2,\ldots,e_{i-1}</math>, which due to Proposition 1 means that <math>C</math> is also a min-cut in the multi-graph <math>G_i</math> obtained from applying the first <math>(i-1)</math> contractions.<br />
<br />
Then the conditional probability <math>p_i=\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]</math> is the probability that no edge in <math>C</math> is hit when a uniform random edge in the current multi-graph is chosen assuming that <math>C</math> is a minimum cut in the current multi-graph. Intuitively this probability should be bounded from below, because as a min-cut <math>C</math> should be sparse among all edges. This intuition is justified by the following proposition.<br />
<br />
{{Theorem<br />
|Proposition 2|<br />
:If <math>C</math> is a min-cut in a multi-graph <math>G(V,E)</math>, then <math>|E|\ge \frac{|V||C|}{2}</math>.<br />
}}<br />
{{Proof| <br />
:It must hold that the degree of each vertex <math>v\in V</math> is at least <math>|C|</math>, or otherwise the set of edges incident to <math>v</math> forms a cut of size smaller than <math>|C|</math> which separates <math>\{v\}</math> from the rest of the graph, contradicting that <math>C</math> is a min-cut. And the bound <math>|E|\ge \frac{|V||C|}{2}</math> follows directly from applying the [https://en.wikipedia.org/wiki/Handshaking_lemma handshaking lemma] to the fact that every vertex in <math>G</math> has degree at least <math>|C|</math>.<br />
}}<br />
<br />
Let <math>V_i</math> and <math>E_i</math> denote the vertex set and edge set of the multi-graph <math>G_i</math> respectively, and recall that <math>G_i</math> is the multi-graph obtained from applying first <math>(i-1)</math> contractions. Obviously <math>|V_{i}|=n-i+1</math>. And due to Proposition 2, <math>|E_i|\ge \frac{|V_i||C|}{2}</math> if <math>C</math> is still a min-cut in <math>G_i</math>.<br />
<br />
The probability <math>p_i=\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]</math> can be computed as<br />
:<math><br />
\begin{align}<br />
p_i<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge1-\frac{2}{|V_i|}\\<br />
&=1-\frac{2}{n-i+1}<br />
\end{align},</math><br />
where the inequality is due to Proposition 2. <br />
<br />
We now can put everything together. We arbitrarily fix the input multi-graph <math>G</math> and any particular minimum cut <math>C</math> in <math>G</math>. <br />
:<math>\begin{align}<br />
p_{\text{correct}}<br />
&=\Pr[\,\text{a minimum cut is returned by }RandomContract\,]\\<br />
&\ge<br />
\Pr[\,C\mbox{ is returned by }{RandomContract}\,]\\<br />
&=<br />
\Pr[\,e_i\not\in C\mbox{ for all }i=1,2,\ldots,n-2\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
This gives us the following theorem.<br />
{{Theorem<br />
|Theorem|<br />
: For any multigraph with <math>n</math> vertices, the ''RandomContract'' algorithm returns a minimum cut with probability at least <math>\frac{2}{n(n-1)}</math>.<br />
}}<br />
At first glance this seems to be a quite slim chance of success. However, notice that there may be exponential many cuts in a graph (because potentially every nonempty subset <math>S\subset V</math> corresponds to a cut <math>C=E(S,\overline{S})</math>), and Karger's algorithm effectively reduce this exponential-sized space to quadratic-sized, an exponential improvement!<br />
<br />
We can run ''RandomContract'' independently for <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> times and return the smallest cut ever returned. The probability that a minimum cut is found is at least:<br />
<br />
:<math>\begin{align}<br />
&\quad 1-\Pr[\,\mbox{all }t\mbox{ independent runnings of } RandomContract\mbox{ fails to find a min-cut}\,] \\<br />
&= 1-\Pr[\,\mbox{a single running of }{RandomContract}\mbox{ fails}\,]^{t} \\<br />
&\ge 1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)\ln n}{2}} \\<br />
&\ge 1-\frac{1}{n}.<br />
\end{align}</math><br />
<br />
== A Consequence of the Probabilistic Method ==<br />
The analysis of Karger's algorithm implies the following combinatorial proposition for the number of distinct minimum cuts in a graph.<br />
{{Theorem|Corollary|<br />
:For any graph <math>G(V,E)</math> of <math>n</math> vertices, the number of distinct minimum cuts in <math>G</math> is at most <math>\frac{n(n-1)}{2}</math>.<br />
}}<br />
{{Proof|<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
Note that the statement of this theorem has no randomness at all, while the proof consists of a randomized procedure. This is an example of [http://en.wikipedia.org/wiki/Probabilistic_method the probabilistic method].</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12143
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T12:04:58Z
<p>Etone: /* Karger算法 */</p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
我们将描述一个简洁优美的随机化算法来解决最小割问题。该算法最初是由[http://people.csail.mit.edu/karger/ David Karger]提出的。<br />
<br />
<br />
给定一个多重图 <math>G(V,E)</math> 和一条边 <math>e\in E</math>,我们定义如下的'''收缩'''操作 <math>\mathsf{Contract}(G,e)</math>,将 <math>G</math> 更新为一个新的多重图。<br />
{{Theorem|收缩算子 <math>\mathsf{Contract}(G,e)</math>|<br />
设 <math>e=\{u,v\}</math>:<br />
:* 将顶点 <math>u,v</math> 替换为一个新顶点 <math>x</math>;<br />
:* 对于图中任何一条连接 <math>u,v</math> 其中之一到 <math>u,v</math> 以外某顶点 <math>w\in V\setminus{u,v}</math> 的边(无论是否平行),用一条新边 <math>\{x,w\}</math> 替换它;<br />
:* 图中剩余的部分保持不变。<br />
}}<br />
<br />
换言之,<math>\mathsf{Contract}(G,\{u,v\})</math> 将两个顶点 <math>u</math> 和 <math>v</math> 合并成一个新顶点 <math>x</math>,该新顶点邻接的边保留了原始图 <math>G</math> 中与 <math>u,v</math> 两顶点之一邻接的边(但不包括二者之间的平行边 <math>\{u,v\}</math>)。现在我们应该能意识到为什么我们考虑多重图而不是简单图——因为即使我们从没有平行边的简单图开始,收缩操作也可能引入平行边。<br />
<br />
收缩操作的效果如图所示:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger算法的想法很简单:在每一步中,随机选择当前多重图中的一条边,将其收缩;重复这一操作,直至图中只剩下两个顶点——这两个剩下的顶点之间的所有边的集合,必然是最初图(乃至每一步中的图)中的一个割。<br />
<br />
{{Theorem|收缩算法 (Karger 1993)|<br />
:'''输入:''' 多重图 <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* 从当前图中依均匀分布选择一条随机的边 <math>e\in E</math>;<br />
:* <math>G=\mathsf{Contract}(G,e)</math>; <br />
:return <math>C=E</math> (即当前所剩的最后两个顶点之间所有的平行边);<br />
}}<br />
<br />
另一种看待收缩操作 <math>\mathsf{Contract}(G,e)</math> 的方式是将其解读为对两个顶点的等价类的合并。假设 <math>V={v_1,v_2,\ldots,v_n}</math> 是所有顶点的集合。我们从 <math>n</math> 个顶点等价类 <math>S_1,S_2,\ldots, S_n</math> 开始,其中每个等价类 <math>S_i={v_i}</math> 包含一个顶点。通过调用 <math>\mathsf{Contract}(G,e)</math>,其中 <math>e</math> 跨越了两个不同的等价类 <math>S_i</math> 和 <math>S_j</math>,其效果是将等价类 <math>S_i</math> 和 <math>S_j</math> 合并。收缩后的多重图中的边就是跨越不同顶点等价类之间的边。<br />
这一视角如图所示:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Analysis of Karger's Algorithm ==<br />
We now analyze the above algorithm. Since the algorithm is '''''randomized''''', its output cut is random even when the input is fixed, so ''the output may not always be correct''. We want to give a theoretical guarantee of the chance that the algorithm returns a correct answer on an arbitrary input.<br />
<br />
More precisely, on an arbitrarily fixed input multi-graph <math>G</math>, we want to answer the following question rigorously:<br />
:<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by }RandomContract\,]\ge ?</math><br />
<br />
To answer this question, we prove a stronger statement: for arbitrarily fixed input multi-graph <math>G</math> and a particular minimum cut <math>C</math> in <math>G</math>, <br />
:<math>p_{C}=\Pr[\,C\mbox{ is returned by }RandomContract\,]\ge ?</math><br />
Obviously this will imply the previous lower bound for <math>p_{\text{correct}}</math> because the event in <math>p_{C}</math> implies the event in <math>p_{\text{correct}}</math>.<br />
:{|border="2" width="100%" cellspacing="4" cellpadding="3" rules="all" style="margin:1em 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse;empty-cells:show;"<br />
|<br />
*In above argument we use the simple law in probability that <math>\Pr(A)\le \Pr(B)</math> if <math>A\subseteq B</math>, i.e. event <math>A</math> implies event <math>B</math>.<br />
|}<br />
<br />
We introduce the following notations:<br />
*Let <math>e_1,e_2,\ldots,e_{n-2}</math> denote the sequence of random edges chosen to contract in a running of ''RandomContract'' algorithm. <br />
*Let <math>G_1=G</math> denote the original input multi-graph. And for <math>i=1,2,\ldots,n-2</math>, let <math>G_{i+1}=Contract(G_{i},e_i)</math> be the multigraph after <math>i</math>th contraction.<br />
Obviously <math>e_1,e_2,\ldots,e_{n-2}</math> are random, and they are the ''only'' random choices used in the algorithm: meaning that they along with the input <math>G</math>, uniquely determine the sequence of multi-graphs <math>G_1,G_2,\ldots,G_{n-2}</math> in every iteration as well as the final output. <br />
<br />
We now compute the probability <math>p_C</math> by decompose it into more elementary events involving <math>e_1,e_2,\ldots,e_{n-2}</math>. This is due to the following proposition.<br />
{{Theorem<br />
|Proposition 1|<br />
:If <math>C</math> is a minimum cut in a multi-graph <math>G</math> and <math>e\not\in C</math>, then <math>C</math> is still a minimum cut in the contracted graph <math>G'=contract(G,e)</math>.<br />
}}<br />
{{Proof|<br />
We first observe that contraction will never create new cuts: every cut in the contracted graph <math>G'</math> must also be a cut in the original graph <math>G</math>.<br />
<br />
We then observe that a cut <math>C</math> in <math>G</math> "survives" in the contracted graph <math>G'</math> if and only if the contracted edge <math>e\not\in C</math>.<br />
<br />
Both observations are easy to verify by the definition of contraction operator (in particular, easier to verify if we take the vertex class interpretation).<br />
}}<br />
<br />
Recall that <math>e_1,e_2,\ldots,e_{n-2}</math> denote the sequence of random edges chosen to contract in a running of ''RandomContract'' algorithm.<br />
<br />
By Proposition 1, the event <math>\mbox{``}C\mbox{ is returned by }RandomContract\mbox{''}\,</math> is equivalent to the event <math>\mbox{``}e_i\not\in C\mbox{ for all }i=1,2,\ldots,n-2\mbox{''}</math>. Therefore:<br />
:<math><br />
\begin{align}<br />
p_C <br />
&=<br />
\Pr[\,C\mbox{ is returned by }{RandomContract}\,]\\<br />
&=<br />
\Pr[\,e_i\not\in C\mbox{ for all }i=1,2,\ldots,n-2\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C].<br />
\end{align}<br />
</math><br />
The last equation is due to the '''chain rule'''.<br />
<br />
Now our task is to give lower bound to each <math>p_i=\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]</math>. The condition <math>\mbox{``}\forall j<i, e_j\not\in C\mbox{''}</math> means the min-cut <math>C</math> survives all first <math>i-1</math> contractions <math>e_1,e_2,\ldots,e_{i-1}</math>, which due to Proposition 1 means that <math>C</math> is also a min-cut in the multi-graph <math>G_i</math> obtained from applying the first <math>(i-1)</math> contractions.<br />
<br />
Then the conditional probability <math>p_i=\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]</math> is the probability that no edge in <math>C</math> is hit when a uniform random edge in the current multi-graph is chosen assuming that <math>C</math> is a minimum cut in the current multi-graph. Intuitively this probability should be bounded from below, because as a min-cut <math>C</math> should be sparse among all edges. This intuition is justified by the following proposition.<br />
<br />
{{Theorem<br />
|Proposition 2|<br />
:If <math>C</math> is a min-cut in a multi-graph <math>G(V,E)</math>, then <math>|E|\ge \frac{|V||C|}{2}</math>.<br />
}}<br />
{{Proof| <br />
:It must hold that the degree of each vertex <math>v\in V</math> is at least <math>|C|</math>, or otherwise the set of edges incident to <math>v</math> forms a cut of size smaller than <math>|C|</math> which separates <math>\{v\}</math> from the rest of the graph, contradicting that <math>C</math> is a min-cut. And the bound <math>|E|\ge \frac{|V||C|}{2}</math> follows directly from applying the [https://en.wikipedia.org/wiki/Handshaking_lemma handshaking lemma] to the fact that every vertex in <math>G</math> has degree at least <math>|C|</math>.<br />
}}<br />
<br />
Let <math>V_i</math> and <math>E_i</math> denote the vertex set and edge set of the multi-graph <math>G_i</math> respectively, and recall that <math>G_i</math> is the multi-graph obtained from applying first <math>(i-1)</math> contractions. Obviously <math>|V_{i}|=n-i+1</math>. And due to Proposition 2, <math>|E_i|\ge \frac{|V_i||C|}{2}</math> if <math>C</math> is still a min-cut in <math>G_i</math>.<br />
<br />
The probability <math>p_i=\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]</math> can be computed as<br />
:<math><br />
\begin{align}<br />
p_i<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge1-\frac{2}{|V_i|}\\<br />
&=1-\frac{2}{n-i+1}<br />
\end{align},</math><br />
where the inequality is due to Proposition 2. <br />
<br />
We now can put everything together. We arbitrarily fix the input multi-graph <math>G</math> and any particular minimum cut <math>C</math> in <math>G</math>. <br />
:<math>\begin{align}<br />
p_{\text{correct}}<br />
&=\Pr[\,\text{a minimum cut is returned by }RandomContract\,]\\<br />
&\ge<br />
\Pr[\,C\mbox{ is returned by }{RandomContract}\,]\\<br />
&=<br />
\Pr[\,e_i\not\in C\mbox{ for all }i=1,2,\ldots,n-2\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
This gives us the following theorem.<br />
{{Theorem<br />
|Theorem|<br />
: For any multigraph with <math>n</math> vertices, the ''RandomContract'' algorithm returns a minimum cut with probability at least <math>\frac{2}{n(n-1)}</math>.<br />
}}<br />
At first glance this seems to be a quite slim chance of success. However, notice that there may be exponential many cuts in a graph (because potentially every nonempty subset <math>S\subset V</math> corresponds to a cut <math>C=E(S,\overline{S})</math>), and Karger's algorithm effectively reduce this exponential-sized space to quadratic-sized, an exponential improvement!<br />
<br />
We can run ''RandomContract'' independently for <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> times and return the smallest cut ever returned. The probability that a minimum cut is found is at least:<br />
<br />
:<math>\begin{align}<br />
&\quad 1-\Pr[\,\mbox{all }t\mbox{ independent runnings of } RandomContract\mbox{ fails to find a min-cut}\,] \\<br />
&= 1-\Pr[\,\mbox{a single running of }{RandomContract}\mbox{ fails}\,]^{t} \\<br />
&\ge 1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)\ln n}{2}} \\<br />
&\ge 1-\frac{1}{n}.<br />
\end{align}</math><br />
<br />
== A Consequence of the Probabilistic Method ==<br />
The analysis of Karger's algorithm implies the following combinatorial proposition for the number of distinct minimum cuts in a graph.<br />
{{Theorem|Corollary|<br />
:For any graph <math>G(V,E)</math> of <math>n</math> vertices, the number of distinct minimum cuts in <math>G</math> is at most <math>\frac{n(n-1)}{2}</math>.<br />
}}<br />
{{Proof|<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
Note that the statement of this theorem has no randomness at all, while the proof consists of a randomized procedure. This is an example of [http://en.wikipedia.org/wiki/Probabilistic_method the probabilistic method].</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E6%A6%82%E7%8E%87%E8%AE%BA%E4%B8%8E%E6%95%B0%E7%90%86%E7%BB%9F%E8%AE%A1_(Spring_2024)/Karger%27s_min-cut_algorithm&diff=12142
概率论与数理统计 (Spring 2024)/Karger's min-cut algorithm
2024-03-19T10:37:25Z
<p>Etone: </p>
<hr />
<div>令 <math>G(V, E)</math> 是一个无向图。我们称边集 <math>C\subseteq E</math> 是图 <math>G</math> 的一个'''割''',如果图 <math>G</math> 在删除所有 <math>C</math> 中的边后变得不连通。<br />
<br />
'''最小割问题''', 也称为'''全局最小割问题''', 定义如下。<br />
{{Theorem|全局最小割问题|<br />
*'''输入''':无向图 <math>G(V,E)</math>;<br />
*'''输出''':图 <math>G</math> 中具有最小 <math>|C|</math> 的割 <math>C</math>。<br />
}}<br />
<br />
等价地,该问题要求找到一个将 <math>V</math> 分成两个不相交非空子集 <math>S</math> 和 <math>T</math> 的划分,使得跨越 <math>S</math> 和 <math>T</math> 的边总数最小。<br />
<br />
我们考虑如下更具一般性的情境:输入图 <math>G</math> 可以是'''多重图'''('''multigraph'''),这意味着任意两个顶点 <math>u</math> 和 <math>v</math> 之间可能存在多条'''平行边'''('''parallel edges''')。多重图中的割的定义与之前相同,割 <math>C</math> 的大小则由 <math>C</math> 中所有边(包括平行边)的总数给出。等价地,可以将多重图视为带有整数边权重的图,割 <math>C</math> 的大小表示为 <math>C</math> 中所有边的总权重。<br />
<br />
通过[http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem 最大流-最小割定理],可以得到这个问题的一个经典的确定性算法。最大流算法可以找到一个最小的'''<math>s</math>-<math>t</math>割''', 将由输入任意指定的一个'''源点''' <math>s\in V</math> 和一个'''汇点''' <math>t\in V</math> 分割开来。然后可以通过穷举来找到针对任意固定源点 <math>s</math> 和所有可能的汇点 <math>t\neq s</math> 的最小 <math>s</math>-<math>t</math> 割,从而求得全局最小割。<br />
<br />
== Karger算法 ==<br />
We will describe a simple and elegant randomized algorithm for the min-cut problem. The algorithm is due to [http://people.csail.mit.edu/karger/ David Karger].<br />
<br />
Let <math>G(V, E)</math> be a '''multi-graph''', which allows more than one '''parallel edges''' between two distinct vertices <math>u</math> and <math>v</math> but does not allow any '''self-loops''': the edges that adjoin a vertex to itself. A multi-graph <math>G</math> can be represented by an adjacency matrix <math>A</math>, in the way that each non-diagonal entry <math>A(u,v)</math> takes nonnegative integer values instead of just 0 or 1, representing the number of parallel edges between <math>u</math> and <math>v</math> in <math>G</math>, and all diagonal entries <math>A(v,v)=0</math> (since there is no self-loop).<br />
<br />
Given a multi-graph <math>G(V,E)</math> and an edge <math>e\in E</math>, we define the following '''contraction''' operator Contract(<math>G</math>, <math>e</math>), which transform <math>G</math> to a new multi-graph.<br />
{{Theorem|The contraction operator ''Contract''(<math>G</math>, <math>e</math>)|<br />
:say <math>e=uv</math>:<br />
:*replace <math>\{u,v\}</math> by a new vertex <math>x</math>;<br />
:*for every edge (no matter parallel or not) in the form of <math>uw</math> or <math>vw</math> that connects one of <math>\{u,v\}</math> to a vertex <math>w\in V\setminus\{u,v\}</math> in the graph other than <math>u,v</math>, replace it by a new edge <math>xw</math>;<br />
:*the reset of the graph does not change.<br />
}}<br />
<br />
In other words, the <math>Contract(G,uv)</math> merges the two vertices <math>u</math> and <math>v</math> into a new vertex <math>x</math> whose incident edges preserves the edges incident to <math>u</math> or <math>v</math> in the original graph <math>G</math> except for the parallel edges between them. Now you should realize why we consider multi-graphs instead of simple graphs, because even if we start with a simple graph without parallel edges, the contraction operator may create parallel edges.<br />
<br />
The contraction operator is illustrated by the following picture:<br />
[[Image:Contract.png|600px|center]]<br />
<br />
Karger's algorithm uses a simple idea: <br />
*At each step we randomly select an edge in the current multi-graph to contract until there are only two vertices left. <br />
*The parallel edges between these two remaining vertices must be a cut of the original graph. <br />
*We return this cut and hope that with good chance this gives us a minimum cut.<br />
The following is the pseudocode for Karger's algorithm.<br />
{{Theorem|''RandomContract'' (Karger 1993)|<br />
:'''Input:''' multi-graph <math>G(V,E)</math>;<br />
----<br />
:while <math>|V|>2</math> do<br />
:* choose an edge <math>uv\in E</math> uniformly at random;<br />
:* <math>G=Contract(G,uv)</math>; <br />
:return <math>C=E</math> (the parallel edges between the only two vertices in <math>V</math>);<br />
}}<br />
<br />
Another way of looking at the contraction operator Contract(<math>G</math>,<math>e</math>) is that it unions two classes of vertices. Let <math>V=\{v_1,v_2,\ldots,v_n\}</math> be the set of all vertices. We start with <math>n</math> vertex classes <math>S_1,S_2,\ldots, S_n</math> with each class <math>S_i=\{v_i\}</math> contains one vertex. By calling <math>Contract(G,uv)</math>, where <math>u\in S_i</math> and <math>v\in S_j</math> for distinct <math>i\neq j</math>, we take union of <math>S_i</math> and <math>S_j</math>. The edges in the contracted multi-graph are the edges that cross between different vertex classes.<br />
<br />
This view of contraction is illustrated by the following picture:<br />
[[Image:Contract_class.png|600px|center]]<br />
<br />
== Analysis of Karger's Algorithm ==<br />
We now analyze the above algorithm. Since the algorithm is '''''randomized''''', its output cut is random even when the input is fixed, so ''the output may not always be correct''. We want to give a theoretical guarantee of the chance that the algorithm returns a correct answer on an arbitrary input.<br />
<br />
More precisely, on an arbitrarily fixed input multi-graph <math>G</math>, we want to answer the following question rigorously:<br />
:<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by }RandomContract\,]\ge ?</math><br />
<br />
To answer this question, we prove a stronger statement: for arbitrarily fixed input multi-graph <math>G</math> and a particular minimum cut <math>C</math> in <math>G</math>, <br />
:<math>p_{C}=\Pr[\,C\mbox{ is returned by }RandomContract\,]\ge ?</math><br />
Obviously this will imply the previous lower bound for <math>p_{\text{correct}}</math> because the event in <math>p_{C}</math> implies the event in <math>p_{\text{correct}}</math>.<br />
:{|border="2" width="100%" cellspacing="4" cellpadding="3" rules="all" style="margin:1em 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse;empty-cells:show;"<br />
|<br />
*In above argument we use the simple law in probability that <math>\Pr(A)\le \Pr(B)</math> if <math>A\subseteq B</math>, i.e. event <math>A</math> implies event <math>B</math>.<br />
|}<br />
<br />
We introduce the following notations:<br />
*Let <math>e_1,e_2,\ldots,e_{n-2}</math> denote the sequence of random edges chosen to contract in a running of ''RandomContract'' algorithm. <br />
*Let <math>G_1=G</math> denote the original input multi-graph. And for <math>i=1,2,\ldots,n-2</math>, let <math>G_{i+1}=Contract(G_{i},e_i)</math> be the multigraph after <math>i</math>th contraction.<br />
Obviously <math>e_1,e_2,\ldots,e_{n-2}</math> are random, and they are the ''only'' random choices used in the algorithm: meaning that they along with the input <math>G</math>, uniquely determine the sequence of multi-graphs <math>G_1,G_2,\ldots,G_{n-2}</math> in every iteration as well as the final output. <br />
<br />
We now compute the probability <math>p_C</math> by decompose it into more elementary events involving <math>e_1,e_2,\ldots,e_{n-2}</math>. This is due to the following proposition.<br />
{{Theorem<br />
|Proposition 1|<br />
:If <math>C</math> is a minimum cut in a multi-graph <math>G</math> and <math>e\not\in C</math>, then <math>C</math> is still a minimum cut in the contracted graph <math>G'=contract(G,e)</math>.<br />
}}<br />
{{Proof|<br />
We first observe that contraction will never create new cuts: every cut in the contracted graph <math>G'</math> must also be a cut in the original graph <math>G</math>.<br />
<br />
We then observe that a cut <math>C</math> in <math>G</math> "survives" in the contracted graph <math>G'</math> if and only if the contracted edge <math>e\not\in C</math>.<br />
<br />
Both observations are easy to verify by the definition of contraction operator (in particular, easier to verify if we take the vertex class interpretation).<br />
}}<br />
<br />
Recall that <math>e_1,e_2,\ldots,e_{n-2}</math> denote the sequence of random edges chosen to contract in a running of ''RandomContract'' algorithm.<br />
<br />
By Proposition 1, the event <math>\mbox{``}C\mbox{ is returned by }RandomContract\mbox{''}\,</math> is equivalent to the event <math>\mbox{``}e_i\not\in C\mbox{ for all }i=1,2,\ldots,n-2\mbox{''}</math>. Therefore:<br />
:<math><br />
\begin{align}<br />
p_C <br />
&=<br />
\Pr[\,C\mbox{ is returned by }{RandomContract}\,]\\<br />
&=<br />
\Pr[\,e_i\not\in C\mbox{ for all }i=1,2,\ldots,n-2\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C].<br />
\end{align}<br />
</math><br />
The last equation is due to the '''chain rule'''.<br />
<br />
Now our task is to give lower bound to each <math>p_i=\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]</math>. The condition <math>\mbox{``}\forall j<i, e_j\not\in C\mbox{''}</math> means the min-cut <math>C</math> survives all first <math>i-1</math> contractions <math>e_1,e_2,\ldots,e_{i-1}</math>, which due to Proposition 1 means that <math>C</math> is also a min-cut in the multi-graph <math>G_i</math> obtained from applying the first <math>(i-1)</math> contractions.<br />
<br />
Then the conditional probability <math>p_i=\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]</math> is the probability that no edge in <math>C</math> is hit when a uniform random edge in the current multi-graph is chosen assuming that <math>C</math> is a minimum cut in the current multi-graph. Intuitively this probability should be bounded from below, because as a min-cut <math>C</math> should be sparse among all edges. This intuition is justified by the following proposition.<br />
<br />
{{Theorem<br />
|Proposition 2|<br />
:If <math>C</math> is a min-cut in a multi-graph <math>G(V,E)</math>, then <math>|E|\ge \frac{|V||C|}{2}</math>.<br />
}}<br />
{{Proof| <br />
:It must hold that the degree of each vertex <math>v\in V</math> is at least <math>|C|</math>, or otherwise the set of edges incident to <math>v</math> forms a cut of size smaller than <math>|C|</math> which separates <math>\{v\}</math> from the rest of the graph, contradicting that <math>C</math> is a min-cut. And the bound <math>|E|\ge \frac{|V||C|}{2}</math> follows directly from applying the [https://en.wikipedia.org/wiki/Handshaking_lemma handshaking lemma] to the fact that every vertex in <math>G</math> has degree at least <math>|C|</math>.<br />
}}<br />
<br />
Let <math>V_i</math> and <math>E_i</math> denote the vertex set and edge set of the multi-graph <math>G_i</math> respectively, and recall that <math>G_i</math> is the multi-graph obtained from applying first <math>(i-1)</math> contractions. Obviously <math>|V_{i}|=n-i+1</math>. And due to Proposition 2, <math>|E_i|\ge \frac{|V_i||C|}{2}</math> if <math>C</math> is still a min-cut in <math>G_i</math>.<br />
<br />
The probability <math>p_i=\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]</math> can be computed as<br />
:<math><br />
\begin{align}<br />
p_i<br />
&=1-\frac{|C|}{|E_i|}\\<br />
&\ge1-\frac{2}{|V_i|}\\<br />
&=1-\frac{2}{n-i+1}<br />
\end{align},</math><br />
where the inequality is due to Proposition 2. <br />
<br />
We now can put everything together. We arbitrarily fix the input multi-graph <math>G</math> and any particular minimum cut <math>C</math> in <math>G</math>. <br />
:<math>\begin{align}<br />
p_{\text{correct}}<br />
&=\Pr[\,\text{a minimum cut is returned by }RandomContract\,]\\<br />
&\ge<br />
\Pr[\,C\mbox{ is returned by }{RandomContract}\,]\\<br />
&=<br />
\Pr[\,e_i\not\in C\mbox{ for all }i=1,2,\ldots,n-2\,]\\<br />
&=<br />
\prod_{i=1}^{n-2}\Pr[e_i\not\in C\mid \forall j<i, e_j\not\in C]\\<br />
&\ge<br />
\prod_{i=1}^{n-2}\left(1-\frac{2}{n-i+1}\right)\\<br />
&=<br />
\prod_{k=3}^{n}\frac{k-2}{k}\\<br />
&= \frac{2}{n(n-1)}.<br />
\end{align}</math><br />
<br />
This gives us the following theorem.<br />
{{Theorem<br />
|Theorem|<br />
: For any multigraph with <math>n</math> vertices, the ''RandomContract'' algorithm returns a minimum cut with probability at least <math>\frac{2}{n(n-1)}</math>.<br />
}}<br />
At first glance this seems to be a quite slim chance of success. However, notice that there may be exponential many cuts in a graph (because potentially every nonempty subset <math>S\subset V</math> corresponds to a cut <math>C=E(S,\overline{S})</math>), and Karger's algorithm effectively reduce this exponential-sized space to quadratic-sized, an exponential improvement!<br />
<br />
We can run ''RandomContract'' independently for <math>t=\left\lceil\frac{n(n-1)\ln n}{2}\right\rceil</math> times and return the smallest cut ever returned. The probability that a minimum cut is found is at least:<br />
<br />
:<math>\begin{align}<br />
&\quad 1-\Pr[\,\mbox{all }t\mbox{ independent runnings of } RandomContract\mbox{ fails to find a min-cut}\,] \\<br />
&= 1-\Pr[\,\mbox{a single running of }{RandomContract}\mbox{ fails}\,]^{t} \\<br />
&\ge 1- \left(1-\frac{2}{n(n-1)}\right)^{\frac{n(n-1)\ln n}{2}} \\<br />
&\ge 1-\frac{1}{n}.<br />
\end{align}</math><br />
<br />
== A Consequence of the Probabilistic Method ==<br />
The analysis of Karger's algorithm implies the following combinatorial proposition for the number of distinct minimum cuts in a graph.<br />
{{Theorem|Corollary|<br />
:For any graph <math>G(V,E)</math> of <math>n</math> vertices, the number of distinct minimum cuts in <math>G</math> is at most <math>\frac{n(n-1)}{2}</math>.<br />
}}<br />
{{Proof|<br />
Let <math>\mathcal{C}</math> denote the set of all minimum cuts in <math>G</math>. For each min-cut <math>C\in\mathcal{C}</math>, let <math>A_C</math> denote the event "<math>C</math> is returned by ''RandomContract''", whose probability is given by <br />
:<math>p_C=\Pr(A_C)\,</math>. <br />
<br />
Clearly we have:<br />
* for any distinct <math>C,D\in\mathcal{C}</math>, <math>A_C\,</math> and <math>A_{D}\,</math> are '''disjoint events'''; and<br />
* the union <math>\bigcup_{C\in\mathcal{C}}A_C</math> is precisely the event "a minimum cut is returned by ''RandomContract''", whose probability is given by<br />
::<math>p_{\text{correct}}=\Pr[\,\text{a minimum cut is returned by } RandomContract\,]</math>.<br />
Due to the [https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom '''additivity of probability'''], it holds that<br />
:<math><br />
p_{\text{correct}}=\sum_{C\in\mathcal{C}}\Pr(A_C)=\sum_{C\in\mathcal{C}}p_C.<br />
</math><br />
<br />
By the analysis of Karger's algorithm, we know <math>p_C\ge\frac{2}{n(n-1)}</math>. And since <math>p_{\text{correct}}</math> is a well defined probability, due to the [https://en.wikipedia.org/wiki/Probability_axioms#Second_axiom '''unitarity of probability'''], it must hold that <math>p_{\text{correct}}\le 1</math>. Therefore,<br />
:<math>1\ge p_{\text{correct}}=\sum_{C\in\mathcal{C}}p_C\ge|\mathcal{C}|\frac{2}{n(n-1)}</math>,<br />
which means <math>|\mathcal{C}|\le\frac{n(n-1)}{2}</math>.<br />
}}<br />
<br />
Note that the statement of this theorem has no randomness at all, while the proof consists of a randomized procedure. This is an example of [http://en.wikipedia.org/wiki/Probabilistic_method the probabilistic method].</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6_(Fall_2024)/Sieve_methods&diff=12141
组合数学 (Fall 2024)/Sieve methods
2024-03-19T09:51:04Z
<p>Etone: Created page with "== Principle of Inclusion-Exclusion == Let <math>A</math> and <math>B</math> be two finite sets. The cardinality of their union is :<math>|A\cup B|=|A|+|B|-{\color{Blue}|A\cap B|}</math>. For three sets <math>A</math>, <math>B</math>, and <math>C</math>, the cardinality of the union of these three sets is computed as :<math>|A\cup B\cup C|=|A|+|B|+|C|-{\color{Blue}|A\cap B|}-{\color{Blue}|A\cap C|}-{\color{Blue}|B\cap C|}+{\color{Red}|A\cap B\cap C|}</math>. This is illu..."</p>
<hr />
<div>== Principle of Inclusion-Exclusion ==<br />
Let <math>A</math> and <math>B</math> be two finite sets. The cardinality of their union is<br />
:<math>|A\cup B|=|A|+|B|-{\color{Blue}|A\cap B|}</math>.<br />
For three sets <math>A</math>, <math>B</math>, and <math>C</math>, the cardinality of the union of these three sets is computed as<br />
:<math>|A\cup B\cup C|=|A|+|B|+|C|-{\color{Blue}|A\cap B|}-{\color{Blue}|A\cap C|}-{\color{Blue}|B\cap C|}+{\color{Red}|A\cap B\cap C|}</math>.<br />
This is illustrated by the following figure.<br />
::[[Image:Inclusion-exclusion.png|200px|border|center]] <br />
<br />
Generally, the '''Principle of Inclusion-Exclusion''' states the rule for computing the union of <math>n</math> finite sets <math>A_1,A_2,\ldots,A_n</math>, such that<br />
{{Equation|<br />
<math><br />
\begin{align}<br />
\left|\bigcup_{i=1}^nA_i\right|<br />
&=<br />
\sum_{I\subseteq\{1,\ldots,n\}}(-1)^{|I|-1}\left|\bigcap_{i\in I}A_i\right|.<br />
\end{align}<br />
</math><br />
}}<br />
-----<br />
<br />
In combinatorial enumeration, the Principle of Inclusion-Exclusion is usually applied in its complement form.<br />
<br />
Let <math>A_1,A_2,\ldots,A_n\subseteq U</math> be subsets of some finite set <math>U</math>. Here <math>U</math> is some universe of combinatorial objects, whose cardinality is easy to calculate (e.g. all strings, tuples, permutations), and each <math>A_i</math> contains the objects with some specific property (e.g. a "pattern") which we want to avoid. The problem is to count the number of objects without any of the <math>n</math> properties. We write <math>\bar{A_i}=U-A_i</math>. The number of objects without any of the properties <math>A_1,A_2,\ldots,A_n</math> is<br />
{{Equation|<br />
<math><br />
\begin{align}<br />
\left|\bar{A_1}\cap\bar{A_2}\cap\cdots\cap\bar{A_n}\right|=\left|U-\bigcup_{i=1}^nA_i\right|<br />
&=<br />
|U|+\sum_{I\subseteq\{1,\ldots,n\}}(-1)^{|I|}\left|\bigcap_{i\in I}A_i\right|.<br />
\end{align}<br />
</math><br />
}}<br />
For an <math>I\subseteq\{1,2,\ldots,n\}</math>, we denote<br />
:<math>A_I=\bigcap_{i\in I}A_i</math><br />
with the convention that <math>A_\emptyset=U</math>. The above equation is stated as:<br />
{{Theorem|Principle of Inclusion-Exclusion|<br />
:Let <math>A_1,A_2,\ldots,A_n</math> be a family of subsets of <math>U</math>. Then the number of elements of <math>U</math> which lie in none of the subsets <math>A_i</math> is<br />
::<math>\sum_{I\subseteq\{1,\ldots, n\}}(-1)^{|I|}|A_I|</math>.<br />
}}<br />
<br />
Let <math>S_k=\sum_{|I|=k}|A_I|\,</math>. Conventionally, <math>S_0=|A_\emptyset|=|U|</math>. The principle of inclusion-exclusion can be expressed as<br />
{{Equation|<math><br />
\left|\bar{A_1}\cap\bar{A_2}\cap\cdots\cap\bar{A_n}\right|=<br />
S_0-S_1+S_2+\cdots+(-1)^nS_n.<br />
</math><br />
}}<br />
<br />
=== Surjections ===<br />
In the twelvefold way, we discuss the counting problems incurred by the mappings <math>f:N\rightarrow M</math>. The basic case is that elements from both <math>N</math> and <math>M</math> are distinguishable. In this case, it is easy to count the number of arbitrary mappings (which is <math>m^n</math>) and the number of injective (one-to-one) mappings (which is <math>(m)_n</math>), but the number of surjective is difficult. Here we apply the principle of inclusion-exclusion to count the number of surjective (onto) mappings.<br />
{{Theorem|Theorem|<br />
:The number of surjective mappings from an <math>n</math>-set to an <math>m</math>-set is given by<br />
::<math>\sum_{k=1}^m(-1)^{m-k}{m\choose k}k^n</math>.<br />
}}<br />
{{Proof|<br />
Let <math>U=\{f:[n]\rightarrow[m]\}</math> be the set of mappings from <math>[n]</math> to <math>[m]</math>. Then <math>|U|=m^n</math>. <br />
<br />
For <math>i\in[m]</math>, let <math>A_i</math> be the set of mappings <math>f:[n]\rightarrow[m]</math> that none of <math>j\in[n]</math> is mapped to <math>i</math>, i.e. <math>A_i=\{f:[n]\rightarrow[m]\setminus\{i\}\}</math>, thus <math>|A_i|=(m-1)^n</math>.<br />
<br />
More generally, for <math>I\subseteq [m]</math>, <math>A_I=\bigcap_{i\in I}A_i</math> contains the mappings <math>f:[n]\rightarrow[m]\setminus I</math>. And <math>|A_I|=(m-|I|)^n\,</math>.<br />
<br />
A mapping <math>f:[n]\rightarrow[m]</math> is surjective if <math>f</math> lies in none of <math>A_i</math>. By the principle of inclusion-exclusion, the number of surjective <math>f:[n]\rightarrow[m]</math> is<br />
:<math>\sum_{I\subseteq[m]}(-1)^{|I|}\left|A_I\right|=\sum_{I\subseteq[m]}(-1)^{|I|}(m-|I|)^n=\sum_{j=0}^m(-1)^j{m\choose j}(m-j)^n</math>.<br />
Let <math>k=m-j</math>. The theorem is proved.<br />
}}<br />
<br />
Recall that, in the twelvefold way, we establish a relation between surjections and partitions.<br />
<br />
* Surjection to ordered partition:<br />
:For a surjective <math>f:[n]\rightarrow[m]</math>, <math>(f^{-1}(0),f^{-1}(1),\ldots,f^{-1}(m-1))</math> is an '''ordered partition''' of <math>[n]</math>.<br />
* Ordered partition to surjection:<br />
:For an ordered <math>m</math>-partition <math>(B_0,B_1,\ldots, B_{m-1})</math> of <math>[n]</math>, we can define a function <math>f:[n]\rightarrow[m]</math> by letting <math>f(i)=j</math> if and only if <math>i\in B_j</math>. <math>f</math> is surjective since as a partition, none of <math>B_i</math> is empty.<br />
<br />
Therefore, we have a one-to-one correspondence between surjective mappings from an <math>n</math>-set to an <math>m</math>-set and the ordered <math>m</math>-partitions of an <math>n</math>-set.<br />
<br />
The Stirling number of the second kind <math>\left\{{n\atop m}\right\}</math> is the number of <math>m</math>-partitions of an <math>n</math>-set. There are <math>m!</math> ways to order an <math>m</math>-partition, thus the number of surjective mappings <math>f:[n]\rightarrow[m]</math> is <math>m! \left\{{n\atop m}\right\}</math>. Combining with what we have proved for surjections, we give the following result for the Stirling number of the second kind.<br />
<br />
{{Theorem|Proposition|<br />
:<math>\left\{{n\atop m}\right\}=\frac{1}{m!}\sum_{k=1}^m(-1)^{m-k}{m\choose k}k^n</math>.<br />
}}<br />
<br />
=== Derangements ===<br />
We now count the number of bijections from a set to itself with no fixed points. This is the '''derangement problem'''.<br />
<br />
For a permutation <math>\pi</math> of <math>\{1,2,\ldots,n\}</math>, a '''fixed point''' is such an <math>i\in\{1,2,\ldots,n\}</math> that <math>\pi(i)=i</math>.<br />
A [http://en.wikipedia.org/wiki/Derangement '''derangement'''] of <math>\{1,2,\ldots,n\}</math> is a permutation of <math>\{1,2,\ldots,n\}</math> that has no fixed points.<br />
<br />
{{Theorem|Theorem|<br />
:The number of derangements of <math>\{1,2,\ldots,n\}</math> given by<br />
::<math>n!\sum_{k=0}^n\frac{(-1)^k}{k!}\approx \frac{n!}{\mathrm{e}}</math>.<br />
}}<br />
{{Proof|<br />
Let <math>U</math> be the set of all permutations of <math>\{1,2,\ldots,n\}</math>. So <math>|U|=n!</math>.<br />
<br />
Let <math>A_i</math> be the set of permutations with fixed point <math>i</math>; so <math>|A_i|=(n-1)!</math>. More generally, for any <math>I\subseteq \{1,2,\ldots,n\}</math>, <math>A_I=\bigcap_{i\in I}A_i</math>, and <math>|A_I|=(n-|I|)!</math>, since permutations in <math>A_I</math> fix every point in <math>I</math> and permute the remaining points arbitrarily. A permutation is a derangement if and only if it lies in none of the sets <math>A_i</math>. So the number of derangements is<br />
:<math>\sum_{I\subseteq\{1,2,\ldots,n\}}(-1)^{|I|}(n-|I|)!=\sum_{k=0}^n(-1)^k{n\choose k}(n-k)!=n!\sum_{k=0}^n\frac{(-1)^k}{k!}.</math><br />
By Taylor's series,<br />
:<math>\frac{1}{\mathrm{e}}=\sum_{k=0}^\infty\frac{(-1)^k}{k!}=\sum_{k=0}^n\frac{(-1)^k}{k!}\pm o\left(\frac{1}{n!}\right)</math>.<br />
It is not hard to see that <math>n!\sum_{k=0}^n\frac{(-1)^k}{k!}</math> is the closest integer to <math>\frac{n!}{\mathrm{e}}</math>.<br />
}}<br />
<br />
Therefore, there are about <math>\frac{1}{\mathrm{e}}</math> fraction of all permutations with no fixed points.<br />
<br />
=== Permutations with restricted positions ===<br />
We introduce a general theory of counting permutations with restricted positions. In the derangement problem, we count the number of permutations that <math>\pi(i)\neq i</math>. We now generalize to the problem of counting permutations which avoid a set of arbitrarily specified positions. <br />
<br />
It is traditionally described using terminology from the game of chess. Let <math>B\subseteq \{1,\ldots,n\}\times \{1,\ldots,n\}</math>, called a '''board'''. As illustrated below, we can think of <math>B</math> as a chess board, with the positions in <math>B</math> marked by "<math>\times</math>".<br />
{{Chess diagram small<br />
| <br />
| <br />
|=<br />
8 |__|xx|xx|__|xx|__|__|xx|=<br />
7 |xx|__|__|xx|__|__|xx|__|=<br />
6 |xx|__|xx|xx|__|xx|xx|__|=<br />
5 |__|xx|__|__|xx|__|xx|__|=<br />
4 |xx|__|__|__|xx|xx|xx|__|=<br />
3 |__|xx|__|xx|__|__|__|xx|=<br />
2 |__|__|xx|__|xx|__|__|xx|=<br />
1 |xx|__|__|xx|__|xx|__|__|=<br />
a b c d e f g h<br />
|<br />
}}<br />
For a permutation <math>\pi</math> of <math>\{1,\ldots,n\}</math>, define the '''graph''' <math>G_\pi(V,E)</math> as<br />
:<math><br />
\begin{align}<br />
G_\pi &= \{(i,\pi(i))\mid i\in \{1,2,\ldots,n\}\}.<br />
\end{align}<br />
</math><br />
This can also be viewed as a set of marked positions on a chess board. Each row and each column has only one marked position, because <math>\pi</math> is a permutation. Thus, we can identify each <math>G_\pi</math> as a placement of <math>n</math> rooks (“城堡”,规则同中国象棋里的“车”) without attacking each other.<br />
<br />
For example, the following is the <math>G_\pi</math> of such <math>\pi</math> that <math>\pi(i)=i</math>.<br />
{{Chess diagram small<br />
| <br />
| <br />
|=<br />
8 |rl|__|__|__|__|__|__|__|=<br />
7 |__|rl|__|__|__|__|__|__|=<br />
6 |__|__|rl|__|__|__|__|__|=<br />
5 |__|__|__|rl|__|__|__|__|=<br />
4 |__|__|__|__|rl|__|__|__|=<br />
3 |__|__|__|__|__|rl|__|__|=<br />
2 |__|__|__|__|__|__|rl|__|=<br />
1 |__|__|__|__|__|__|__|rl|=<br />
a b c d e f g h<br />
|<br />
}}<br />
Now define<br />
:<math>\begin{align}<br />
N_0 &= \left|\left\{\pi\mid B\cap G_\pi=\emptyset\right\}\right|\\<br />
r_k &= \mbox{number of }k\mbox{-subsets of }B\mbox{ such that no two elements have a common coordinate}\\<br />
&=\left|\left\{S\in{B\choose k} \,\bigg|\, \forall (i_1,j_1),(i_2,j_2)\in S, i_1\neq i_2, j_1\neq j_2 \right\}\right|<br />
\end{align}<br />
</math><br />
Interpreted in chess game,<br />
* <math>B</math>: a set of marked positions in an <math>[n]\times [n]</math> chess board.<br />
* <math>N_0</math>: the number of ways of placing <math>n</math> non-attacking rooks on the chess board such that none of these rooks lie in <math>B</math>.<br />
* <math>r_k</math>: number of ways of placing <math>k</math> non-attacking rooks on <math>B</math>.<br />
<br />
Our goal is to count <math>N_0</math> in terms of <math>r_k</math>. This gives the number of permutations avoid all positions in a <math>B</math>.<br />
<br />
{{Theorem|Theorem|<br />
:<math>N_0=\sum_{k=0}^n(-1)^kr_k(n-k)!</math>.<br />
}}<br />
{{Proof|<br />
For each <math>i\in[n]</math>, let <math>A_i=\{\pi\mid (i,\pi(i))\in B\}</math> be the set of permutations <math>\pi</math> whose <math>i</math>-th position is in <math>B</math>.<br />
<br />
<math>N_0</math> is the number of permutations avoid all positions in <math>B</math>. Thus, our goal is to count the number of permutations <math>\pi</math> in none of <math>A_i</math> for <math>i\in [n]</math>.<br />
<br />
For each <math>I\subseteq [n]</math>, let <math>A_I=\bigcap_{i\in I}A_i</math>, which is the set of permutations <math>\pi</math> such that <math>(i,\pi(i))\in B</math> for all <math>i\in I</math>. Due to the principle of inclusion-exclusion,<br />
:<math>N_0=\sum_{I\subseteq [n]} (-1)^{|I|}|A_I|=\sum_{k=0}^n(-1)^k\sum_{I\in{[n]\choose k}}|A_I|</math>.<br />
<br />
The next observation is that <br />
:<math>\sum_{I\in{[n]\choose k}}|A_I|=r_k(n-k)!</math>,<br />
because we can count both sides by first placing <math>k</math> non-attacking rooks on <math>B</math> and placing <math>n-k</math> additional non-attacking rooks on <math>[n]\times [n]</math> in <math>(n-k)!</math> ways. <br />
<br />
Therefore,<br />
:<math>N_0=\sum_{k=0}^n(-1)^kr_k(n-k)!</math>.<br />
}}<br />
<br />
====Derangement problem====<br />
We use the above general method to solve the derange problem again.<br />
<br />
Take <math>B=\{(1,1),(2,2),\ldots,(n,n)\}</math> as the chess board. A derangement <math>\pi</math> is a placement of <math>n</math> non-attacking rooks such that none of them is in <math>B</math>. <br />
{{Chess diagram small<br />
| <br />
| <br />
|=<br />
8 |xx|__|__|__|__|__|__|__|=<br />
7 |__|xx|__|__|__|__|__|__|=<br />
6 |__|__|xx|__|__|__|__|__|=<br />
5 |__|__|__|xx|__|__|__|__|=<br />
4 |__|__|__|__|xx|__|__|__|=<br />
3 |__|__|__|__|__|xx|__|__|=<br />
2 |__|__|__|__|__|__|xx|__|=<br />
1 |__|__|__|__|__|__|__|xx|=<br />
a b c d e f g h<br />
|<br />
}}<br />
Clearly, the number of ways of placing <math>k</math> non-attacking rooks on <math>B</math> is <math>r_k={n\choose k}</math>. We want to count <math>N_0</math>, which gives the number of ways of placing <math>n</math> non-attacking rooks such that none of these rooks lie in <math>B</math>.<br />
<br />
By the above theorem<br />
:<math><br />
N_0=\sum_{k=0}^n(-1)^kr_k(n-k)!=\sum_{k=0}^n(-1)^k{n\choose k}(n-k)!=\sum_{k=0}^n(-1)^k\frac{n!}{k!}=n!\sum_{k=0}^n(-1)^k\frac{1}{k!}\approx\frac{n!}{e}.<br />
</math><br />
<br />
====Problème des ménages====<br />
Suppose that in a banquet, we want to seat <math>n</math> couples at a circular table, satisfying the following constraints:<br />
* Men and women are in alternate places.<br />
* No one sits next to his/her spouse.<br />
<br />
In how many ways can this be done?<br />
<br />
(For convenience, we assume that every seat at the table marked differently so that rotating the seats clockwise or anti-clockwise will end up with a '''different''' solution.)<br />
<br />
First, let the <math>n</math> ladies find their seats. They may either sit at the odd numbered seats or even numbered seats, in either case, there are <math>n!</math> different orders. Thus, there are <math>2(n!)</math> ways to seat the <math>n</math> ladies.<br />
<br />
After sitting the wives, we label the remaining <math>n</math> places clockwise as <math>0,1,\ldots, n-1</math>. And a seating of the <math>n</math> husbands is given by a permutation <math>\pi</math> of <math>[n]</math> defined as follows. Let <math>\pi(i)</math> be the seat of the husband of he lady sitting at the <math>i</math>-th place.<br />
<br />
It is easy to see that <math>\pi</math> satisfies that <math>\pi(i)\neq i</math> and <math>\pi(i)\not\equiv i+1\pmod n</math>, and every permutation <math>\pi</math> with these properties gives a feasible seating of the <math>n</math> husbands. Thus, we only need to count the number of permutations <math>\pi</math> such that <math>\pi(i)\not\equiv i, i+1\pmod n</math>.<br />
<br />
Take <math>B=\{(0,0),(1,1),\ldots,(n-1,n-1), (0,1),(1,2),\ldots,(n-2,n-1),(n-1,0)\}</math> as the chess board. A permutation <math>\pi</math> which defines a way of seating the husbands, is a placement of <math>n</math> non-attacking rooks such that none of them is in <math>B</math>. <br />
{{Chess diagram small<br />
| <br />
| <br />
|=<br />
8 |xx|xx|__|__|__|__|__|__|=<br />
7 |__|xx|xx|__|__|__|__|__|=<br />
6 |__|__|xx|xx|__|__|__|__|=<br />
5 |__|__|__|xx|xx|__|__|__|=<br />
4 |__|__|__|__|xx|xx|__|__|=<br />
3 |__|__|__|__|__|xx|xx|__|=<br />
2 |__|__|__|__|__|__|xx|xx|=<br />
1 |xx|__|__|__|__|__|__|xx|=<br />
a b c d e f g h<br />
|<br />
}}<br />
We need to compute <math>r_k</math>, the number of ways of placing <math>k</math> non-attacking rooks on <math>B</math>. For our choice of <math>B</math>, <math>r_k</math> is the number of ways of choosing <math>k</math> points, no two consecutive, from a collection of <math>2n</math> points arranged in a circle.<br />
<br />
We first see how to do this in a ''line''.<br />
{{Theorem|Lemma|<br />
:The number of ways of choosing <math>k</math> ''non-consecutive'' objects from a collection of <math>m</math> objects arranged in a ''line'', is <math>{m-k+1\choose k}</math>.<br />
}}<br />
{{Proof|<br />
We draw a line of <math>m-k</math> black points, and then insert <math>k</math> red points into the <math>m-k+1</math> spaces between the black points (including the beginning and end).<br />
::<math><br />
\begin{align}<br />
&\sqcup \, \bullet \, \sqcup \, \bullet \, \sqcup \, \bullet \, \sqcup \, \bullet \, \sqcup \, \bullet \, \sqcup \, \bullet \, \sqcup \, \bullet \, \sqcup \\<br />
&\qquad\qquad\qquad\quad\Downarrow\\<br />
&\sqcup \, \bullet \,\, {\color{Red}\bullet} \, \bullet \,\, {\color{Red}\bullet} \, \bullet \, \sqcup \, \bullet \,\, {\color{Red}\bullet}\, \, \bullet \, \sqcup \, \bullet \, \sqcup \, \bullet \,\, {\color{Red}\bullet}<br />
\end{align}<br />
</math><br />
This gives us a line of <math>m</math> points, and the red points specifies the chosen objects, which are non-consecutive. The mapping is 1-1 correspondence.<br />
There are <math>{m-k+1\choose k}</math> ways of placing <math>k</math> red points into <math>m-k+1</math> spaces.<br />
}}<br />
<br />
The problem of choosing non-consecutive objects in a circle can be reduced to the case that the objects are in a line.<br />
<br />
{{Theorem|Lemma|<br />
:The number of ways of choosing <math>k</math> ''non-consecutive'' objects from a collection of <math>m</math> objects arranged in a ''circle'', is <math>\frac{m}{m-k}{m-k\choose k}</math>.<br />
}}<br />
{{Proof|<br />
Let <math>f(m,k)</math> be the desired number; and let <math>g(m,k)</math> be the number of ways of choosing <math>k</math> non-consecutive points from <math>m</math> points arranged in a circle, next coloring the <math>k</math> points red, and then coloring one of the uncolored point blue. <br />
<br />
Clearly, <math>g(m,k)=(m-k)f(m,k)</math>.<br />
<br />
But we can also compute <math>g(m,k)</math> as follows:<br />
* Choose one of the <math>m</math> points and color it blue. This gives us <math>m</math> ways.<br />
* Cut the circle to make a line of <math>m-1</math> points by removing the blue point.<br />
* Choose <math>k</math> non-consecutive points from the line of <math>m-1</math> points and color them red. This gives <math>{m-k\choose k}</math> ways due to the previous lemma.<br />
<br />
Thus, <math>g(m,k)=m{m-k\choose k}</math>. Therefore we have the desired number <math>f(m,k)=\frac{m}{m-k}{m-k\choose k}</math>.<br />
}}<br />
<br />
By the above lemma, we have that <math>r_k=\frac{2n}{2n-k}{2n-k\choose k}</math>. Then apply the theorem of counting permutations with restricted positions,<br />
:<math><br />
N_0=\sum_{k=0}^n(-1)^kr_k(n-k)!=\sum_{k=0}^n(-1)^k\frac{2n}{2n-k}{2n-k\choose k}(n-k)!.<br />
</math><br />
<br />
This gives the number of ways of seating the <math>n</math> husbands ''after the ladies are seated''. Recall that there are <math>2n!</math> ways of seating the <math>n</math> ladies. Thus, the total number of ways of seating <math>n</math> couples as required by problème des ménages is <br />
:<math><br />
2n!\sum_{k=0}^n(-1)^k\frac{2n}{2n-k}{2n-k\choose k}(n-k)!.<br />
</math><br />
<br />
== Inversion ==<br />
<br />
=== Posets ===<br />
A '''partially ordered set''' or '''poset''' for short is a set <math>P</math> together with a binary relation denoted <math>\le_P</math> (or just <math>\le</math> if no confusion is caused), satisfying<br />
* (''reflexivity'') For all <math>x\in P, x\le x</math>.<br />
* (''antisymmetry'') If <math>x\le y</math> and <math>y\le x</math>, then <math>x=y</math>.<br />
* (''transitivity'') If <math>x\le y</math> and <math>y\le z</math>, then <math>x\le z</math>.<br />
<br />
We say two elements <math>x</math> and <math>y</math> are '''comparable''' if <math>x\le y</math> or <math>y\le x</math>; otherwise <math>x</math> and <math>y</math> are '''incomparable'''.<br />
<br />
;Notation<br />
* <math>x\ge y</math> means <math>y\le x</math>.<br />
* <math>x<y</math> means <math>x\le y</math> and <math>x\neq y</math>.<br />
* <math>x>y</math> means <math>y<x</math>.<br />
<br />
=== The Möbius function===<br />
Let <math>P</math> be a finite poset. Consider functions in form of <math>\alpha:P\times P\rightarrow\mathbb{R}</math> defined over domain <math>P\times P</math>. It is convenient to treat such functions as matrices whose rows and columns are indexed by <math>P</math>.<br />
<br />
;Incidence algebra of poset<br />
:Let <br />
::<math>I(P)=\{\alpha:P\times P\rightarrow\mathbb{R}\mid \alpha(x,y)=0\text{ for all }x\not\le_P y\}</math> <br />
:be the class of <math>\alpha</math> such that <math>\alpha(x,y)</math> is non-zero only for <math>x\le_P y</math>.<br />
<br />
:Treating <math>\alpha</math> as matrix, it is trivial to see that <math>I(P)</math> is closed under addition and scalar multiplication, that is,<br />
:* if <math>\alpha,\beta\in I(P)</math> then <math>\alpha+\beta\in I(P)</math>;<br />
:* if <math>\alpha\in I(P)</math> then <math>c\alpha\in I(P)</math> for any <math>c\in\mathbb{R}</math>;<br />
:where <math>\alpha,\beta</math> are treated as matrices.<br />
<br />
:With this spirit, it is natural to define the matrix multiplication in <math>I(P)</math>. For <math>\alpha,\beta\in I(P)</math>, <br />
::<math>(\alpha\beta)(x,y)=\sum_{z\in P}\alpha(x,z)\beta(z,y)=\sum_{x\le z\le y}\alpha(x,z)\beta(z,y)</math>.<br />
:The second equation is due to that for <math>\alpha,\beta\in I(P)</math>, for all <math>z</math> other than <math>x\le z\le y</math>, <math>\alpha(x,z)\beta(z,y)</math> is zero.<br />
:By the transitivity of relation <math>\le_P</math>, it is also easy to prove that <math>I(P)</math> is closed under matrix multiplication (the detailed proof is left as an exercise). Therefore, <math>I(P)</math> is closed under addition, scalar multiplication and matrix multiplication, so we have an algebra <math>I(P)</math>, called '''incidence algebra''', over functions on <math>P\times P</math>.<br />
<br />
;Zeta function and Möbius function<br />
:A special function in <math>I(P)</math> is the so-called '''zeta function''' <math>\zeta</math>, defined as<br />
::<math>\zeta(x,y)=\begin{cases}1&\text{if }x\le_P y,\\0 &\text{otherwise.}\end{cases}</math><br />
:As a matrix (or more accurately, as an element of the incidence algebra), <math>\zeta</math> is invertible and its inversion, denoted by <math>\mu</math>, is called the '''Möbius function'''. More precisely, <math>\mu</math> is also in the incidence algebra <math>I(P)</math>, and <math>\mu\zeta=I</math> where <math>I</math> is the identity matrix (the identity of the incidence algebra <math>I(P)</math>).<br />
<br />
There is an equivalent explicit definition of Möbius function.<br />
{{Theorem|Definition (Möbius function)|<br />
:<math>\mu(x,y)=\begin{cases}<br />
-\sum_{x\le z< y}\mu(x,z)&\text{if }x<y,\\<br />
1&\text{if }x=y,\\<br />
0&\text{if }x\not\le y. <br />
\end{cases}<br />
</math><br />
}}<br />
<br />
To see the equivalence between this definition and the inversion of zeta function, we may have the following proposition, which is proved by directly evaluating <math>\mu\zeta</math>.<br />
{{Theorem|Proposition|<br />
:For any <math>x,y\in P</math>,<br />
::<math>\sum_{x\le z\le y}\mu(x,z)=\begin{cases}1 &\text{if }x=y,\\<br />
0 &\text{otherwise.}\end{cases}</math><br />
}}<br />
{{Proof|<br />
It holds that<br />
:<math>(\mu\zeta)(x,y)=\sum_{x\le z\le y}\mu(x,z)\zeta(z,y)=\sum_{x\le z\le y}\mu(x,z)</math>.<br />
On the other hand, <math>\mu\zeta=I</math>, i.e. <br />
:<math>(\mu\zeta)(x,y)=\begin{cases}1 &\text{if }x=y,\\<br />
0 &\text{otherwise.}\end{cases}</math><br />
The proposition follows.<br />
}}<br />
Note that <math>\mu(x,y)=\sum_{x\le z\le y}\mu(x,z)-\sum_{x\le z< y}\mu(x,z)</math>, which gives the above inductive definition of Möbius function.<br />
<br />
=== Computing Möbius functions===<br />
We consider the simple poset <math>P=[n]</math>, where <math>\le</math> is the total order. It follows directly from the recursive definition of Möbius function that<br />
:<math>\mu(i,j)=\begin{cases}1 & \text{if }i=j,\\<br />
-1 & \text{if }i+1=j,\\<br />
0 & \text{otherwise.}<br />
\end{cases}<br />
</math><br />
<br />
Usually for general posets, it is difficult to directly compute the Möbius function from its definition. We introduce a rule helping us compute the Möbius function by decomposing the poset into posets with simple structures.<br />
<br />
{{Theorem|Theorem (the product rule)|<br />
: Let <math>P</math> and <math>Q</math> be two finite posets, and <math>P\times Q</math> be the poset resulted from Cartesian product of <math>P</math> and <math>Q</math>, where for all <math>(x,y), (x',y')\in P\times Q</math>, <math>(x,y)\le (x',y')</math> if and only if <math>x\le x'</math> and <math>y\le y'</math>. Then<br />
::<math>\mu_{P\times Q}((x,y),(x',y'))=\mu_P(x,x')\mu_Q(y,y')</math>.<br />
}}<br />
{{Proof|<br />
We use the recursive definition <br />
:<math>\mu(x,y)=\begin{cases}<br />
-\sum_{x\le z< y}\mu(x,z)&\text{if }x<y,\\<br />
1&\text{if }x=y,\\<br />
0&\text{if }x\not\le y. <br />
\end{cases}<br />
</math><br />
to prove the equation in the theorem.<br />
<br />
If <math>(x,y)=(x',y')</math>, then <math>x=x'</math> and <math>y=y'</math>. It is easy to see that both sides of the equation are 1. If <math>(x,y)\not\le(x',y')</math>, then either <math>x\not\le x'</math> or <math>y\not\le y'</math>. It is also easy to see that both sides are 0.<br />
<br />
The only remaining case is that <math>(x,y)<(x',y')</math>, in which case either <math>x<x'</math> or <math>y<y'</math>. <br />
:<math><br />
\begin{align}<br />
\sum_{(x,y)\le (u,v)\le (x',y')}\mu_P(x,u)\mu_Q(y,v)<br />
&=\left(\sum_{x\le u\le x'}\mu_P(x,u)\right)\left(\sum_{y\le v\le y'}\mu_Q(y,v)\right)=I(x,x')I(y,y')=0,<br />
\end{align}<br />
</math><br />
where the last two equations are due to the proposition for <math>\mu</math>. Thus<br />
:<math>\mu_P(x,x')\mu_Q(y,y')=-\sum_{(x,y)\le (u,v)< (x',y')}\mu_P(x,u)\mu_Q(y,v)</math>.<br />
<br />
By induction, assume that the equation <math>\mu_{P\times Q}((x,y),(u,v))=\mu_P(x,u)\mu_Q(y,v)</math> is true for all <math>(u,v)< (x',y')</math>. Then<br />
:<math><br />
\begin{align}<br />
\mu_{P\times Q}((x,y),(x',y'))<br />
&=-\sum_{(x,y)\le (u,v)< (x',y')}\mu_{P\times Q}((x,y),(u,v))\\<br />
&=-\sum_{(x,y)\le (u,v)< (x',y')}\mu_P(x,u)\mu_Q(y,v)\\<br />
&=\mu_P(x,x')\mu_Q(y,y'),<br />
\end{align}<br />
</math><br />
which complete the proof.<br />
}}<br />
<br />
;Poset of subsets<br />
:Consider the poset defined by all subsets of a finite universe <math>U</math>, that is <math>P=2^U</math>, and for <math>S,T\subseteq U</math>, <math>S\le_P T</math> if and only if <math>S\subseteq T</math>.<br />
<br />
{{Theorem| Möbius function for subsets|<br />
:The Möbius function for the above defined poset <math>P</math> is that for <math>S,T\subseteq U</math>,<br />
::<math>\mu(S,T)=<br />
\begin{cases}<br />
(-1)^{|T|-|S|} & \text{if }S\subseteq T,\\<br />
0 &\text{otherwise.}<br />
\end{cases}<br />
</math><br />
}}<br />
{{Proof|<br />
We can equivalently represent each <math>S\subseteq U</math> by a boolean string <math>S\in\{0,1\}^U</math>, where <math>S(x)=1</math> if and only if <math>x\in S</math>.<br />
<br />
For each element <math>x\in U</math>, we can define a poset <math>P_x=\{0, 1\}</math> with <math>0\le 1</math>. By definition of Möbius function, the Möbius function of this elementary poset is given by <math>\mu_x(0,0)=\mu_x(1,1)=1</math>, <math>\mu_x(0,1)=-1</math> and <math>\mu(1,0)=0</math>.<br />
<br />
The poset <math>P</math> of all subsets of <math>U</math> is the Cartesian product of all <math>P_x</math>, <math>x\in U</math>. By the product rule,<br />
:<math>\mu(S,T)=\prod_{x\in U}\mu_x(S(x), T(x))=\prod_{x\in S\atop x\in T}1\prod_{x\not\in S\atop x\not\in T}1\prod_{x\in S\atop x\not\in T}0\prod_{x\not\in S\atop x\in T}(-1)=\begin{cases}<br />
(-1)^{|T|-|S|} & \text{if }S\subseteq T,\\<br />
0 &\text{otherwise.}<br />
\end{cases}</math><br />
}}<br />
<br />
:Note that the poset <math>P</math> is actually the [http://en.wikipedia.org/wiki/Boolean_algebra_(structure) Boolean algebra] of rank <math>|U|</math>. The proof relies only on that the fact that the poset is a Boolean algebra, thus the theorem holds for Boolean algebra posets.<br />
<br />
;Posets of divisors<br />
:Consider the poset defined by all devisors of a positive integer <math>n</math>, that is <math>P=\{a>0\mid a|n\}</math>, and for <math>a,b\in P</math>, <math>a\le_P b</math> if and only if <math>a|b\,</math>.<br />
<br />
{{Theorem|Möbius function for divisors|<br />
:The Möbius function for the above defined poset <math>P</math> is that for <math>a,b>0</math> that <math>a|n</math> and <math>b|n</math>,<br />
::<math>\mu(a,b)=<br />
\begin{cases}<br />
(-1)^{r} & \text{if }\frac{b}{a}\text{ is the product of }r\text{ distinct primes},\\<br />
0 &\text{otherwise, i.e. if }a\not|b\text{ or }\frac{b}{a}\text{ is not squarefree.}<br />
\end{cases}<br />
</math><br />
}}<br />
{{Proof|<br />
Denote <math>n=p_1^{n_1}p_2^{n_2}\cdots p_k^{n_k}</math>. Represent <math>n</math> by a tuple <math>(n_1,n_2,\ldots,n_k)</math>. Every <math>a\in P</math> corresponds in this way to a tuple <math>(a_1,a_2,\ldots,a_k)</math> with <math>a_i\le n_i</math> for all <math>1\le i\le k</math>.<br />
<br />
Let <math>P_i=\{1,2,\ldots,n_i\}</math> be the poset with <math>\le</math> being the total order. The poset <math>P</math> of divisors of <math>n</math> is thus isomorphic to the poset constructed by the Cartesian product of all <math>P_i</math>, <math>1\le i\le k</math>. Then<br />
:<math><br />
\begin{align}<br />
\mu(a,b)<br />
&=\prod_{1\le i\le k}\mu(a_i,b_i)=\prod_{1\le i\le k\atop a_i=b_i}1\prod_{1\le i\le k\atop b_i-a_i=1}(-1)\prod_{1\le i\le k\atop b_i-a_i\not\in\{0,1\}}0<br />
=\begin{cases}<br />
(-1)^{\sum_{i}(b_i-a_i)} & \text{if all }b_i-a_i\in\{0,1\},\\<br />
0 &\text{otherwise.}<br />
\end{cases}\\<br />
&=\begin{cases}<br />
(-1)^{r} & \text{if }\frac{b}{a}\text{ is the product of }r\text{ distinct primes},\\<br />
0 &\text{otherwise.}<br />
\end{cases}<br />
\end{align}<br />
</math><br />
}}<br />
<br />
=== Principle of Möbius inversion ===<br />
We now introduce the the famous Möbius inversion formula.<br />
{{Theorem|Möbius inversion formula|<br />
:Let <math>P</math> be a finite poset and <math>\mu</math> its Möbius function. Let <math>f,g:P\rightarrow \mathbb{R}</math>. Then<br />
::<math>\forall x\in P,\,\, g(x)=\sum_{y\le x} f(y)</math>,<br />
:if and only if<br />
::<math>\forall x\in P,\,\, f(x)=\sum_{y\le x}g(y)\mu(y,x)</math>.<br />
}}<br />
The functions <math>f,g:P\rightarrow\mathbb{R}</math> are vectors. Evaluate the matrix multiplications <math>f\zeta</math> and <math>g\mu</math> as follows:<br />
:<math>(f\zeta)(x)=\sum_{y\in P}f(y)\zeta(y,x)=\sum_{y\le x}f(y)</math>,<br />
and <br />
:<math>(g\mu)(x)=\sum_{y\in P}g(y)\mu(y,x)=\sum_{y\le x}g(y)\mu(y,x)</math>.<br />
The Möbius inversion formula is nothing but the following statement<br />
:<math>f\zeta=g\Leftrightarrow f=g\mu</math>,<br />
which is trivially true due to <math>\mu\zeta=I</math> by basic linear algebra.<br />
<br />
The following dual form of the inversion formula is also useful.<br />
{{Theorem|Möbius inversion formula, dual form|<br />
:Let <math>P</math> be a finite poset and <math>\mu</math> its Möbius function. Let <math>f,g:P\rightarrow \mathbb{R}</math>. Then<br />
::<math>\forall x\in P, \,\, g(x)=\sum_{y{\color{red}\ge} x} f(y)</math>,<br />
: if and only if <br />
::<math>\forall x\in P, \,\, f(x)=\sum_{y{\color{red}\ge} x}\mu(x,y)g(y)</math>.<br />
}}<br />
To prove the dual form, we only need to evaluate the matrix multiplications on left:<br />
:<math>\zeta f=g\Leftrightarrow f=\mu g</math>.<br />
<br />
;Principle of Inclusion-Exclusion<br />
:Let <math>A_1,A_2,\ldots,A_n\subseteq U</math>. For any <math>J\subseteq\{1,2,\ldots,n\}</math>, <br />
:*let <math>f(J)</math> be the number of elements that belongs to ''exactly'' the sets <math>A_i, i\in J</math> and to no others, i.e. <br />
:::<math>f(J)=\left|\left(\bigcap_{i\in J}A_i\right)\setminus\left(\bigcup_{i\not\in J}A_i\right)\right|</math>;<br />
:*let <math>g(J)=\left|\bigcap_{i\in J}A_i\right|</math>.<br />
:For any <math>J\subseteq\{1,2,\ldots,n\}</math>, the following relation holds for the above defined <math>f</math> and <math>g</math>:<br />
::<math>g(J)=\sum_{I\supseteq J}f(I)</math>.<br />
:Applying the dual form of the Möbius inversion formula, we have that for any <math>J\subseteq\{1,2,\ldots,n\}</math>,<br />
::<math>f(J)=\sum_{I\supseteq J}\mu(J,I)g(I)=\sum_{I\supseteq J}\mu(J,I)\left|\bigcap_{i\in I}A_i\right|</math>,<br />
:where the Möbius function is for the poset of all subsets of <math>\{1,2,\ldots,n\}</math>, ordered by <math>\subseteq</math>, thus it holds that <math>\mu(J,I)=(-1)^{|I|-|J|}\,</math> for <math>J\subseteq I</math>. Therefore,<br />
::<math>f(J)=\sum_{I\supseteq J}(-1)^{|I|-|J|}\left|\bigcap_{i\in I}A_i\right|</math>.<br />
:We have a formula for the number of elements with exactly those properties <math>A_i, i\in J</math> for any <math>J\subseteq\{1,2,\ldots,n\}</math>. For the special case that <math>J=\emptyset</math>, <math>f(\emptyset)</math> is the number of elements satisfying no property of <math>A_1,A_2,\ldots,A_n</math>, and<br />
::<math>f(\emptyset)=\left|U\setminus\bigcup_iA_i\right|=\sum_{I\subseteq \{1,\ldots,n\}}(-1)^{|I|}\left|\bigcap_{i\in I}A_i\right|</math><br />
:which gives precisely the Principle of Inclusion-Exclusion.<br />
<br />
;Möbius inversion formula for number theory<br />
:The number-theoretical Möbius inversion formula is stated as such: Let <math>N</math> be a positive integer, <br />
::<math>g(n)=\sum_{d|n}f(d)\,</math> for all <math>n|N</math> <br />
:if and only if <br />
::<math>f(n)=\sum_{d|n}g(d)\mu\left(\frac{n}{d}\right)\,</math> for all <math>n|N</math>,<br />
:where <math>\mu</math> is the [http://en.wikipedia.org/wiki/M%C3%B6bius_function number-theoretical Möbius function], defined as<br />
::<math>\mu(n)=\begin{cases}1 & \text{if }n\text{ is product of an even number of distinct primes,}\\<br />
-1 &\text{if }n\text{ is product of an odd number of distinct primes,}\\<br />
0 &\text{otherwise.}\end{cases}</math><br />
:The number-theoretical Möbius inversion formula is just a special case of the Möbius inversion formula for posets, when the poset is the set of divisors of <math>N</math>, and for any <math>a,b\in P</math>, <math>a\le_P b</math> if <math>a|b</math>.<br />
<br />
== Sieve Method in Number Theory ==<br />
=== The Euler totient function ===<br />
Two integers <math>m, n</math> are said to be '''relatively prime''' if their greatest common diviser <math>\mathrm{gcd}(m,n)=1</math>. For a positive integer <math>n</math>, let <math>\phi(n)</math> be the number of positive integers from <math>\{1,2,\ldots,n\}</math> that are relative prime to <math>n</math>. This function, called the Euler <math>\phi</math> function or '''the Euler totient function''', is fundamental in number theory.<br />
<br />
We now derive a formula for this function by using the principle of inclusion-exclusion.<br />
{{Theorem|Theorem (The Euler totient function)|<br />
Suppose <math>n</math> is divisible by precisely <math>r</math> different primes, denoted <math>p_1,\ldots,p_r</math>. Then<br />
:<math>\phi(n)=n\prod_{i=1}^r\left(1-\frac{1}{p_i}\right)</math>.<br />
}}<br />
{{Proof|<br />
Let <math>U=\{1,2,\ldots,n\}</math> be the universe. The number of positive integers from <math>U</math> which is divisible by some <math>p_{i_1},p_{i_2},\ldots,p_{i_s}\in\{p_1,\ldots,p_r\}</math>, is <math>\frac{n}{p_{i_1}p_{i_2}\cdots p_{i_s}}</math>. <br />
<br />
<math>\phi(n)</math> is the number of integers from <math>U</math> which is not divisible by any <math>p_1,\ldots,p_r</math>.<br />
By principle of inclusion-exclusion,<br />
:<math><br />
\begin{align}<br />
\phi(n)<br />
&=n+\sum_{k=1}^r(-1)^k\sum_{1\le i_1<i_2<\cdots <i_k\le n}\frac{n}{p_{i_1}p_{i_2}\cdots p_{i_k}}\\<br />
&=n-\sum_{1\le i\le n}\frac{n}{p_i}+\sum_{1\le i<j\le n}\frac{n}{p_i p_j}-\sum_{1\le i<j<k\le n}\frac{n}{p_{i} p_{j} p_{k}}+\cdots + (-1)^r\frac{n}{p_{1}p_{2}\cdots p_{r}}\\<br />
&=n\left(1-\sum_{1\le i\le n}\frac{1}{p_i}+\sum_{1\le i<j\le n}\frac{1}{p_i p_j}-\sum_{1\le i<j<k\le n}\frac{1}{p_{i} p_{j} p_{k}}+\cdots + (-1)^r\frac{1}{p_{1}p_{2}\cdots p_{r}}\right)\\<br />
&=n\prod_{i=1}^r\left(1-\frac{1}{p_i}\right).<br />
\end{align}<br />
</math><br />
}}<br />
<br />
<br />
== Reference ==<br />
* ''Stanley,'' Enumerative Combinatorics, Volume 1, Chapter 2.<br />
* ''van Lin and Wilson'', A course in combinatorics, Chapter 10, 25.</div>
Etone
https://tcs.nju.edu.cn/wiki/index.php?title=%E7%BB%84%E5%90%88%E6%95%B0%E5%AD%A6_(Spring_2024)&diff=12140
组合数学 (Spring 2024)
2024-03-19T09:50:32Z
<p>Etone: /* Lecture Notes */</p>
<hr />
<div>{{Infobox<br />
|name = Infobox<br />
|bodystyle = <br />
|title = <font size=3>组合数学 <br><br />
Combinatorics</font><br />
|titlestyle = <br />
<br />
|image = <br />
|imagestyle = <br />
|caption = <br />
|captionstyle = <br />
|headerstyle = background:#ccf;<br />
|labelstyle = background:#ddf;<br />
|datastyle = <br />
<br />
|header1 =Instructor<br />
|label1 = <br />
|data1 = <br />
|header2 = <br />
|label2 = <br />
|data2 = 尹一通<br />
|header3 = <br />
|label3 = Email<br />
|data3 = yinyt@nju.edu.cn <br />
|header4 =<br />
|label4= office<br />
|data4= 计算机系 804<br />
|header5 = Class<br />
|label5 = <br />
|data5 = <br />
|header6 =<br />
|label6 = Class meetings<br />
|data6 = Wednesday, 2pm-4pm <br> 仙Ⅱ-211<br />
|header7 =<br />
|label7 = Place<br />
|data7 = <br />
|header8 =<br />
|label8 = Office hours<br />
|data8 = TBA <br>计算机系 804<br />
|header9 = Textbook<br />
|label9 = <br />
|data9 = <br />
|header10 =<br />
|label10 = <br />
|data10 = [[File:LW-combinatorics.jpeg|border|100px]]<br />
|header11 =<br />
|label11 = <br />
|data11 = van Lint and Wilson. <br> ''A course in Combinatorics, 2nd ed.'', <br> Cambridge Univ Press, 2001.<br />
|header12 =<br />
|label12 = <br />
|data12 = [[File:Jukna_book.jpg|border|100px]]<br />
|header13 =<br />
|label13 = <br />
|data13 = Jukna. ''Extremal Combinatorics: <br> With Applications in Computer Science,<br>2nd ed.'', Springer, 2011.<br />
|belowstyle = background:#ddf;<br />
|below = <br />
}}<br />
<br />
This is the webpage for the ''Combinatorics'' class of Spring 2024. Students who take this class should check this page periodically for content updates and new announcements. <br />
<br />
= Announcement =<br />
* TBA<br />
<br />
= Course info =<br />
* '''Instructor ''': 尹一通 ([http://tcs.nju.edu.cn/yinyt/ homepage])<br />
:*'''email''': yinyt@nju.edu.cn<br />
:*'''office''': 计算机系 804 <br />
* '''Teaching assistant''':<br />
** [https://lhy-gispzjz.github.io 刘弘洋] ([mailto:liuhongyang@smail.nju.edu.cn liuhongyang@smail.nju.edu.cn])<br />
** [https://wcysai.com 王淳扬] ([mailto:wcysai@smail.nju.edu.cn wcysai@smail.nju.edu.cn])<br />
* '''Class meeting''': Wednesday, 2pm-4pm, 仙Ⅱ-211.<br />
* '''Office hour''': TBA<br />
:* '''QQ群''': 709281027 (加入时需报姓名、专业、学号)<br />
<br />
= Syllabus =<br />
<br />
=== 先修课程 Prerequisites ===<br />
* 离散数学(Discrete Mathematics)<br />
* 线性代数(Linear Algebra)<br />
* 概率论(Probability Theory)<br />
<br />
=== Course materials ===<br />
* [[组合数学 (Spring 2024)/Course materials|<font size=3>教材和参考书清单</font>]]<br />
<br />
=== 成绩 Grades ===<br />
* 课程成绩:本课程将会有若干次作业和一次期末考试。最终成绩将由平时作业成绩 (≥ 60%) 和期末考试成绩 (≤ 40%) 综合得出。<br />
* 迟交:如果有特殊的理由,无法按时完成作业,请提前联系授课老师,给出正当理由。否则迟交的作业将不被接受。<br />
<br />
=== <font color=red> 学术诚信 Academic Integrity </font>===<br />
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线,本课程将不遗余力的维护学术诚信规范,违反这一底线的行为将不会被容忍。<br />
<br />
作业完成的原则:署你名字的工作必须是你个人的贡献。在完成作业的过程中,允许讨论,前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成,并在作业中致谢(acknowledge)所有参与讨论的人。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。<br />
<br />
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中,对他人工作(出版物、互联网资料、其他人的作业等)直接的文本抄袭和对关键思想、关键元素的抄袭,按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释,都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为,<font color=red> 抄袭和被抄袭双方的成绩都将被取消</font>。因此请主动防止自己的作业被他人抄袭。<br />
<br />
学术诚信影响学生个人的品行,也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为,不仅使自己沦为一个欺骗者,也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。<br />
<br />
= Assignments =<br />
* TBA<br />
<br />
= Lecture Notes =<br />
# [[组合数学 (Fall 2024)/Basic enumeration|Basic enumeration | 基本计数]] ([http://tcs.nju.edu.cn/slides/comb2024/BasicEnumeration.pdf slides])<br />
# [[组合数学 (Fall 2024)/Generating functions|Generating functions | 生成函数]] ([http://tcs.nju.edu.cn/slides/comb2024/GeneratingFunction.pdf slides])<br />
# [[组合数学 (Fall 2024)/Sieve methods|Sieve methods | 筛法]]<br />
<br />
= Resources =<br />
* [http://math.mit.edu/~fox/MAT307.html Combinatorics course] by Jacob Fox<br />
* [https://yufeizhao.com/pm/ Probabilistic Methods in Combinatorics] and [https://yufeizhao.com/gtacbook/ Graph Theory and Additive Combinatorics] by Yufei Zhao<br />
* [https://www.math.uvic.ca/~noelj/combinatoricsLectures.html Combinatorics Lecture Videos online]<br />
* [https://www.math.ucla.edu/~pak/lectures/Math-Videos/comb-videos.htm Collection of Combinatorics Videos]<br />
<br />
= Concepts =<br />
* TBA</div>
Etone