‹

02 · Algorithms & Data Structures

02 · Algorithms & Data Structures

02 · ​อัลกอริทึม​และ​โครงสร้าง​ข้อมูล

This chapter is the floor immediately above computability: 01 says a task can be done at all, and this floor asks what doing it will cost.

​ชั้นนี้​วาง​อยู่​เหนือ​เรื่อง​คำนวณ​ได้ (computability) ​ขึ้น​มา​หนึ่ง​ชั้น​พอดี — ​บท​ที่ 01 ​บอก​ว่า​งาน​หนึ่ง​ทำได้​หรือไม่ ​ชั้นนี้​ถาม​ว่า​ทำ​แล้ว​เสีย​ต้นทุน​เท่าไร

Given that it can be computed, how well can it be done?

​ใน​เมื่อ​คำนวณ​ได้​แล้ว ​จะ​ทำได้​ดี​แค่​ไหน

In 1960, at a seminar he was running at Moscow State University, Andrey Kolmogorov told the room that multiplying two n-digit numbers must cost on the order of n² elementary operations — that the method every schoolchild learns, digit against digit, is essentially the best there is. It was a reasonable thing to believe. Every multiplication algorithm anyone had written behaved that way, and Kolmogorov was not a man whose conjectures were casually wrong.

​ปี 1960 ​ใน​สัมมนา​ที่​เขา​เป็น​ผู้นำ​ที่​มหาวิทยาลัย​มอสโก Andrey Kolmogorov ​บอก​กับ​คน​ทั้ง​ห้อง​ว่า ​การคูณ​เลข n ​หลัก​สอง​จำนวน​ต้อง​เสีย​ต้นทุน​ราว n² ​ครั้ง​ของ​การกระทำ​พื้นฐาน ​วิธี​ที่​เด็กนักเรียน​ทุกคน​เรียน​กัน ​คูณ​หลัก​ต่อ​หลัก ​คือ​วิธี​ที่​ดี​ที่สุด​เท่าที่​จะ​มี​ได้ ​ความเชื่อ​นี้​มีเหตุผล​รองรับ ​อัลกอริทึม (algorithm) ​การคูณ​ทุก​ตัว​ที่​เคย​มี​คนเขียน​ขึ้น​มา​ล้วน​ทำงาน​แบบ​นั้น ​และ​ข้อ​คาดการณ์​ของ Kolmogorov ​ก็​ไม่​ใช่​ของ​ที่​ผิด​กัน​ง่ายๆ

A student in the room, Anatoly Karatsuba, broke it inside a week. His trick is almost embarrassingly small: cut each number in half. The schoolbook method then wants four half-sized products; Karatsuba noticed that three suffice, because the fourth quantity can be recovered by subtracting the ones you already have. Do that recursively and the cost falls from n² to n^log₂3 — about n^1.585. At the next meeting Kolmogorov reported the refutation himself, and then discontinued the seminar (Karatsuba, The Complexity of Computations, 1995).

​นักศึกษา​ใน​ห้อง​คน​หนึ่ง​ชื่อ Anatoly Karatsuba ​หักล้าง​มัน​ได้​ภายใน​สัปดาห์​เดียว ​กลเม็ด​ของ​เขา​เล็ก​จน​น่าอาย ​คือ​ตัด​เลข​แต่ละ​จำนวน​ออก​เป็น​ครึ่ง ​วิธี​แบบ​ตำรา​ต้อง​ใช้​ผลคูณ​ขนาด​ครึ่ง​ถึง​สี่​ตัว Karatsuba ​เห็น​ว่า​สาม​ตัว​ก็​พอ ​เพราะ​ตัว​ที่สี่​หา​ได้​จาก​การลบ​ตัว​ที่​มี​อยู่แล้ว​ออกจาก​กัน ​ทำ​แบบนี้​ซ้ำ​ลง​ไป​เรื่อยๆ (recursion) ​ต้นทุน​ลด​จาก n² ​เหลือ n^log₂3 ​หรือ​ราว n^1.585 ​การประชุม​ครั้ง​ถัดมา Kolmogorov ​รายงาน​ข้อ​หักล้าง​นั้น​ด้วยตัวเอง ​แล้ว​ปิด​สัมมนา​ไป​เลย (Karatsuba, The Complexity of Computations, 1995)

