<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="th">
	<id>https://theory.cpe.ku.ac.th/wiki/index.php?action=history&amp;feed=atom&amp;title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552%2F%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F%2F%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5</id>
	<title>418531 ภาคต้น 2552/โจทย์ปัญหาอัลกอริทึมเกี่ยวกับกราฟ/เฉลยข้อ 6.5 - ประวัติรุ่นแก้ไข</title>
	<link rel="self" type="application/atom+xml" href="https://theory.cpe.ku.ac.th/wiki/index.php?action=history&amp;feed=atom&amp;title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552%2F%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F%2F%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5"/>
	<link rel="alternate" type="text/html" href="https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;action=history"/>
	<updated>2026-04-24T23:05:10Z</updated>
	<subtitle>ประวัติรุ่นแก้ไขของหน้านี้ในวิกิ</subtitle>
	<generator>MediaWiki 1.33.1</generator>
	<entry>
		<id>https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7407&amp;oldid=prev</id>
		<title>Aoy เมื่อ 07:18, 16 กันยายน 2552</title>
		<link rel="alternate" type="text/html" href="https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7407&amp;oldid=prev"/>
		<updated>2009-09-16T07:18:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;th&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←รุ่นแก้ไขก่อนหน้า&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;รุ่นแก้ไขเมื่อ 07:18, 16 กันยายน 2552&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;แถว 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;แถว 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[อ้างอิงจาก Algorithm Design, by KLEINBERG and TARDOS, PEARSON Addison Wesley]&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[อ้างอิงจาก Algorithm Design, by KLEINBERG and TARDOS, PEARSON Addison Wesley]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;แนวคิด จากความจริงในข้อย่อย 6.4 เราจะได้ว่าขณะใดขณะหนึ่งที่เราต้องการ node มาเรียงลำดับนั้น ถ้าเราสามารถหา node ที่ไม่มี node อื่นชี้มายังมันได้เลย เราก็จะสามารถรับประกันได้ว่า edge จะชี้จากซ้ายไปขวาเสมอ ดังนั้นการหา topological ordering ใน DAG ก็ทำได้โดยการหา source node มาเรียงกันเรื่อย ๆ ในแต่ละขั้นตอนนั่นเอง และเมื่อนำ node นั้นมาเรียงแล้วให้ทำการลบ node นั้นและ edge ทุก edge ที่ติดกับมัน ออกจากกราฟ ซึ่งถ้าเราสามารถรับประกันได้ว่า การทำแบบนี้จะมี soure node ให้เราเลือกได้เสมอ เราก็จะได้ topological ordering ตามที่เราต้องการ เราจึงจะทำการพิสูจน์ด้วย induction ว่าใน DAG มี topological ordering เสมอ พิจารณา DAG ที่มีหนึ่งหรือสอง node จะได้ว่ามี topological ordering จริง สมมติให้ DAG มี topological ordering สำหรับ DAG ที่มี &amp;lt;math&amp;gt; n \, &amp;lt;/math&amp;gt; node เมื่อให้ DAG ที่มี  &amp;lt;math&amp;gt; n+1 \, &amp;lt;/math&amp;gt; มา เราก็ทำการหา node ที่เป็น source node สมมติให้ node นี้เป็น node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ซึ่งจากความจริงข้อ 6.4 จะสามารถหาได้เสมอ เราก็ทำการวาง node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ดังกล่าวลงไปใน topological ordering การทำแบบนี้จะทำให้ทุก ๆ edge ชี้ออกจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ไปทางขวาเสมอ จากนั้นทำการลบ node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; และ edge ที่ติดกับมันออกจากกราฟ จะได้ว่ากราฟใหม่ &amp;lt;math&amp;gt; G-\{v\} \, &amp;lt;/math&amp;gt; นี้ก็เป็น DAG เนื่องจากการลบ node ออกจากกราฟที่ไม่มี cycle ไม่สามารถทำให้เกิด cycle ใหม่ขึ้นได้ ตอนนี้เราก็สามารถใช้ induction hypothesis หา topological ordering ของกราฟ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; ได้แล้ว เราจะทำการวาง node ที่เป็น source node ของกราฟ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; หลังจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ใน topological ordering การทำแบบนี้ก็จะได้ว่าทุก ๆ edge ในกราฟชี้จากซ้ายไปขวา ดังนั้นจึงเป็น topological ordering  &lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;แนวคิด จากความจริงในข้อย่อย 6.4 เราจะได้ว่าขณะใดขณะหนึ่งที่เราต้องการ node มาเรียงลำดับนั้น ถ้าเราสามารถหา node ที่ไม่มี node อื่นชี้มายังมันได้เลย เราก็จะสามารถรับประกันได้ว่า edge จะชี้จากซ้ายไปขวาเสมอ ดังนั้นการหา topological ordering ใน DAG ก็ทำได้โดยการหา source node มาเรียงกันเรื่อย ๆ ในแต่ละขั้นตอนนั่นเอง และเมื่อนำ node นั้นมาเรียงแล้วให้ทำการลบ node นั้นและ edge ทุก edge ที่ติดกับมัน ออกจากกราฟ ซึ่งถ้าเราสามารถรับประกันได้ว่า การทำแบบนี้จะมี soure node ให้เราเลือกได้เสมอ เราก็จะได้ topological ordering ตามที่เราต้องการ เราจึงจะทำการพิสูจน์ด้วย induction ว่าใน DAG มี topological ordering เสมอ พิจารณา DAG ที่มีหนึ่งหรือสอง node จะได้ว่ามี topological ordering จริง สมมติให้ DAG มี topological ordering สำหรับ DAG ที่มี &amp;lt;math&amp;gt; n \, &amp;lt;/math&amp;gt; node เมื่อให้ DAG ที่มี  &amp;lt;math&amp;gt; n+1 \, &amp;lt;/math&amp;gt; มา เราก็ทำการหา node ที่เป็น source node สมมติให้ node นี้เป็น node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ซึ่งจากความจริงข้อ 6.4 จะสามารถหาได้เสมอ เราก็ทำการวาง node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ดังกล่าวลงไปใน topological ordering การทำแบบนี้จะทำให้ทุก ๆ edge ชี้ออกจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ไปทางขวาเสมอ จากนั้นทำการลบ node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; และ edge ที่ติดกับมันออกจากกราฟ จะได้ว่ากราฟใหม่ &amp;lt;math&amp;gt; G-\{v\} \, &amp;lt;/math&amp;gt; นี้ก็เป็น DAG เนื่องจากการลบ node ออกจากกราฟที่ไม่มี cycle ไม่สามารถทำให้เกิด cycle ใหม่ขึ้นได้ ตอนนี้เราก็สามารถใช้ induction hypothesis หา topological ordering ของกราฟ &amp;lt;math&amp;gt; G-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\&lt;/ins&gt;{v&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\&lt;/ins&gt;} \, &amp;lt;/math&amp;gt; ได้แล้ว เราจะทำการวาง node ที่เป็น source node ของกราฟ &amp;lt;math&amp;gt; G-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\&lt;/ins&gt;{v&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\&lt;/ins&gt;} \, &amp;lt;/math&amp;gt; หลังจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ใน topological ordering การทำแบบนี้ก็จะได้ว่าทุก ๆ edge ในกราฟชี้จากซ้ายไปขวา ดังนั้นจึงเป็น topological ordering  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;จากแนวคิดดังกล่าวนำมาเขียนเป็น pseudocode ได้ดังนี้&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;จากแนวคิดดังกล่าวนำมาเขียนเป็น pseudocode ได้ดังนี้&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
	<entry>
		<id>https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7406&amp;oldid=prev</id>
		<title>Aoy เมื่อ 07:18, 16 กันยายน 2552</title>
		<link rel="alternate" type="text/html" href="https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7406&amp;oldid=prev"/>
		<updated>2009-09-16T07:18:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;th&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←รุ่นแก้ไขก่อนหน้า&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;รุ่นแก้ไขเมื่อ 07:18, 16 กันยายน 2552&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;แถว 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;แถว 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[อ้างอิงจาก Algorithm Design, by KLEINBERG and TARDOS, PEARSON Addison Wesley]&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[อ้างอิงจาก Algorithm Design, by KLEINBERG and TARDOS, PEARSON Addison Wesley]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;แนวคิด จากความจริงในข้อย่อย 6.4 เราจะได้ว่าขณะใดขณะหนึ่งที่เราต้องการ node มาเรียงลำดับนั้น ถ้าเราสามารถหา node ที่ไม่มี node อื่นชี้มายังมันได้เลย เราก็จะสามารถรับประกันได้ว่า edge จะชี้จากซ้ายไปขวาเสมอ ดังนั้นการหา topological ordering ใน DAG ก็ทำได้โดยการหา source node มาเรียงกันเรื่อย ๆ ในแต่ละขั้นตอนนั่นเอง และเมื่อนำ node นั้นมาเรียงแล้วให้ทำการลบ node นั้นและ edge ทุก edge ที่ติดกับมัน ออกจากกราฟ ซึ่งถ้าเราสามารถรับประกันได้ว่า การทำแบบนี้จะมี soure node ให้เราเลือกได้เสมอ เราก็จะได้ topological ordering ตามที่เราต้องการ เราจึงจะทำการพิสูจน์ด้วย induction ว่าใน DAG มี topological ordering เสมอ พิจารณา DAG ที่มีหนึ่งหรือสอง node จะได้ว่ามี topological ordering จริง สมมติให้ DAG มี topological ordering สำหรับ DAG ที่มี &amp;lt;math&amp;gt; n \, &amp;lt;/math&amp;gt; node เมื่อให้ DAG ที่มี  &amp;lt;math&amp;gt; n+1 \, &amp;lt;/math&amp;gt; มา เราก็ทำการหา node ที่เป็น source node สมมติให้ node นี้เป็น node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ซึ่งจากความจริงข้อ 6.4 จะสามารถหาได้เสมอ เราก็ทำการวาง node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ดังกล่าวลงไปใน topological ordering การทำแบบนี้จะทำให้ทุก ๆ edge ชี้ออกจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ไปทางขวาเสมอ จากนั้นทำการลบ node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; และ edge ที่ติดกับมันออกจากกราฟ จะได้ว่ากราฟใหม่ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; นี้ก็เป็น DAG เนื่องจากการลบ node ออกจากกราฟที่ไม่มี cycle ไม่สามารถทำให้เกิด cycle ใหม่ขึ้นได้ ตอนนี้เราก็สามารถใช้ induction hypothesis หา topological ordering ของกราฟ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; ได้แล้ว เราจะทำการวาง node ที่เป็น source node ของกราฟ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; หลังจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ใน topological ordering การทำแบบนี้ก็จะได้ว่าทุก ๆ edge ในกราฟชี้จากซ้ายไปขวา ดังนั้นจึงเป็น topological ordering  &lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;แนวคิด จากความจริงในข้อย่อย 6.4 เราจะได้ว่าขณะใดขณะหนึ่งที่เราต้องการ node มาเรียงลำดับนั้น ถ้าเราสามารถหา node ที่ไม่มี node อื่นชี้มายังมันได้เลย เราก็จะสามารถรับประกันได้ว่า edge จะชี้จากซ้ายไปขวาเสมอ ดังนั้นการหา topological ordering ใน DAG ก็ทำได้โดยการหา source node มาเรียงกันเรื่อย ๆ ในแต่ละขั้นตอนนั่นเอง และเมื่อนำ node นั้นมาเรียงแล้วให้ทำการลบ node นั้นและ edge ทุก edge ที่ติดกับมัน ออกจากกราฟ ซึ่งถ้าเราสามารถรับประกันได้ว่า การทำแบบนี้จะมี soure node ให้เราเลือกได้เสมอ เราก็จะได้ topological ordering ตามที่เราต้องการ เราจึงจะทำการพิสูจน์ด้วย induction ว่าใน DAG มี topological ordering เสมอ พิจารณา DAG ที่มีหนึ่งหรือสอง node จะได้ว่ามี topological ordering จริง สมมติให้ DAG มี topological ordering สำหรับ DAG ที่มี &amp;lt;math&amp;gt; n \, &amp;lt;/math&amp;gt; node เมื่อให้ DAG ที่มี  &amp;lt;math&amp;gt; n+1 \, &amp;lt;/math&amp;gt; มา เราก็ทำการหา node ที่เป็น source node สมมติให้ node นี้เป็น node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ซึ่งจากความจริงข้อ 6.4 จะสามารถหาได้เสมอ เราก็ทำการวาง node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ดังกล่าวลงไปใน topological ordering การทำแบบนี้จะทำให้ทุก ๆ edge ชี้ออกจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ไปทางขวาเสมอ จากนั้นทำการลบ node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; และ edge ที่ติดกับมันออกจากกราฟ จะได้ว่ากราฟใหม่ &amp;lt;math&amp;gt; G-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\&lt;/ins&gt;{v&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\&lt;/ins&gt;} \, &amp;lt;/math&amp;gt; นี้ก็เป็น DAG เนื่องจากการลบ node ออกจากกราฟที่ไม่มี cycle ไม่สามารถทำให้เกิด cycle ใหม่ขึ้นได้ ตอนนี้เราก็สามารถใช้ induction hypothesis หา topological ordering ของกราฟ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; ได้แล้ว เราจะทำการวาง node ที่เป็น source node ของกราฟ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; หลังจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ใน topological ordering การทำแบบนี้ก็จะได้ว่าทุก ๆ edge ในกราฟชี้จากซ้ายไปขวา ดังนั้นจึงเป็น topological ordering  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;จากแนวคิดดังกล่าวนำมาเขียนเป็น pseudocode ได้ดังนี้&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;จากแนวคิดดังกล่าวนำมาเขียนเป็น pseudocode ได้ดังนี้&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
	<entry>
		<id>https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7405&amp;oldid=prev</id>
		<title>Aoy เมื่อ 07:17, 16 กันยายน 2552</title>
		<link rel="alternate" type="text/html" href="https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7405&amp;oldid=prev"/>
		<updated>2009-09-16T07:17:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;th&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←รุ่นแก้ไขก่อนหน้า&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;รุ่นแก้ไขเมื่อ 07:17, 16 กันยายน 2552&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot; &gt;แถว 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;แถว 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;geshi lang=&amp;quot;c&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;geshi lang=&amp;quot;c&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Topological_ordering(G)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    Finde a source node v and order it first&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    G = G-{v}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    Topological_ordering(G-{v}) and append this order after v&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/geshi&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/geshi&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
	<entry>
		<id>https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7404&amp;oldid=prev</id>
		<title>Aoy เมื่อ 07:16, 16 กันยายน 2552</title>
		<link rel="alternate" type="text/html" href="https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7404&amp;oldid=prev"/>
		<updated>2009-09-16T07:16:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;th&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←รุ่นแก้ไขก่อนหน้า&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;รุ่นแก้ไขเมื่อ 07:16, 16 กันยายน 2552&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;แถว 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;แถว 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;อ&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;วัฒนา&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[อ้างอิงจาก Algorithm Design, by KLEINBERG and TARDOS, PEARSON Addison Wesley]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;แนวคิด จากความจริงในข้อย่อย 6&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;4 เราจะได้ว่าขณะใดขณะหนึ่งที่เราต้องการ node มาเรียงลำดับนั้น ถ้าเราสามารถหา node ที่ไม่มี node อื่นชี้มายังมันได้เลย เราก็จะสามารถรับประกันได้ว่า edge จะชี้จากซ้ายไปขวาเสมอ ดังนั้นการหา topological ordering ใน DAG ก็ทำได้โดยการหา source node มาเรียงกันเรื่อย ๆ ในแต่ละขั้นตอนนั่นเอง และเมื่อนำ node นั้นมาเรียงแล้วให้ทำการลบ node นั้นและ edge ทุก edge ที่ติดกับมัน ออกจากกราฟ ซึ่งถ้าเราสามารถรับประกันได้ว่า การทำแบบนี้จะมี soure node ให้เราเลือกได้เสมอ เราก็จะได้ topological ordering ตามที่เราต้องการ เราจึงจะทำการพิสูจน์ด้วย induction ว่าใน DAG มี topological ordering เสมอ พิจารณา DAG ที่มีหนึ่งหรือสอง node จะได้ว่ามี topological ordering จริง สมมติให้ DAG มี topological ordering สำหรับ DAG ที่มี &amp;lt;math&amp;gt; n \, &amp;lt;/math&amp;gt; node เมื่อให้ DAG ที่มี  &amp;lt;math&amp;gt; n+1 \, &amp;lt;/math&amp;gt; มา เราก็ทำการหา node ที่เป็น source node สมมติให้ node นี้เป็น node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ซึ่งจากความจริงข้อ 6.4 จะสามารถหาได้เสมอ เราก็ทำการวาง node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ดังกล่าวลงไปใน topological ordering การทำแบบนี้จะทำให้ทุก ๆ edge ชี้ออกจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ไปทางขวาเสมอ จากนั้นทำการลบ node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; และ edge ที่ติดกับมันออกจากกราฟ จะได้ว่ากราฟใหม่ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; นี้ก็เป็น DAG เนื่องจากการลบ node ออกจากกราฟที่ไม่มี cycle ไม่สามารถทำให้เกิด cycle ใหม่ขึ้นได้ ตอนนี้เราก็สามารถใช้ induction hypothesis หา topological ordering ของกราฟ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; ได้แล้ว เราจะทำการวาง node ที่เป็น source node ของกราฟ &amp;lt;math&amp;gt; G-{v} \, &amp;lt;/math&amp;gt; หลังจาก node &amp;lt;math&amp;gt; v \, &amp;lt;/math&amp;gt; ใน topological ordering การทำแบบนี้ก็จะได้ว่าทุก ๆ edge ในกราฟชี้จากซ้ายไปขวา ดังนั้นจึงเป็น topological ordering &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;จากแนวคิดดังกล่าวนำมาเขียนเป็น pseudocode ได้ดังนี้&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;geshi lang=&amp;quot;c&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/geshi&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
	<entry>
		<id>https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7359&amp;oldid=prev</id>
		<title>Aoy: หน้าที่ถูกสร้างด้วย &#039;อ.วัฒนา&#039;</title>
		<link rel="alternate" type="text/html" href="https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%81%E0%B8%A3%E0%B8%B2%E0%B8%9F/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_6.5&amp;diff=7359&amp;oldid=prev"/>
		<updated>2009-09-09T10:28:59Z</updated>

		<summary type="html">&lt;p&gt;หน้าที่ถูกสร้างด้วย &amp;#039;อ.วัฒนา&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;หน้าใหม่&lt;/b&gt;&lt;/p&gt;&lt;div&gt;อ.วัฒนา&lt;/div&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
</feed>