Nothing in the world had changed that week. No new machine, no new physics. A fact about cost had been discovered, the way facts about nature are discovered — and that is what this floor studies.

​โลก​ไม่​ได้​เปลี่ยนไป​เลย​ใน​สัปดาห์​นั้น ​ไม่​มี​เครื่อง​ใหม่ ​ไม่​มี​ฟิสิกส์​ใหม่ ​สิ่ง​ที่​ถูก​ค้นพบ​คือ​ข้อเท็จจริง​เกี่ยวกับ ​ต้นทุน ​ค้นพบ​ใน​แบบ​เดียว​กับ​ที่​คน​ค้นพบ​ข้อเท็จจริง​เกี่ยวกับ​ธรรมชาติ — ​และ​นี่​คือ​สิ่ง​ที่​ชั้นนี้​ศึกษา

Cost is a shape, not a number. The notation for it was borrowed from number theory: Paul Bachmann introduced big-O in 1894, and Edmund Landau adopted it in 1909, crediting him (MAA Convergence); Donald Knuth's 1976 note in SIGACT News pushed computing to standardize on O, Ω and Θ (Knuth, 1976). Notice what the notation deliberately throws away: constant factors. That is not sloppiness. Constants are the part of the cost that hardware, compilers, and careful coding can move; the growth rate is the part the algorithm itself owns, and no amount of engineering below it will change it. A machine ten times faster buys you a constant. An exponent buys you the future: on Karatsuba's exponents alone, the saving is roughly eighteen-fold at a thousand digits and three hundred-fold at a million.

​ต้นทุน​เป็น​รูปทรง ​ไม่​ใช่​ตัวเลข ​สัญกรณ์​ที่​ใช้​แทน​มัน​ยืม​มาจาก​ทฤษฎี​จำนวน Paul Bachmann ​เสนอ Big-O ​ครั้งแรก​ใน​ปี 1894 Edmund Landau ​รับ​มา​ใช้​ต่อ​ใน​ปี 1909 ​พร้อม​ให้​เครดิต​เขา (MAA Convergence) ​บันทึก​ของ Donald Knuth ​ใน​ปี 1976 ​ใน SIGACT News ​ผลัก​ให้​วงการ​คอมพิวเตอร์​ยึด O, Ω ​และ Θ ​เป็นมาตร​ฐาน​เดียวกัน (Knuth, 1976) ​สังเกต​สิ่ง​ที่​สัญกรณ์​นี้​ตั้งใจ​โยนทิ้ง ​คือ​ค่าคงที่ ​นั่น​ไม่​ใช่​ความมักง่าย ​ค่าคงที่​คือ​ส่วน​ของ​ต้นทุน​ที่​ฮาร์ดแวร์ ​คอมไพเลอร์ ​และ​การเขียน​โค้ด​อย่าง​ระมัดระวัง​ยัง​ขยับ​ได้ ​ส่วน ​อัตรา ​การเติบโต​เป็น​ของ​อัลกอริทึม​เอง ​วิศวกรรม​ชั้นล่าง​เท่าไร​ก็​เปลี่ยน​มัน​ไม่​ได้ ​เครื่อง​ที่​เร็ว​ขึ้น​สิบ​เท่า​ซื้อ​ค่าคงที่​ให้​คุณ ​เลขชี้กำลัง​ซื้อ​อนาคต​ให้​คุณ ​เฉพาะ​เลขชี้กำลัง​ของ Karatsuba ​อย่าง​เดียว​ก็​ประหยัด​ได้​ราว​สิบ​แปด​เท่าที่​พัน​หลัก ​และ​สาม​ร้อย​เท่าที่​ล้าน​หลัก

A small catalogue of strategies covers most of the ground. They are worth knowing by name, because almost every algorithm you will meet is one of them wearing local clothes.

​กลยุทธ์​ไม่​กี่​ข้อ​ครอบคลุม​สนาม​นี้​ไว้​เกือบ​ทั้งหมด ​คุ้ม​ที่จะ​จำไว้​ทีละ​ชื่อ ​เพราะ​แทบ​ทุก​อัลกอริทึม​ที่​คุณ​จะ​เจอ ​คือ​หนึ่ง​ใน​นี้​ที่​สวม​เสื้อผ้า​เฉพาะถิ่น​เข้ามา

Divide and conquer splits a problem into smaller copies of itself, solves those, and stitches the answers together — Karatsuba's trick, and mergesort, which von Neumann wrote out in 1945 in what survives as the earliest example of his coding (Knuth, "Von Neumann's First Computer Program," 1970). Its most famous application is a three-page paper by Volker Strassen with the flatly provocative title "Gaussian elimination is not optimal," which multiplied matrices in about n^2.807 instead of n³ (Numerische Mathematik 13, 1969). The chase it started has run for over half a century and is still running: the published record now stands near n^2.371 (Alman et al., SODA 2025), and nobody knows how far down it goes.

​แบ่ง​แล้ว​พิชิต (divide and conquer) ​แยก​ปัญหา​ออก​เป็น​สำเนา​ย่อย​ของ​ตัวเอง ​แก้​ทีละ​ชิ้น ​แล้ว​เย็บ​คำตอบ​กลับ​เข้าด้วยกัน ​กลเม็ด​ของ Karatsuba ​เป็น​แบบนี้ mergesort ​ก็​เช่นกัน von Neumann ​เขียน​มัน​ไว้​ใน​ปี 1945 ​และ​เหลือ​รอด​มา​เป็นตัว​อย่าง​การเขียน​โค้ด​ชิ้น​แรก​สุด​ของ​เขา (Knuth, "Von Neumann's First Computer Program," 1970) ​การประยุกต์ใช้​ที่​ดังที่​สุด​คือ​เปเปอร์​สาม​หน้า​ของ Volker Strassen ​ตั้งชื่อ​ยั่วยุ​ตรงๆ ​ว่า "Gaussian elimination is not optimal" ​คูณ​เมทริกซ์ (matrix multiplication) ​ได้​ใน​ราว n^2.807 ​แทน n³ (Numerische Mathematik 13, 1969) ​การไล่ล่า​ที่​มัน​จุดชนวน​ไว้​ดำเนิน​มาก​ว่า​ครึ่ง​ศตวรรษ​และ​ยัง​ไม่​จบ ​สถิติ​ที่​ตีพิมพ์​ตอนนี้​อยู่​ราว n^2.371 (Alman et al., SODA 2025) ​และ​ไม่​มี​ใคร​รู้​ว่า​มัน​ลง​ไป​ได้​ลึก​แค่​ไหน

The greedy strategy takes the locally best step and never looks back — either naive or optimal, depending entirely on whether the problem has the structure that rewards it — and when it does, greed is unbeatable. Dijkstra's shortest-path algorithm is the canonical case, published in three pages in 1959 (Numerische Mathematik 1: 269–271). He designed it, by his own account, in about twenty minutes in 1956, without pencil or paper, sitting on a café terrace in Amsterdam while out shopping with his fiancée (oral history, Charles Babbage Institute, 2001).

​กลยุทธ์ greedy ​คว้า​ก้าว​ที่​ดี​ที่สุด​ตรงหน้า​แล้ว​ไม่​หันกลับ​ไป​มอง​อีก ​จะ​ไร้เดียงสา​หรือ​เหมาะ​ที่สุด ​ขึ้นอยู่กับ​ว่า​โจทย์​มี​โครงสร้าง​ที่​ตอบแทน​วิธี​นี้​หรือไม่​ล้วนๆ ​และ​เมื่อ​โจทย์​มี greedy ​ก็​เอาชนะ​ไม่​ได้​เลย ​อัลกอริทึม​หา​เส้นทาง​สั้น​สุด​ของ Dijkstra ​คือ​ตัวอย่าง​คลาสสิก ​ตีพิมพ์​ใน​สาม​หน้า​เมื่อ​ปี 1959 (Numerische Mathematik 1: 269–271) ​ตาม​คำบอกเล่า​ของ​เขา​เอง ​เขา​คิด​มัน​ขึ้น​มา​ใน​ราว​ยี่สิบ​นาที​เมื่อ​ปี 1956 ​ไม่​มี​ดินสอ ​ไม่​มี​กระดาษ ​นั่ง​อยู่​ที่​ระเบียง​คาเฟ่​ใน​อัมสเตอร์ดัม​ระหว่าง​ออก​ไป​ช็อปปิ้ง​กับ​คู่หมั้น (oral history, Charles Babbage Institute, 2001)

When subproblems repeat, dynamic programming says to remember rather than recompute. Richard Bellman developed it at RAND, where he worked from 1948 to 1965, and the name is a deliberate disguise: RAND answered to a Secretary of Defense who, in Bellman's telling, "had a pathological fear and hatred of the word research," so he chose two words nobody could object to (Dreyfus, "Richard Bellman on the Birth of Dynamic Programming," Operations Research 50, no. 1, 2002). The technique is more honest than its name — it is simply the trade of memory for time.

​เมื่อ​โจทย์​ย่อย​เกิด​ซ้ำ dynamic programming ​สั่ง​ให้​จำไว้ ​ไม่​ใช่​คำนวณ​ใหม่ Richard Bellman ​พัฒนา​มัน​ขึ้น​ที่ RAND ​ที่​ซึ่ง​เขา​ทำงาน​อยู่​ตั้งแต่​ปี 1948 ​ถึง 1965 ​ชื่อ​นี้​เป็นการ​อำพราง​ที่ตั้ง​ใจ RAND ​ขึ้น​ตรง​กับ​รัฐมนตรี​กลาโหม​ที่​ตาม​คำบอกเล่า​ของ Bellman "​กลัว​และ​เกลียด​คำ​ว่า research ​อย่าง​ผิดปกติ" ​เขา​จึง​หยิบ​สอง​คำ​ที่​ไม่​มี​ใคร​ค้าน​ได้มา​ใช้​แทน (Dreyfus, "Richard Bellman on the Birth of Dynamic Programming," Operations Research 50, no. 1, 2002) ​ตัว​เทคนิค​ซื่อตรง​กว่า​ชื่อ​ของ​มัน ​มัน​คือ​การแลก​หน่วยความจำ​เอา​เวลา​กลับมา ​เท่านั้นเอง

Strangest of the four is randomization, which wins by refusing to be predictable. Tony Hoare devised Quicksort in 1959–60 as a student in Moscow, working on machine translation of Russian, and published it in 1962 (The Computer Journal 5, no. 1: 10–16). Its worst case is quadratic and an adversary who knows your rule can force it every time; choose the pivot at random and that adversary is disarmed, because now they would have to guess your dice.

​แปลกที่​สุด​ใน​สี่​กลยุทธ์​นี้​คือ ​การสุ่ม (randomization) ​ที่​ชนะ​ด้วย​การไม่​ยอมให้​ใคร​ทาย​ทาง​ถูก Tony Hoare ​คิด Quicksort ​ขึ้น​ระหว่าง​ปี 1959–60 ​ตอน​เป็น​นักศึกษา​อยู่​ที่​มอสโก ​ทำงาน​ด้าน​การแปล​ภาษา​รัสเซีย​ด้วย​เครื่อง ​และ​ตีพิมพ์​มัน​ใน​ปี 1962 (The Computer Journal 5, no. 1: 10–16) ​กรณี​แย่​สุด (worst case) ​ของ​มัน​เป็น​แบบ​ยกกำลัง​สอง (quadratic) ​และ​ฝ่ายตรงข้าม (adversary) ​ที่​รู้​กฎ​ของ​คุณ​บังคับ​ให้​เกิด​กรณี​นั้น​ได้​ทุกครั้ง ​เลือก​จุด​หมุน (pivot) ​แบบ​สุ่ม ​ฝ่ายตรงข้าม​คน​นั้น​ก็​หมด​อาวุธ ​เพราะ​เขา​ต้อง​เดา​ลูกเต๋า​ของ​คุณ​ให้​ถูก​เสีย​ก่อน

A data structure is a payment plan. This is the idea that makes the second half of the field cohere. An unsorted array is cheap to add to and expensive to search: you pay at query time, every time. Sorting it is prepayment — one large charge now in exchange for logarithmic lookups forever after. A hash table pays at insertion for near-instant equality lookups but cannot answer "what comes next"; a balanced tree charges a little more per operation and answers ordered questions the hash table cannot. Databases call the same decision an index, and the trade is identical: writes get slower so that reads get faster (chapter 08). Nothing here is free; you are choosing only the currency. And the currency need not be time at all — precompute a lookup table and you have bought speed with memory, which is the space–time trade in its purest form.

​โครงสร้าง​ข้อมูล (data structure) ​คือ​แผนการ​ผ่อน​จ่าย ​ไอเดีย​นี้​เอง​ที่​ทำให้​ครึ่งหลัง​ของ​สาขา​นี้​เชื่อม​กัน​เป็น​เนื้อ​เดียว ​อาร์​เรย์​ที่​ยัง​ไม่​เรียงลำดับ​เติม​ข้อมูลเข้า​ไป​ได้​ถูก ​แต่​ค้นหา (search) ​แพง ​คุณ​จ่าย​ตอน​คิว​รี (query) ​ทุกครั้ง​ไป ​เรียงลำดับ (sorting) ​มัน​เสีย​ก่อน​คือ​การจ่ายล่วงหน้า ​ก้อน​ใหญ่​ครั้ง​เดียว​ตอนนี้ ​แลก​กับ​การค้นหา​แบบ​ลอการิทึม​ไป​ตลอด hash table ​จ่าย​ตอน​ใส่​ข้อมูล ​ได้การ​ค้นหา​ความเท่ากัน​ที่​เร็ว​เกือบ​ทันที​กลับมา ​แต่​ตอบคำถาม​ว่า "​ตัว​ถัดไป​คือ​อะไร" ​ไม่​ได้ ​ต้นไม้​สมดุล (balanced tree) ​คิดราคา​ต่อ​การกระทำ​แพง​กว่า​นิดหน่อย ​แต่​ตอบคำถาม​เชิง​ลำดับ​ที่ hash table ​ตอบ​ไม่​ได้ ​ฐานข้อมูล​เรียก​การตัดสินใจ​อัน​เดียวกัน​นี้​ว่า​ดัชนี (index) ​และ​การแลก​ได้​แลก​เสีย​ก็​เหมือนกัน​เป๊ะ ​เขียน​ช้า​ลง​เพื่อให้​อ่าน​เร็ว​ขึ้น (​บท​ที่ 08) ​ไม่​มี​อะไร​ใน​นี้​ฟรี ​คุณ​เลือก​ได้​แค่​สกุล​เงิน​ที่จะ​จ่าย ​และ​สกุล​เงิน​นั้น​ไม่​จำเป็นต้อง​เป็นเวลา​ด้วยซ้ำ ​คำนวณ​ตาราง​ค้นหา​ไว้​ล่วงหน้า ​คุณ​ก็​ซื้อ​ความเร็ว​มา​ด้วย​หน่วยความจำ ​นี่​คือ​การแลก​กัน​ระหว่าง​พื้นที่​กับ​เวลา​ใน​รูป​ที่​บริสุทธิ์​ที่สุด

Some costs are floors, not failures of imagination. Any algorithm that sorts by comparing elements is, in effect, a decision tree: each comparison branches two ways, and the tree must have a distinct leaf for every one of the n! possible orderings. A binary tree with n! leaves has depth at least log₂(n!), which grows like n log n. So no comparison sort can beat Ω(n log n) — not one that is cleverer, only one that stops comparing. Counting sort escapes precisely because it looks at the values themselves rather than at pairwise comparisons. Notice that this is chapter 01's move — counting what a procedure can possibly distinguish — aimed at cost rather than at possibility.

​ต้นทุน​บางอย่าง​คือ​ขอบ​ล่าง (lower bound) ​ไม่​ใช่​ความล้มเหลว​ทาง​จินตนาการ ​อัลกอริทึม​ที่​เรียงลำดับ​ด้วย​การเปรียบ​เทียบ​สมาชิก (comparison sort) ​โดย​เนื้อแท้​คือ​ต้นไม้​การตัดสินใจ (decision tree) ​การเปรียบ​เทียบ​แต่ละครั้ง​แตก​ออก​สอง​ทาง ​และ​ต้นไม้​ต้อง​มี​ใบ​ที่​ต่างกัน​ครบ​ทุก​หนึ่ง​ใน​ลำดับ​ที่​เป็นไปได้ n! ​แบบ ​ต้นไม้​แบบ​ไบนารี (binary tree) ​ที่​มี n! ​ใบ ​ลึก​อย่าง​น้อย log₂(n!) ​ซึ่ง​โต​แบบ n log n ​ฉะนั้น​ไม่​มี comparison sort ​ตัว​ไหน​เอาชนะ Ω(n log n) ​ได้ ​ตัว​ที่​ฉลาด​กว่า​ก็​ไม่​ช่วย ​มี​แต่​ตัว​ที่​เลิก​เปรียบเทียบ​เท่านั้น​ที่​ทำได้ counting sort ​หลุด​ออก​ไป​ได้​เพราะ​มัน​มอง​ที่​ค่า​จริงๆ ​แทน​การเปรียบ​เทียบ​เป็น​คู่ๆ ​สังเกตว่า​นี่​คือ​ท่าเดียว​กับ​บท​ที่ 01 — ​นับว่า​กระบวนการ​หนึ่ง​แยกแยะ​อะไร​ได้​บ้าง — ​เพียงแต่​เล็ง​ไป​ที่​ต้นทุน​แทน​ความเป็นไปได้

And the model leaks. Big-O hides constants, and sometimes the constants are the whole story: Lipton and Regan named the class of galactic algorithms — asymptotically superior, never used, because the input size at which they win exceeds anything that exists (2010). Big-O also hides the machine. Two loops with identical asymptotic cost can differ tenfold because one walks memory in order and the other jumps, which is chapter 04's floor leaking upward. And worst case is not typical case, as chapter 01's SAT solvers demonstrate daily. Asymptotic cost is the price on the label; what you pay at the till still depends on the machine.

​แบบจำลอง​นี้​รั่ว (leak) ​ด้วย Big-O ​ซ่อน​ค่าคงที่​ไว้ ​และ​บางครั้ง​ค่าคงที่​นั่นแหละ​คือ​เรื่อง​ทั้งหมด Lipton ​และ Regan ​ตั้งชื่อ​กลุ่ม​นี้​ว่า ​อัลกอริทึม​กา​แล็กติก (galactic algorithms) ​คือ​พวก​ที่​เหนือกว่า​ใน​เชิงเส้น​กำกับ (asymptotic) ​แต่​ไม่​เคย​ถูก​ใช้​จริง ​เพราะ​ขนาด​อินพุต​ที่​มัน​เริ่ม​ชนะ​นั้น​ใหญ่​เกิน​กว่า​อะไร​ที่​มี​อยู่​จริง (2010) Big-O ​ซ่อนตัว​เครื่อง​ไว้​อีก​ชั้น ​ลูป​สอง​ลูป​ที่​มี​ต้นทุน​แบบ asymptotic ​เท่ากัน​เป๊ะ ​ต่างกัน​สิบ​เท่า​ได้ ​เพราะ​ลูป​หนึ่ง​เดิน​หน่วยความจำ​เรียง​ตามลำดับ ​อีก​ลูป​กระโดด​ไปมา ​นั่น​คือ​ชั้น​ของ​บท​ที่ 04 ​รั่ว​ขึ้น​มา ​และ​กรณี​แย่​สุด​ก็​ไม่​ใช่​กรณี​ทั่วไป ​อย่าง​ที่​ตัว​แก้ปัญหา SAT (SAT solvers) ​ใน​บท​ที่ 01 ​แสดงให้เห็น​ทุกวัน ​ต้นทุน​แบบ asymptotic ​คือ​ราคา​บน​ป้าย ​สิ่ง​ที่​คุณ​จ่าย​จริง​ตอน​หน้า​เคาน์เตอร์​ยัง​ขึ้นกับ​ตัว​เครื่อง​อยู่ดี

Connections

​เชื่อมโยง

Below: 01, which decides what is possible before this floor asks what it costs. Beside it: 03, which supplies the counting that turns log₂(n!) into a genuine information-theoretic bound. Above: 04, where the memory hierarchy decides which constant factors are real; 08, where B-trees are a data structure shaped by the cost of touching a disk; 12, where the training of a model is dominated by exactly the matrix multiplication Strassen attacked.

​ชั้นล่าง: ​บท​ที่ 01 ​ตัดสิน​ว่า​อะไร​เป็นไปได้ ​ก่อนที่​ชั้นนี้​จะ​ถาม​ว่า​มัน​มี​ต้นทุน​เท่าไร ​ชั้น​ข้างเคียง: ​บท​ที่ 03 ​ให้การ​นับ​ที่​เปลี่ยน log₂(n!) ​ให้​เป็น​ขอบเขต​เชิงทฤษฎี​สารสนเทศ (information-theoretic bound) ​ตัวจริง ​ชั้นบน: ​บท​ที่ 04 ​ที่​ลำดับชั้น​หน่วยความจำ (memory hierarchy) ​ตัดสิน​ว่า​ค่าคงที่​ตัว​ไหน​มีผล​จริง ​บท​ที่ 08 ​ที่ B-tree ​เป็น​โครงสร้าง​ข้อมูล​ที่​ถูก​ปั้น​ขึ้น​ด้วย​ต้นทุน​ของ​การแตะ​ดิสก์ ​บท​ที่ 12 ​ที่​การเท​รน​โมเดล​ถูก​ครอบงำ​โดย​การคูณ​เมทริกซ์​ตัว​เดียว​กับ​ที่ Strassen ​เข้า​โจมตี

Open questions

​คำถาม​ที่​ยัง​เปิด​อยู่

Is the true exponent of matrix multiplication 2? Sixty years of work has moved it from 3 to about 2.371 and stalled far above the obvious lower bound. More broadly: is worst-case analysis still the right instrument, when the algorithms that matter commercially are judged on inputs that are anything but adversarial? And is the catalogue of strategies above complete — or is there a fifth idea, as basic as divide-and-conquer, that nobody has had yet?

​เลขชี้กำลัง​ที่แท้​จริง​ของ​การคูณ​เมทริกซ์​คือ 2 ​หรือไม่ ​หกสิบ​ปี​ของ​ความพยายาม​เลื่อน​มัน​จาก 3 ​มา​อยู่​ราว 2.371 ​แล้ว​ค้าง​อยู่​ห่าง​จาก​ขอบ​ล่าง​ที่​ชัดเจน​อยู่​มาก ​มอง​กว้าง​กว่า​นั้น — ​การวิเคราะห์​กรณี​แย่​สุด (worst-case analysis) ​ยัง​เป็น​เครื่องมือ​ที่​ถูกต้อง​อยู่​หรือไม่ ​ใน​เมื่อ​อัลกอริทึม​ที่​สำคัญ​เชิงพาณิชย์​ถูก​ตัดสิน​บน​อินพุต​ที่​ไม่​ได้​เป็นปฏิปักษ์​เลย​สักนิด ​และ​รายการ​กลยุทธ์​ข้างต้น​ครบ​แล้ว​หรือยัง ​หรือยัง​มี​ไอเดีย​ที่​ห้า ​พื้นฐาน​พอๆ ​กับ divide-and-conquer ​ที่​ยัง​ไม่​มี​ใคร​คิดถึง​มัน

Go deeper

​อ่าน​ต่อ

  • Cormen, Leiserson, Rivest & Stein, Introduction to Algorithms, 4th ed., MIT Press, 2022 — the reference; §8.1 has the sorting lower bound in full (MIT Press).
  • Edsger Dijkstra, "A Note on Two Problems in Connexion with Graphs," Numerische Mathematik 1 (1959): 269–271 — three pages, two algorithms, no wasted sentence (PDF).
  • Volker Strassen, "Gaussian elimination is not optimal," Numerische Mathematik 13 (1969): 354–356 — three pages that started a fifty-year race (Springer).
  • Cormen, Leiserson, Rivest & Stein, Introduction to Algorithms, 4th ed., MIT Press, 2022 — ​เล่ม​อ้างอิง​หลัก §8.1 ​มี​ขอบ​ล่าง​ของ​การเรียง​ลำดับ​แบบ​เต็ม​รูปแบบ (MIT Press).
  • Edsger Dijkstra, "A Note on Two Problems in Connexion with Graphs," Numerische Mathematik 1 (1959): 269–271 — ​สาม​หน้า ​สอง​อัลกอริทึม ​ไม่​มี​ประโยค​ไหน​ฟุ่มเฟือย (PDF).
  • Volker Strassen, "Gaussian elimination is not optimal," Numerische Mathematik 13 (1969): 354–356 — ​สาม​หน้าที่​จุดชนวน​การแข่งขัน​ที่​ยาวนาน​ห้าสิบ​ปี (Springer).
บทถัดไป · 4 / 1603 · Information & Coding
Size
Page
Font

The Tower of Abstractions — An Encyclopedia of the Computing Disciplines

❦
100 · The Map00 · แผนที่201 · Theory of Computation01 · ทฤษฎีการคำนวณ302 · Algorithms & Data Structures02 · อัลกอริทึมและโครงสร้างข้อมูล403 · Information & Coding03 · สารสนเทศและการเข้ารหัส504 · Computer Architecture04 · สถาปัตยกรรมคอมพิวเตอร์605 · Operating Systems05 · ระบบปฏิบัติการ706 · Languages & Compilers06 · ภาษาและคอมไพเลอร์807 · Software Engineering07 · วิศวกรรมซอฟต์แวร์908 · Databases08 · ฐานข้อมูล1009 · Networks09 · เครือข่าย1110 · Distributed Systems10 · ระบบกระจาย1211 · Security & Cryptography11 · ความปลอดภัยและวิทยาการรหัสลับ1312 · AI & Machine Learning12 · ปัญญาประดิษฐ์และการเรียนรู้ของเครื่อง1413 · HCI & Graphics13 · ปฏิสัมพันธ์มนุษย์–คอมพิวเตอร์ และกราฟิกส์1514 · The Frontier14 · พรมแดน1699 · Closing — The Tower, Seen Whole99 · ปิดเล่ม — หอคอยเมื่อมองทั้งหลัง