‹

06 · The Wall

06 · The Wall

06 · ​กำแพง

THE SHORTEST PATH — A History of the Art and Science of Problem-Solving

​เส้นทาง​ที่​สั้น​ที่สุด — ​ประวัติศาสตร์​ของ​ศิลปะ​และ​ศาสตร์​แห่ง​การแก้ปัญหา



A letter to a dying man

​จดหมาย​ถึง​ชาย​ที่​กำลังจะ​ตาย

In the spring of 1956, John von Neumann was fifty-three years old and dying of cancer, confined increasingly to Walter Reed hospital, his once-astonishing productivity narrowing to whatever his failing body would allow. Kurt Gödel — his old friend from Vienna, the logician who had shattered Hilbert's dream of a complete and consistent mathematics twenty-five years earlier — wrote to him that March, and by most accounts the letter was partly an attempt to give a brilliant, dying mind something to chew on besides its own decline.

​ฤดูใบไม้ผลิ​ปี 1956 John von Neumann ​อายุ​ห้าสิบ​สาม ​กำลังจะ​ตาย​ด้วย​โรคมะเร็ง ​และ​ถูก​กักตัว​อยู่​ใน​โรงพยาบาล Walter Reed ​นาน​ขึ้น​ทุกที ​ผลงาน​ที่​เคย​ไหล​ออกมา​ไม่​หยุด​หด​เหลือ​เท่าที่​ร่างกาย​ที่​กำลัง​ทรุด​จะ​ยอมให้​ทำ ​เดือน​มีนาคม​ปี​นั้น Kurt Gödel ​เขียนจดหมาย​ถึง​เขา Gödel ​คือ​เพื่อนเก่า​จาก​เวียนนา ​นัก​ตรรกวิทยา​ที่​ทุบ​ความฝัน​ของ Hilbert ​เรื่อง​คณิตศาสตร์​ที่​ครบถ้วน​และ​สอดคล้อง​ใน​ตัวเอง​จน​แตก​เมื่อ​ยี่สิบ​ห้า​ปีก่อน ​ตาม​คำบอกเล่า​ส่วนใหญ่ ​จดหมาย​ฉบับ​นั้น​ส่วนหนึ่ง​เขียน​ขึ้น​เพื่อ​หา​อะไร​ให้​สมอง​ที่​เฉียบแหลม​และ​กำลังจะ​ดับ​ได้​ขบคิด ​นอกเหนือ​ไป​จาก​ความเสื่อม​ถอย​ของ​ตัว​มัน​เอง

The question Gödel posed was technical, almost casual in its phrasing, and it would take computer science another decade and a half to realize what he had actually asked. Consider a mathematical statement of a certain length. Checking whether a proposed proof of that statement is correct can obviously be done quickly — you just verify each step. But how long does it take to find a proof at all, if one exists? Gödel wanted to know whether this search could always be done in time roughly proportional to the length of the statement (or its square), rather than growing explosively as statements get longer. He was, in effect, asking whether finding is fundamentally harder than checking — the question that decades later would be given the name P versus NP (Cornell eCommons, "Gödel, von Neumann and the P=?NP Problem"; Panda Notes, "Gödel's Letter to von Neumann"). Von Neumann died the following February. Whether he ever replied is not known; no response survives. The question sat, essentially unnoticed outside a small circle, for fifteen more years.

​คำถาม​ของ Gödel ​เป็น​คำถาม​เชิง​เทคนิค ​เขียน​เกือบ​เหมือน​เอ่ย​ผ่านๆ ​และ​วิทยาการ​คอมพิวเตอร์​ต้อง​ใช้เวลา​อีก​สิบห้า​ปีก​ว่า​จะ​รู้ตัว​ว่า​เขา​ถาม​อะไร​ไป​กัน​แน่ ​เอา​ข้อความ​ทาง​คณิตศาสตร์​ที่​มี​ความยาว​ค่า​หนึ่ง​มา​ตั้ง ​การตรวจ​ว่า​บทพิสูจน์​ที่​มี​คน​เสนอ​มา​สำหรับ​ข้อความ​นั้น*​ถูกต้อง*​หรือไม่ ​ทำได้​เร็ว​อยู่แล้ว​อย่าง​เห็นได้ชัด — ​ตรวจสอบ​ทีละ​ก้าว​ก็​จบ ​แต่​ถ้า​บทพิสูจน์​มี​อยู่ ​การ*​หา*​มัน​ให้​เจอ​ตั้งแต่​ต้น​ใช้เวลานาน​แค่​ไหน Gödel ​อยากรู้​ว่าการ​ค้นหา (search) ​นี้​ทำให้​เสร็จ​ได้​เสมอ​ไหม​ใน​เวลา​ที่​แปรผัน​คร่าวๆ ​ตาม​ความยาว​ของ​ข้อความ (​หรือ​กำลัง​สอง​ของ​ความยาว​นั้น) ​แทนที่จะ​โต​ระเบิด​เมื่อ​ข้อความ​ยาว​ขึ้น ​เอา​เข้า​จริง​เขา​กำลัง​ถาม​ว่าการ*​หา*​ยาก​กว่า​การ*​ตรวจ*​โดย​พื้นฐาน​หรือเปล่า ​คำถาม​นี้​อีก​หลาย​ทศวรรษ​ต่อมา​จะ​ได้ชื่อ​ว่า P versus NP (Cornell eCommons, "Gödel, von Neumann and the P=?NP Problem"; Panda Notes, "Gödel's Letter to von Neumann") Von Neumann ​เสียชีวิต​ใน​เดือน​กุมภาพันธ์​ปี​ถัดมา ​เขา​เคย​ตอบ​หรือไม่ ​ไม่​มี​ใคร​รู้; ​ไม่​มี​คำตอบ​หลงเหลือ​มาถึง​เรา ​คำถาม​นี้​นอน​นิ่ง​อยู่​อีก​สิบห้า​ปี ​แทบ​ไม่​มี​ใคร​นอก​วง​เล็กๆ ​สังเกตเห็น

This chapter is about what happened when the question was finally answered — not solved, but given a precise shape and a name — and about the strange, double-edged discovery that followed: that some problems appear to resist every clever reframing this book has celebrated so far, and that this resistance, once proven, becomes a kind of knowledge in its own right.

​บท​นี้​ว่าด้วย​สิ่ง​ที่เกิด​ขึ้น​เมื่อ​คำถาม​นี้​ได้​คำตอบ​ในที่สุด — ​ไม่​ใช่​ถูก​แก้ ​แต่​ได้รูป​ทรง​ที่​ชัดเจน​และ​ได้ชื่อ — ​และ​ว่าด้วย​การค้นพบ​ที่​แปลก​และ​มี​คม​สอง​ด้าน​ที่​ตามมา ​ปัญหา​บาง​ข้อ​ดูจะ​ต้านทาน​การเปลี่ยน​กรอบ (reframe) ​อัน​ชาญฉลาด*​ทุก​แบบ*​ที่​หนังสือ​เล่ม​นี้​ยกย่อง​มา​จนถึง​ตอนนี้ ​และ​เมื่อ​พิสูจน์​การต้าน​ทาน​นั้น​ได้​แล้ว ​มัน​ก็​กลายเป็น​ความรู้​ชนิด​หนึ่ง​ใน​ตัว​มัน​เอง

One Disease, Many Symptoms

​โรค​เดียว ​อาการ​มากมาย

The formal birth of the field came in 1971, when Stephen Cook, then at the University of Toronto, published a short paper titled "The Complexity of Theorem-Proving Procedures." Cook studied the Boolean satisfiability problem, SAT: given a logical formula built from variables that can each be TRUE or FALSE, connected by ANDs, ORs, and NOTs, is there some assignment of values that makes the whole formula true? Checking a proposed assignment is trivial — plug in the values and evaluate. Finding one, when the formula has thousands of variables locked together by thousands of constraints, seemed to require something close to trying all possibilities.

​สาขา​นี้​ถือกำเนิด​อย่าง​เป็นทางการ​ใน​ปี 1971 ​เมื่อ Stephen Cook ​ซึ่ง​ตอนนั้น​อยู่​ที่ University of Toronto ​ตีพิมพ์​บทความ​สั้น​ชื่อ "The Complexity of Theorem-Proving Procedures" Cook ​ศึกษา​ปัญหา​ความสอดคล้อง​ได้​แบบบูล (Boolean satisfiability) ​หรือ SAT: ​ให้​สูตร​ตรรกะ​ที่​สร้าง​จาก​ตัวแปร​ที่​แต่ละ​ตัว​เป็น TRUE ​หรือ FALSE ​ได้ ​เชื่อม​กัน​ด้วย AND, OR ​และ NOT — ​มี​การกำ​หนด​ค่า*​ชุด​ใด​ชุด​หนึ่ง*​ที่​ทำให้​สูตร​ทั้ง​สูตร​เป็นจริง​หรือไม่ ​ตรวจการ​กำหนด​ค่าที่​เสนอ​มา​นั้น​ง่าย​มาก — ​แทนค่า​ลง​ไป​แล้ว​ประเมิน ​หา​การกำ​หนด​ค่า​สัก​ชุด​นั้น​อีก​เรื่อง ​เมื่อ​สูตร​มี​ตัวแปร​เป็น​พัน​ตัว​ที่​ล็อก​เข้าด้วยกัน​ด้วย​ข้อจำกัด​เป็น​พัน​ข้อ ​ดูจะ​ต้อง​ใช้​อะไร​ที่​ใกล้เคียง​กับ​การลอง​ทุก​ความเป็นไปได้

Cook's insight was not to solve SAT faster. It was to show that SAT is, in a precise sense, the hardest problem of its kind: any problem whose solutions can be quickly checked (this class is called NP, for "nondeterministic polynomial time") can be systematically translated — "reduced" — into an equivalent instance of SAT, using only a modest, efficient amount of computation to perform the translation. If you could solve SAT quickly, you could solve anything checkable-in-NP quickly, by first translating it into SAT. This property earned SAT the label NP-complete: complete, in the sense of capturing the full difficulty of the entire class (GeeksforGeeks, "Cook–Levin Theorem"). Working independently and in near-total isolation behind the Iron Curtain, the Soviet mathematician Leonid Levin arrived at essentially the same result at almost the same time, framed slightly differently, around 1973 — a discovery so cleanly convergent that the result now carries both names, the Cook–Levin theorem, an acknowledgment that important mathematical truths sometimes get discovered twice by people who have never read each other's work.

​การหยั่ง​เห็น (insight) ​ของ Cook ​ไม่​ใช่​การแก้ SAT ​ให้​เร็ว​ขึ้น ​แต่​คือ​การแสดง​ว่า SAT ​เป็นปัญหา​ที่*​ยาก​ที่สุด*​ใน​ชนิด​ของ​มัน ​ใน​ความหมาย​ที่​แม่นยำ: ​ปัญหา​ใด​ก็ตาม​ที่​ตรวจ​คำตอบ​ได้​เร็ว (​คลาส​นี้​เรียก​ว่า NP ​ย่อ​จาก "nondeterministic polynomial time") ​แปล​อย่าง​เป็นระบบ — "​ลดรูป" — ​ไป​เป็น​อิน​สแตนซ์ (instance) ​ของ SAT ​ที่​สมมูล​กัน​ได้ ​และ​การแปล​นั้น​ใช้การ​คำนวณ​เพียง​เล็กน้อย​และ​มีประสิทธิภาพ ​ถ้า​แก้ SAT ​ได้​เร็ว ​ก็​แก้*​อะไรก็ตาม*​ที่​ตรวจ​ได้​ใน NP ​ได้​เร็ว ​เพียง​แปล​มัน​เป็น SAT ​ก่อน ​คุณสมบัติ​นี้​ทำให้ SAT ​ได้​ป้าย NP-complete: complete ​ใน​ความหมาย​ว่า​มัน​จับความ​ยาก​ทั้งหมด​ของ​คลาส​ทั้ง​คลาส​ไว้​ได้ (GeeksforGeeks, "Cook–Levin Theorem") ​ผลลัพธ์​เดียวกัน​ใน​สาระสำคัญ​ถูก​ค้นพบ​อีกครั้ง​ใน​เวลา​ไล่เลี่ยกัน ​ราว​ปี 1973 ​โดย​นัก​คณิตศาสตร์​โซเวียต Leonid Levin ​ที่ทำงาน​อย่าง​เป็นอิสระ​และ​แทบจะ​โดดเดี่ยว​สิ้นเชิง​อยู่​หลัง​ม่านเหล็ก ​โดย​จัด​กรอบ​ต่าง​ออก​ไป​เล็กน้อย ​การค้นพบ​บรรจบ​กัน​สะอาด​จน​ทฤษฎีบท​นี้​ทุกวันนี้​แบก​ทั้งสอง​ชื่อ ​คือ​ทฤษฎีบท Cook–Levin ​เป็นการ​ยอมรับ​ว่าความ​จริง​ทาง​คณิตศาสตร์​ที่​สำคัญ​บางครั้ง​ถูก​ค้นพบ​สอง​รอบ ​โดย​คน​ที่​ไม่​เคย​อ่าน​งาน​ของ​กันและกัน

It helps to make the checking-versus-finding distinction concrete with something more familiar than Boolean formulas. Take a hard Sudoku puzzle. If a friend hands you a completed grid and claims it solves the puzzle, verifying the claim is almost mechanical: scan each row, column, and box for repeated digits, and you are done in seconds, however large the grid. But finding that completed grid in the first place, starting from a sparse set of clues, can require searching through a genuinely enormous space of candidate fillings — there is no known shortcut that scales as gracefully as the checking does. Sudoku, scaled up to arbitrary grid sizes, is itself known to be NP-complete. Every problem on this chapter's list shares that same lopsidedness: an answer that is cheap to confirm and, as far as anyone has proven, expensive to construct.

​ความต่าง​ระหว่าง​การตรวจ​กับ​การหา​จะ​เป็น​รูปธรรม​ขึ้น ​ถ้า​ใช้​อะไร​ที่​คุ้น​กว่า​สูตร​ตรรกะ ​เอา​ซู​โด​กุ​ข้อ​ยากๆ ​สัก​ข้อ ​ถ้า​เพื่อน​ยื่น​ตาราง​ที่​เติม​ครบ​แล้ว​ให้​และ​อ้างว่า​นี่​คือ​คำตอบ ​การตรวจสอบ​คำ​อ้าง​นั้น​แทบ​เป็นงาน​กลไก: ​กวาด​ดู​แต่ละ​แถว ​แต่ละ​หลัก ​และ​แต่ละ​กล่อง​ว่า​มี​เลข​ซ้ำ​ไหม ​จบ​ใน​ไม่​กี่​วินาที ​ไม่​ว่า​ตาราง​จะ​ใหญ่​แค่​ไหน ​แต่​การ*​หา*​ตาราง​ที่​เติม​ครบ​นั้น​ตั้งแต่​ต้น ​โดย​เริ่ม​จาก​คำ​ใบ้​เพียง​ไม่​กี่​ตัว ​อาจ​ต้อง​ค้น​ผ่าน​พื้นที่​ของ​การเติม​ที่​เป็นไปได้​ที่​ใหญ่​จริงๆ — ​ไม่​มีทาง​ลัด​ที่​รู้จัก​ตัว​ไหน​ขยายตัว​ได้​ราบรื่น​เท่า​การตรวจ ​ซู​โด​กุ​ที่​ขยาย​ไป​ยัง​ขนาด​ตาราง​ใด​ก็ได้​นั้น ​เป็นที่​รู้กัน​ว่า​เป็น NP-complete ​ใน​ตัว​มัน​เอง ​ปัญหา​ทุก​ข้อ​ใน​รายการ​ของ​บท​นี้​เบี้ยว​ข้าง​แบบ​เดียวกัน: ​คำตอบ​ยืนยัน​ได้​ถูก ​และ​เท่าที่​ใคร​พิสูจน์​ได้ ​สร้าง​ขึ้น​มา​ได้​แพง

What a reduction actually does, in the vocabulary this book has been building, deserves to be named as a move in its own right, because it is one of the most powerful weapons a solver can pick up. A reduction says: your problem, however unfamiliar it looks, is secretly a disguised copy of a problem someone has already fully understood. Translate your instance into the known problem's language, solve that, translate the answer back. This is the same act of recognition that let chapter 04's operations researchers see a plywood mill and a wartime diet as the same linear program in different clothes — except here the recognition cuts the opposite way. Instead of finding a shortcut, a reduction can prove that no shortcut is possible, by showing that your problem is at least as hard as one already known to resist every attempt at a shortcut.

​สิ่ง​ที่​การลดรูป (reduction) ​ทำ ​จริงๆ ​ใน​คำศัพท์​ที่​หนังสือ​เล่ม​นี้​ก่อ​มา ​สมควร​ได้ชื่อ​เป็น​ท่า​หนึ่ง​ของ​มัน​เอง ​เพราะ​มัน​คือ​หนึ่ง​ใน​อาวุธ​ที่​ทรงพลัง​ที่สุด​ที่​นัก​แก้ปัญหา​หยิบ​ขึ้น​มา​ได้ ​การลดรูป​พูดว่า: ​ปัญหา​ของ​คุณ ​ไม่​ว่า​จะ​ดู​แปลกหน้า​แค่​ไหน ​แท้จริง​คือ​สำเนา​ปลอมตัว​ของ​ปัญหา​ที่​มี​คน​เข้าใจถ่องแท้​ไป​แล้ว ​แปล​อิน​สแตนซ์​ของ​คุณ​เป็น​ภาษา​ของ​ปัญหา​ที่​รู้จัก​นั้น ​แก้​อันนั้น ​แล้ว​แปล​คำตอบ​กลับ ​นี่​คือ​การรู้จำ​แบบ​เดียว​กับ​ที่​ทำให้​นักวิจัย​ดำเนินงาน (operational research, OR) ​ใน​บท​ที่ 04 ​มองเห็น​โรงงาน​ไม้อัด​กับ​สูตร​อาหาร​ยาม​สงคราม​เป็น​กำหนดการ​เชิงเส้น (linear programming) ​อัน​เดียวกัน​ที่​ใส่​เสื้อผ้า​คนละ​ชุด — ​เว้นแต่​ตรงนี้​การรู้จำ​เฉือน​ไป​คนละ​ทาง ​การลดรูป​ไม่​ได้​พบ​ทางลัด ​แต่​พิสูจน์​ได้​ว่า​ไม่​มีทาง​ลัด​ใด​เป็นไปได้ ​ด้วย​การแสดง​ว่า​ปัญหา​ของ​คุณ​ยาก​อย่าง​น้อย​เท่ากับ​ปัญหา​ที่​รู้กัน​แล้ว​ว่า​ต้านทาน​ความพยายาม​หาทาง​ลัด​ทุกครั้ง

Karp's Rogues' Gallery

​หอ​ผู้ร้าย​ของ Karp

Cook's theorem proved that one problem, SAT, was the hardest of its class. It took Richard Karp's 1972 paper, "Reducibility Among Combinatorial Problems," to show the world how crowded that class actually was. Karp took Cook's result and, using nothing but a chain of reductions, showed that twenty-one further problems — familiar, practical, seemingly unrelated problems that engineers and planners had been quietly struggling with for years — were all secretly NP-complete too (Karp, "Reducibility Among Combinatorial Problems" (1972); Wikipedia, "Karp's 21 NP-complete problems").

​ทฤษฎีบท​ของ Cook ​พิสูจน์​ว่า​ปัญหา​ข้อ​หนึ่ง ​คือ SAT ​ยาก​ที่สุด​ใน​คลาส​ของ​มัน ​คลาส​นั้น*​แออัด*​แค่​ไหน​จริงๆ ​โลก​ต้อง​รอบท​ความปี 1972 ​ของ Richard Karp ​ชื่อ "Reducibility Among Combinatorial Problems" Karp ​หยิบ​ผล​ของ Cook ​มา ​ใช้​เพียง​โซ่​ของ​การลดรูป​เท่านั้น ​แล้ว​แสดงว่า​ปัญหา​อีก​ยี่สิบ​เอ็ด​ข้อ​ล้วน​เป็น NP-complete ​เหมือนกัน​หมด​โดยที่​ไม่​มี​ใคร​รู้ — ​ปัญหา​ที่​คุ้นเคย ​ใช้งาน​จริง ​และ​ดู​ไม่​เกี่ยว​กัน​เลย ​ที่​วิศวกร​กับ​นัก​วางแผน​ดิ้นรน​กับ​มัน​เงียบๆ ​มา​หลาย​ปี (Karp, "Reducibility Among Combinatorial Problems" (1972); Wikipedia, "Karp's 21 NP-complete problems")

Karp's list reads like a tour of applied mathematics: whether a graph can be colored with a given number of colors so that no two connected nodes share one; whether a set of items can be partitioned into two piles of equal total value; whether a network can be covered by a small set of chosen nodes touching every edge; whether a Boolean formula in a certain restricted form is satisfiable at all. These problems had been attacked, separately, by graph theorists, operations researchers, and logicians who had no particular reason to think their struggles were connected. Karp's chain of reductions revealed they were all the same disease wearing twenty-one different costumes — precisely the discovery chapter 04 celebrated in Kantorovich's plywood and Stigler's diet, except that here the shared identity is a shared curse rather than a shared shortcut. If you found an efficient algorithm for any one of them, you would have found one for all of them, and for every problem in NP besides. Nobody has ever found one. Nobody has proven that nobody can. That gap — between decades of failed attempts and a rigorous proof of impossibility — is exactly where the Millennium Prize question lives.

​รายการ​ของ Karp ​อ่าน​เหมือน​ทัวร์​คณิตศาสตร์​ประยุกต์: ​กราฟ​หนึ่ง​ระบายสี​ด้วย​จำนวน​สี​ที่​กำหนด ​โดย​ไม่​ให้​โหนด​สอง​โหนด​ที่​เชื่อม​กัน​ใช้​สี​เดียวกัน ​ได้​หรือไม่; ​ชุด​ของ​สิ่งของ​หนึ่ง​แบ่ง​เป็น​สอง​กอง​ที่​มีมูล​ค่า​รวม​เท่ากัน​ได้​หรือไม่; ​เครือข่าย​หนึ่ง​ถูก​ครอบคลุม​ด้วย​ชุด​โหนด​ที่​เลือก​มา​ไม่​กี่​โหนด​ที่​แตะ​ทุก​เส้น​เชื่อม​ได้​หรือไม่; ​สูตร​ตรรกะ​แบบบูล​ใน​รูป​จำกัด​รูป​หนึ่ง​สอดคล้อง​ได้​หรือไม่ ​นักทฤษฎี​กราฟ ​นักวิจัย​ดำเนินงาน ​และ​นัก​ตรรกวิทยา​โจมตี​ปัญหา​เหล่านี้​แยกกัน ​และ​ไม่​มีเหตุผล​อะไร​เป็นพิเศษ​ให้​คิด​ว่าความ​ยากลำบาก​ของ​แต่ละ​ฝ่าย​เชื่อมโยง​กัน ​โซ่​การลดรูป​ของ Karp ​เผย​ว่า​ทั้งหมด​คือ​โรค​เดียวกัน​ที่​สวม​เครื่องแต่งกาย​ยี่สิบ​เอ็ด​ชุด — ​การค้นพบ​แบบ​เดียว​กับ​ที่​บท​ที่ 04 ​เฉลิมฉลอง​ใน​ไม้อัด​ของ Kantorovich ​และ​สูตร​อาหาร​ของ Stigler ​พอดี ​เว้นแต่​ว่า​ตรงนี้​อัตลักษณ์​ร่วม​คือ*​คำสาป*​ร่วม ​ไม่​ใช่​ทางลัด​ร่วม ​พบ​อัลกอริทึม​ที่​มีประสิทธิภาพ​สำหรับ​ข้อ​ใด​ข้อ​หนึ่ง ​ก็​เท่ากับ​พบ​สำหรับ​ทุก​ข้อ ​และ​สำหรับ​ทุก​ปัญหา​ใน NP ​ด้วย ​ไม่​เคย​มี​ใคร​พบ ​ไม่​เคย​มี​ใคร​พิสูจน์​ว่า​ไม่​มี​ใคร​พบ​ได้ ​ช่องว่าง​นั้น — ​ระหว่าง​ความพยายาม​ที่​ล้มเหลว​มา​หลาย​ทศวรรษ ​กับ​บทพิสูจน์​ความเป็นไป​ไม่​ได้​อย่าง​เข้มงวด — ​คือ​ที่​ที่​คำถาม​รางวัล​มิล​เลน​เนียม​อาศัย​อยู่​พอดี

The Million-Dollar Question

​คำถาม​หนึ่ง​ล้าน​ดอลลาร์

In 2000, the Clay Mathematics Institute selected seven problems it judged to be the deepest open questions in mathematics and placed a one-million-dollar prize on the first correct solution to each. P versus NP is one of the seven — formally, does every problem whose solutions can be efficiently verified also admit an efficient method of discovery? — and as of this writing it remains unsolved, one of six of the original seven still standing; only the Poincaré conjecture has fallen, to Grigori Perelman in the early 2000s (Clay Mathematics Institute, "P vs NP"; Wikipedia, "Millennium Prize Problems").

​ปี 2000 Clay Mathematics Institute ​เลือก​ปัญหา​เจ็ด​ข้อ​ที่​ตัดสิน​ว่า​เป็น​คำถามเปิด​ที่​ลึก​ที่สุด​ใน​คณิตศาสตร์ ​และ​ตั้ง​รางวัล​หนึ่ง​ล้าน​ดอลลาร์​ให้​คำตอบ​ที่​ถูกต้อง​คำตอบ​แรก​ของ​แต่ละ​ข้อ P versus NP ​เป็นหนึ่ง​ใน​เจ็ด​ข้อ​นั้น — ​พูด​อย่าง​เป็นทางการ​คือ ​ปัญหา​ทุก​ข้อ​ที่*​ตรวจสอบ*​คำตอบ​ได้​อย่าง​มีประสิทธิภาพ ​ยอมให้​มี​วิธี*​ค้นพบ*​ที่​มีประสิทธิภาพ​ด้วย​หรือไม่ — ​และ ณ ​เวลา​ที่​เขียน​อยู่​นี้​ยัง​ไม่​มี​ใคร​แก้​ได้ ​มัน​เป็นหนึ่ง​ใน​หก​ข้อ​จาก​เจ็ด​ข้อ​เดิม​ที่​ยัง​ยืน​อยู่; ​มี​เพียง​ข้อความ​คาดการณ์ Poincaré ​เท่านั้น​ที่​ล้ม​ลง ​โดย​ฝีมือ​ของ Grigori Perelman ​ช่วงต้น​ทศวรรษ 2000 (Clay Mathematics Institute, "P vs NP"; Wikipedia, "Millennium Prize Problems")

The traveling salesman problem has become this chapter's emblem, and for good reason: it is easy enough to state to a child (find the shortest possible route visiting every city on a list exactly once and returning home) and hard enough that no one has ever found a way to solve it exactly, for large instances, that beats trying an amount of work growing explosively with the number of cities. It sits, alongside SAT and Karp's twenty-one, on the far side of the wall — not proven impossible to solve quickly, but proven exactly as hard as every other problem in the same enormous, unresolved family.

​ปัญหา​พนักงานขาย​เดินทาง (traveling salesman problem) ​กลายเป็น​สัญลักษณ์​ของ​บท​นี้ ​ด้วย​เหตุผล​ที่​ดี: ​มัน​ง่าย​พอ​จะ​เล่า​ให้​เด็ก​ฟัง (​หา​เส้นทาง​ที่​สั้น​ที่สุด​เท่าที่​จะ​เป็นไปได้ ​ที่​แวะ​ทุก​เมือง​ใน​รายการ​เมือง​ละ​ครั้ง​พอดี​แล้ว​กลับบ้าน) ​และ​ยาก​พอ​จน​ไม่​เคย​มี​ใคร​หา​วิธี​แก้​มัน​แบบ​ตรง​เป๊ะ​สำหรับ​อิน​สแตนซ์​ขนาดใหญ่ ​ที่​ชนะ​การลอง​ด้วย​ปริมาณ​งาน​ที่​โต​ระเบิด​ตาม​จำนวน​เมือง​ได้ ​มัน​นั่ง​อยู่​ข้างๆ SAT ​และ​ยี่สิบ​เอ็ด​ข้อ​ของ Karp ​บน​อีก​ฟาก​ของ​กำแพง — ​ไม่​มี​ใคร​พิสูจน์​ว่า​มัน​แก้​เร็ว​ไม่​ได้ ​แต่​มี​บทพิสูจน์​ว่า​มัน​ยาก​เท่ากับ​ปัญหา​อื่น​ทุก​ข้อ​ใน​ตระกูล​มหึมา​ที่​ยัง​ไม่​มี​ข้อยุติ​ตระกูล​เดียวกัน ​เป๊ะๆ

It is worth pausing to be honest about what "the wall" actually claims, because it is easy to overstate. Nobody has proven P ≠ NP. It remains logically possible — though almost no computer scientist believes it — that some ingenious algorithm for SAT is waiting to be found, and that finding it would efficiently solve every problem on Karp's list and every problem like them at a stroke. What has been proven, with total rigor, is the equivalence: solve one member of this vast family efficiently and you have solved them all. The wall may or may not be permanent. What is certain is that it is the same wall, everywhere you press against it.

"​กำแพง" ​อ้าง​อะไร​กัน​แน่ ​ควร​หยุด​พูดตาม​ตรง​สักครู่ ​เพราะ​มัน​เผลอ​อ้าง​เกิน​จริง​ได้​ง่าย ​ไม่​มี​ใคร​พิสูจน์​ว่า P ≠ NP ​ยัง​เป็นไปได้​ใน​เชิง​ตรรกะ — ​แม้​แทบ​ไม่​มี​นัก​วิทยาการ​คอมพิวเตอร์​คน​ไหน​เชื่อ — ​ว่า​อัลกอริทึม​อัน​ชาญฉลาด​สัก​ตัว​สำหรับ SAT ​กำลัง​รอ​ให้​ค้นพบ​อยู่ ​และ​การพบ​มัน​จะ​แก้​ทุก​ปัญหา​ใน​รายการ​ของ Karp ​และ​ทุก​ปัญหา​แบบ​เดียวกัน​ได้​อย่าง​มีประสิทธิภาพ​ใน​คราว​เดียว ​สิ่ง​ที่​พิสูจน์​แล้ว​อย่าง​เข้มงวด​เต็มที่​คือ*​ความสมมูล*: ​แก้​สมาชิก​หนึ่ง​ตัว​ของ​ตระกูล​มหึมา​นี้​ได้​อย่าง​มีประสิทธิภาพ ​ก็​เท่ากับ​แก้​ได้​ทั้ง​ตระกูล ​กำแพง​นี้​จะ​ถาวร​หรือไม่ ​ยัง​ไม่​มี​ใคร​รู้ ​สิ่ง​ที่​แน่​คือ​มัน​เป็น​กำแพง​เดียวกัน ​ไม่​ว่า​จะ​ไป​ดัน​ตรงไหน

Life at the Wall

​ชีวิต​ที่​เชิง​กำแพง

If the theory stopped here, this would be a chapter about despair: a proof that a huge swath of practically important problems cannot be solved exactly and efficiently, full stop. What actually happened next is more interesting, and it is the part of this chapter's story that keeps this book's central thesis alive even at its darkest point — because solvers, faced with a wall, did not stop. They found doors.

​ถ้า​ทฤษฎี​หยุด​อยู่​แค่นี้ ​บท​นี้​ก็​เป็น​บท​ว่าด้วย​ความสิ้นหวัง: ​บทพิสูจน์​ว่า​ปัญหา​สำคัญ​ในทางปฏิบัติ​จำนวนมาก​แก้​แบบ​ตรง​เป๊ะ​และ​มีประสิทธิภาพ​ไม่​ได้ ​จบ ​สิ่ง​ที่เกิด​ขึ้น​จริง​ต่อจากนั้น​น่าสนใจ​กว่า ​และ​มัน​คือ​ส่วน​ของ​เรื่องเล่า​ใน​บท​นี้​ที่​ทำให้​ข้อเสนอ​ใจกลาง​ของ​หนังสือ​เล่ม​นี้​ยังมี​ชีวิต​อยู่​แม้​ใน​จุด​ที่​มืด​ที่สุด — ​เพราะ​นัก​แก้ปัญหา​ที่​เจอ​กำแพง​ไม่​ได้​หยุด ​พวกเขา​หา​ประตู​เจอ

The first door is approximation: give up on finding the provably optimal answer and settle, deliberately, for a solution guaranteed to be within some fixed, known factor of optimal. In 1976, Nicos Christofides published an algorithm for a common variant of the traveling salesman problem — one where the triangle inequality holds, meaning a direct route between two cities is never longer than a detour through a third — that is guaranteed to find a tour no more than 50 percent longer than the true shortest possible tour, no matter the instance. Remarkably, more than four decades later, Christofides' 1.5-factor guarantee for this problem had still not been beaten by any published algorithm as of the early 2020s, a striking testament to how hard even bounded progress on an NP-complete problem can be (arXiv, "A historical note on the 3/2-approximation algorithm for the metric traveling salesman problem"). An approximation algorithm does not defeat the wall. It negotiates terms with it: not the best answer, but a provably good-enough one, delivered in a time that does not explode.

​ประตู​บาน​แรก​คือ​การประมาณ (approximation): ​เลิก​หา​คำตอบ​ที่​พิสูจน์​ได้​ว่า​เหมาะ​ที่สุด ​แล้ว​ตั้งใจ​ยอมรับ​คำตอบ​ที่​รับประกัน​ว่า​ห่าง​จาก​ค่า​เหมาะ​ที่สุด​ไม่​เกินตัว​คูณ​ค่า​หนึ่ง​ที่​ตายตัว​และ​รู้​ค่า ​ปี 1976 Nicos Christofides ​ตีพิมพ์​อัลกอริทึม​สำหรับ​ปัญหา​พนักงานขาย​เดินทาง​รูปแบบ​ที่​พบ​บ่อย​แบบ​หนึ่ง — ​แบบ​ที่​อสมการ​สามเหลี่ยม​เป็นจริง ​คือ​เส้นทาง​ตรง​ระหว่าง​สอง​เมือง​ไม่​มี​วัน​ยาว​กว่า​การอ้อม​ผ่านเมือง​ที่สาม — ​อัลกอริทึม​นี้​รับประกัน​ว่า​จะ​หา​ทัวร์​ที่​ยาว​กว่า​ทัวร์​ที่​สั้น​ที่สุด​จริง​ไม่​เกิน 50 ​เปอร์เซ็นต์ ​ไม่​ว่า​อิน​สแตนซ์​จะ​เป็น​อย่างไร ​กว่า​สี่​ทศวรรษ​ให้หลัง ​การรับประกัน​ตัวคูณ 1.5 ​ของ Christofides ​สำหรับ​ปัญหา​นี้​ยัง​ไม่​ถูก​อัลกอริทึม​ที่​ตีพิมพ์​ตัว​ไหน​โค่น​ได้​เลย ณ ​ช่วงต้น​ทศวรรษ 2020 ​ตัวเลข​นั้น​บอก​เอง​ว่าความ​คืบหน้า​แม้แต่​แบบ*​มี​ขอบเขต*​บน​ปัญหา NP-complete ​ยาก​เพียงใด (arXiv, "A historical note on the 3/2-approximation algorithm for the metric traveling salesman problem") ​อัลกอริทึม​ประมาณ​ไม่​ได้​เอาชนะ​กำแพง ​มัน​เจรจา​เงื่อนไข​กับ​กำแพง: ​ไม่​ใช่​คำตอบ​ที่​ดี​ที่สุด ​แต่​เป็น​คำตอบ​ที่*​พิสูจน์​ได้*​ว่า​ดี​พอ ​ส่งมอบ​ใน​เวลา​ที่​ไม่​ระเบิด

The second door is randomization — the same willingness to trade certainty for speed that chapter 04 met in Monte Carlo methods, applied here to combinatorial search rather than physical simulation. A randomized algorithm makes some of its choices by coin flip rather than exhaustive comparison, and for many hard problems this yields algorithms that are fast on average and wrong only with controllable, vanishingly small probability — a guaranteed-correct answer traded for an almost-certainly-correct one delivered far sooner. The clearest everyday example sits, fittingly, inside the very cryptography this chapter is about to turn to: before RSA can lock anything, it first needs two very large prime numbers, and testing an enormous candidate number for primality by trial division is itself hopelessly slow. The Miller–Rabin test, devised by Gary Miller in 1976 and made fully practical by Michael Rabin shortly after, picks random witnesses and checks each one against the candidate number; a composite number will be caught with at least even odds by any single random witness, so after fifty independent draws the chance of a wrong answer falls below one in a quadrillion — small enough that every RSA key generated today is built on primes accepted by a test that is not, strictly, certain, only certain enough (Cornell CS4820, "The Miller-Rabin Randomized Primality Test").

​ประตู​บาน​ที่สอง​คือ​การสุ่ม (randomization) — ​ความเต็มใจ​แลก​ความแน่นอน​กับ​ความเร็ว​แบบ​เดียว​กับ​ที่​บท​ที่ 04 ​พบ​ใน​วิธี​มอน​ติ​คาร์​โล ​คราวนี้​ใช้กับ​การค้นหา​เชิง​การจัด​หมู่​แทน​การจำลอง​ทางกายภาพ ​อัลกอริทึม​แบบ​สุ่ม​ตัดสินใจ​บางส่วน​ด้วย​การโยน​เหรียญ​แทน​การเทียบ​ทุก​ทางเลือก ​สำหรับ​ปัญหา​ยาก​หลาย​ข้อ ​วิธี​นี้​ให้​อัลกอริทึม​ที่​เร็ว​โดยเฉลี่ย​และ​ผิด​ด้วย​ความน่าจะเป็น​ที่​ควบคุม​ได้​และ​เล็ก​จน​แทบ​หาย​ไป — ​แลก​คำตอบ​ที่​รับประกัน​ว่า​ถูก ​กับ​คำตอบ​ที่​แทบจะ​แน่นอน​ว่า​ถูก​และ​มาถึง​เร็ว​กว่า​มาก ​ตัวอย่าง​ใน​ชีวิตประจำวัน​ที่​ชัด​ที่สุด​อยู่​ใน​วิทยาการ​รหัสลับ​ที่​บท​นี้​กำลังจะ​หันไป​พูดถึง​พอดี ​และ​ก็​เหมาะเจาะ​ดี: ​ก่อน RSA ​จะ​ล็อก​อะไร​ได้ ​มัน​ต้อง​มี​จำนวน​เฉพาะ​ขนาดใหญ่​มาก​สอง​จำนวน​ก่อน ​และ​การทด​สอบ​ว่า​จำนวน​มหึมา​ที่​เป็นตัว​เลือก​เป็น​จำนวน​เฉพาะ​หรือไม่​ด้วย​การหาร​ไล่ ​ตัว​มัน​เอง​ก็​ช้า​จน​หมดหวัง ​การทด​สอบ Miller–Rabin ​ที่ Gary Miller ​คิด​ขึ้น​ใน​ปี 1976 ​และ Michael Rabin ​ทำให้​ใช้งาน​ได้​จริง​เต็มที่​ใน​เวลา​ไม่​นาน​หลังจากนั้น ​เลือก​พยาน​แบบ​สุ่ม​ขึ้น​มา​แล้ว​ตรวจ​แต่ละ​ตัว​กับ​จำนวน​ที่​เป็นตัว​เลือก; ​พยาน​สุ่ม​ตัว​เดียว​จับ​จำนวน​ประกอบ​ได้​ด้วย​โอกาส​อย่าง​น้อย​ครึ่งต่อครึ่ง ​ดังนั้น​หลัง​จับ​พยาน​อิสระ​ห้าสิบ​ตัว ​โอกาส​ได้​คำตอบ​ผิด​ตกลง​ต่ำกว่า​หนึ่ง​ใน​พัน​ล้าน​ล้าน — ​เล็ก​พอ​จน​กุญแจ RSA ​ทุก​ดอก​ที่​สร้าง​ขึ้น​ทุกวันนี้​ตั้งอยู่​บน​จำนวน​เฉพาะที่​ผ่านการทดสอบ​ที่​พูด​อย่าง​เคร่งครัด​แล้ว​ไม่​ได้​แน่นอน ​แค่​แน่นอน​พอ (Cornell CS4820, "The Miller-Rabin Randomized Primality Test")

The third door is the most surprising, and it is the one modern computing quietly walks through every day without most of its users ever noticing. In the decades since Cook and Levin's theorem, engineers built increasingly sophisticated SAT solvers — programs that attempt to find a satisfying assignment for exactly the problem Cook proved NP-complete in the first place. The modern generation of these tools, built around a technique called conflict-driven clause learning (CDCL), does something that should, on paper, be impossible: it routinely solves real-world SAT instances with millions of variables and clauses, arising from chip verification, software testing, and scheduling, in practical amounts of time (arXiv, "Relating Complexity-theoretic Parameters with SAT Solver Performance"). CDCL works by learning from its own failures mid-search: every time it reaches a dead end, it derives a new logical constraint — a "clause" — summarizing why that dead end occurred, adds it permanently to the problem, and uses it to prune away every future branch that would repeat the same mistake for the same underlying reason. Over the course of a long search, the solver effectively rewrites the problem it is solving, filling it with accumulated scar tissue from every wrong turn, and the accumulated scars turn out to make the remaining search dramatically smaller. This does not contradict the Cook–Levin theorem. Worst-case instances of SAT, carefully constructed to defeat exactly this kind of learning, remain exponentially hard, and always will unless P equals NP. But the industrial instances that show up in real chip designs and real schedules are, empirically, richly structured rather than adversarially worst-case, and researchers have spent years trying to characterize exactly what kind of hidden structure — community clustering, "backdoor" variable sets, low treewidth — CDCL solvers are quietly exploiting to walk straight through problems that complexity theory says should be untouchable. The wall is real, in the worst case, for every instance anyone could construct. It is also, for the instances that actually show up in practice, full of doors nobody predicted would be there.

​ประตู​บาน​ที่สาม​น่าประหลาด​ใจ​ที่สุด ​และ​เป็น​บาน​ที่​คอมพิวเตอร์​สมัยใหม่​เดินผ่าน​เงียบๆ ​ทุกวัน​โดยที่​ผู้ใช้​ส่วนใหญ่​ไม่​เคย​สังเกต ​ใน​หลาย​ทศวรรษ​หลัง​ทฤษฎีบท​ของ Cook ​กับ Levin ​วิศวกร​สร้าง SAT solver ​ที่​ซับซ้อน​ขึ้น​เรื่อยๆ — ​โปรแกรม​ที่​พยายาม​หา​การกำ​หนด​ค่าที่​ทำให้​สูตร​เป็นจริง ​สำหรับ​ปัญหา​ที่ Cook ​พิสูจน์​ว่า​เป็น NP-complete ​ตั้งแต่แรก​นั่นเอง ​เครื่องมือ​รุ่นใหม่​ที่​สร้าง​รอบ​เทคนิค​ชื่อ conflict-driven clause learning (CDCL) ​ทำ​สิ่ง​ที่​บน​กระดาษ​ควร​เป็นไปไม่ได้: ​มัน​แก้​อิน​สแตนซ์ SAT ​ใน​โลก​จริง​ที่​มี​ตัวแปร​และ​อนุประโยค​เป็น*​ล้าน* ​จาก​การตรวจสอบ​ชิป ​การทด​สอบ​ซอฟต์แวร์ ​และ​การจัด​ตาราง ​ได้​เป็นปกติ ​ใน​เวลา​ที่​ใช้งาน​ได้​จริง (arXiv, "Relating Complexity-theoretic Parameters with SAT Solver Performance") CDCL ​เรียนรู้​จาก​ความล้มเหลว​ของ​ตัวเอง​ระหว่าง​ค้นหา: ​ทุกครั้งที่​ไป​ถึง​ทางตัน ​มัน​อนุมาน​ข้อจำกัด​ทาง​ตรรกะ​ข้อ​ใหม่ — "​อนุประโยค (clause)" — ​ที่​สรุป​ว่า*​ทำไม*​ทางตัน​นั้น​ถึง​เกิด ​เพิ่ม​มัน​เข้าไป​ใน​ปัญหา​อย่าง​ถาวร ​แล้ว​ใช้​มัน​ตัด​กิ่ง​ทุก​กิ่ง​ในอนาคต​ที่จะ​ผิด​ซ้ำ​แบบ​เดิม​ด้วย​เหตุผล​พื้นฐาน​เดียวกัน​ทิ้ง ​ตลอด​การค้นหา​ที่​ยาวนาน ​ตัว​แก้ปัญหา​เท่ากับ​เขียน​ปัญหา​ที่​มัน​กำลัง​แก้​ขึ้น​ใหม่ ​เติม​มัน​ด้วย​เนื้อ​แผลเป็น​ที่​สะสม​จาก​ทุก​การเลี้ยว​ผิด ​และ​แผลเป็น​ที่​สะสม​นั้น​กลับ​ทำให้​การค้นหา​ที่​เหลือ​เล็ก​ลงมาก ​เรื่อง​นี้​ไม่​ได้​ขัด​กับ​ทฤษฎีบท Cook–Levin ​อิน​สแตนซ์​กรณี​เลวร้าย​ที่สุด​ของ SAT ​ที่​ถูก​สร้าง​ขึ้น​อย่าง​พิถีพิถัน​เพื่อ​เอาชนะ​การเรียนรู้​แบบนี้​พอดี ​ยังคง​ยาก​แบบ​เอกซ์​โพเนน​เชียล ​และ​จะ​ยาก​อย่างนั้น​ตลอดไป ​เว้นแต่ P ​จะ​เท่ากับ NP ​แต่​อิน​สแตนซ์*​ระดับ​อุตสาหกรรม*​ที่​โผล่​มา​ใน​การออกแบบ​ชิป​จริง​และ​ตาราง​งาน​จริง ​จาก​การวัด​จริง​มี​โครงสร้าง​หนาแน่น ​ไม่​ใช่​กรณี​เลวร้าย​ที่สุด​ที่​ถูก​ออกแบบ​มา​เล่นงาน ​นักวิจัย​ใช้เวลา​หลาย​ปี​พยายาม​ระบุ​ให้ได้​ว่า​โครงสร้าง​ที่ซ่อน​อยู่​ชนิด​ไหน​กัน​แน่ — ​การจับกลุ่ม​เป็น​ชุมชน ​ชุด​ตัวแปร "​ประตู​หลัง" ​ค่า treewidth ​ต่ำ — ​ที่ SAT solver ​แบบ CDCL ​แอบ​ใช้ประโยชน์​อยู่​เงียบๆ ​เพื่อ​เดิน​ทะลุ​ปัญหา​ที่​ทฤษฎี​ความซับซ้อน (complexity) ​บอก​ว่า​ควรจะ​แตะ​ไม่​ได้ ​กำแพง​นั้น​เป็น​ของจริง ​ใน​กรณี​เลวร้าย​ที่สุด ​สำหรับ​ทุก​อิน​สแตนซ์​ที่​ใครก็ตาม​จะ​สร้าง​ขึ้น​ได้ ​และ​สำหรับ​อิน​สแตนซ์​ที่​โผล่​มา​ในทางปฏิบัติ​จริงๆ ​มัน​ก็​เต็มไปด้วย​ประตู​ที่​ไม่​มี​ใคร​ทำนาย​ว่า​จะ​อยู่​ตรงนั้น

The Wall as Fortress

​กำแพง​ใน​ฐานะ​ป้อมปราการ

The final turn in this chapter's story inverts everything that came before it, and it is the most consequential inversion in this book. Every solver so far has treated hardness as an obstacle: a wall to be reduced away from, approximated around, or randomized through. In 1977, three MIT researchers — Ron Rivest, Adi Shamir, and Leonard Adleman — realized that hardness could instead be the product.

​จุด​หัก​ครั้งสุดท้าย​ใน​เรื่องเล่า​ของ​บท​นี้​กลับ​ทุกอย่าง​ที่มา​ก่อนหน้า ​และ​เป็นการ​กลับด้าน​ที่​ส่งผล​มาก​ที่สุด​ใน​หนังสือ​เล่ม​นี้ ​นัก​แก้ปัญหา​ทุกคน​จนถึง​ตอนนี้​ปฏิบัติ​กับ​ความยาก (hardness) ​เหมือน​อุปสรรค: ​กำแพง​ที่​ต้อง​ลดรูป​หนี​ออกมา ​ประมาณ​อ้อม​ไป ​หรือ​สุ่ม​ทะลุ​ผ่าน ​ปี 1977 ​นักวิจัย MIT ​สาม​คน — Ron Rivest, Adi Shamir ​และ Leonard Adleman — ​ตระหนัก​ว่าความ​ยาก​เป็น*​ตัว​สินค้า*​ได้​แทน

Their cryptosystem, which took the researchers' initials as its name, RSA, is built on a specific, carefully chosen instance of computational hardness: multiplying two very large prime numbers together is fast, taking a computer a fraction of a second even for numbers hundreds of digits long, but factoring the resulting product back into its two original primes, without already knowing them, has no known efficient method — you are back to something resembling brute-force search through an astronomically large space of candidate factors (Splunk, "RSA Algorithm in Cryptography: Rivest Shamir Adleman Explained"). Anyone can publish the product — the "public key" — and use it to lock a message. Only someone who knows the two original primes — the "private key" — can unlock it efficiently; everyone else faces a computational wall as real as any traveling salesman's. RSA is, technically, believed to rely on the hardness of integer factorization rather than being proven NP-complete in the strict Cook–Levin sense — factorization sits in a curious, not-fully-resolved corner of complexity theory, apparently hard but not known to be NP-complete itself. What matters for this chapter's purposes is the philosophical hinge, not the technical fine print: an entire branch of applied mathematics discovered that a wall no one can climb is exactly as valuable as a treasure no one can steal. Every secure connection to a bank, a hospital record, or an encrypted message rests, at bottom, on the same kind of hardness that makes the traveling salesman problem resist every solver's cleverness. One field's dead end is another field's foundation.

​ระบบ​รหัสลับ​ของ​พวกเขา ​คือ RSA ​ใช้​อักษรย่อ​ของ​นักวิจัย​ทั้ง​สาม​เป็น​ชื่อ ​และ​สร้าง​ขึ้น​บน​อิน​สแตนซ์​ของ​ความยาก​เชิง​การคำนวณ​ที่​เจาะจง​และ​เลือก​มา​อย่าง​พิถีพิถัน: ​คูณ​จำนวน​เฉพาะ​ขนาดใหญ่​มาก​สอง​จำนวน​เข้าด้วยกัน​นั้น​เร็ว ​คอมพิวเตอร์​ใช้เวลา​เสี้ยว​วินาที​แม้​กับ​จำนวน​ที่​ยาว​หลาย​ร้อย​หลัก ​แต่​การ*​แยกตัว​ประกอบ*​ผลคูณ​ที่​ได้​กลับ​ไป​เป็น​จำนวน​เฉพาะ​สอง​จำนวน​ตั้งต้น ​โดย​ไม่​รู้​มัน​อยู่​ก่อน ​ไม่​มี​วิธี​ที่​มีประสิทธิภาพ​ที่​รู้จัก​เลย — ​กลับ​ไป​สู่​อะไร​ที่​คล้าย​การค้นหา​แบบ​ไล่​ทุก​ทาง (brute force) ​ผ่าน​พื้นที่​ของ​ตัวประกอบ​ที่​เป็นไปได้​ที่​ใหญ่​ระดับ​ดาราศาสตร์ (Splunk, "RSA Algorithm in Cryptography: Rivest Shamir Adleman Explained") ​ใคร​ก็​ประกาศ​ผลคูณ​นั้น​ได้ — "​กุญแจ​สาธารณะ" — ​และ​ใช้​มัน​ล็อก​ข้อความ ​มี​เพียง​คน​ที่​รู้จำน​วน​เฉพาะ​ตั้งต้น​สอง​จำนวน — "​กุญแจ​ส่วนตัว" — ​เท่านั้น​ที่​ปลดล็อก​ได้​อย่าง​มีประสิทธิภาพ; ​คนอื่น​ทั้งหมด​เจอ​กำแพง​เชิง​การคำนวณ​ที่​เป็น​ของจริง​พอๆ ​กับ​กำแพง​ของ​พนักงานขาย​เดินทาง ​ใน​ทางเทคนิค ​เชื่อ​กัน​ว่า RSA ​พึ่ง​ความยาก​ของ​การแยกตัว​ประกอบ​จำนวนเต็ม ​มากกว่า​จะ​มี​บทพิสูจน์​ว่า​เป็น NP-complete ​ใน​ความหมาย​เคร่งครัด​แบบ Cook–Levin — ​การแยกตัว​ประกอบ​นั่ง​อยู่​ใน​มุม​ที่​แปลก​และ​ยัง​ไม่​มี​ข้อยุติ​เต็มที่​ของ​ทฤษฎี​ความซับซ้อน ​ดูจะ​ยาก ​แต่​ไม่​มี​ใคร​รู้​ว่า​ตัว​มัน​เอง​เป็น NP-complete ​หรือไม่ ​สิ่ง​ที่​สำคัญ​สำหรับ​เป้าหมาย​ของ​บท​นี้​คือ​บานพับ​ทาง​ปรัชญา ​ไม่​ใช่​ตัวหนังสือ​ตัวเล็ก​เชิง​เทคนิค: ​คณิตศาสตร์​ประยุกต์​ทั้ง​สาขา​ค้นพบ​ว่า​กำแพง​ที่​ไม่​มี​ใคร​ปีน​ได้ ​มีค่า​เท่ากับ​สมบัติ​ที่​ไม่​มี​ใคร​ขโมย​ได้​พอดี ​ทุก​การเชื่อมต่อ​ที่​ปลอดภัย​ไป​ยัง​ธนาคาร ​เวช​ระเบียน​ของ​โรงพยาบาล ​หรือ​ข้อความ​ที่​เข้ารหัส ​ล้วน​ตั้งอยู่​บน​ความยาก​ชนิด​เดียวกัน​กับ​ที่​ทำให้​ปัญหา​พนักงานขาย​เดินทาง​ต้านทาน​ความฉลาด​ของ​นัก​แก้ปัญหา​ทุกคน ​ทางตัน​ของ​สาขา​หนึ่ง​คือ​รากฐาน​ของ​อีก​สาขา​หนึ่ง

Hardness Is Information

​ความยาก​คือ​ข้อมูล

Step back, and this chapter completes something chapter 00 promised and chapter 04 and 05 built toward: the honest limits of this book's central claim. "Great solvers do not search harder; they change the space until the path is short" has held, gloriously, across every chapter so far — Euler's dots, Blackett's convoys, Dijkstra's frontier, A*'s admissible optimism. NP-completeness is this book's proof that the claim has a genuine boundary. Some spaces, as far as anyone has ever proven or is likely to prove soon, cannot be compressed by any representation change, however clever — not because no one has been clever enough yet, but because Cook, Levin, and Karp showed that compressing any one of them efficiently would compress all of them efficiently, and seventy years of the finest minds in computer science trying to do exactly that have come back empty-handed.

​บท​นี้​ปิด​สิ่ง​ที่​บท​ที่ 00 ​สัญญา​ไว้ ​และ​บท​ที่ 04 ​กับ 05 ​ปู​ทาง​มาถึง: ​ขีดจำกัด​ที่​ซื่อสัตย์​ของ​ข้ออ้าง​ใจกลาง​ของ​หนังสือ​เล่ม​นี้ ​ถอย​ออกมา​มอง​จะ​เห็นชัด "​นัก​แก้ปัญหา​ที่​ยิ่งใหญ่​ไม่​ค้นหา​หนัก​ขึ้น — ​เขา​เปลี่ยน​พื้นที่​จน​เส้นทาง​สั้น​ลง" ​ยืน​อยู่​ได้​ตลอด​ทุก​บท​ที่ผ่านมา — ​จุด​ของ Euler ​กองเรือ​คุ้มกัน​ของ Blackett ​แนวหน้า​ของ Dijkstra ​การมองโลกในแง่ดี​แบบ admissible ​ของ A\* NP-completeness ​คือ​บทพิสูจน์​ของ​เล่ม​นี้​ว่า​ข้ออ้าง​นั้น​มี​ขอบเขต​จริง ​พื้นที่​บาง​แบบ​บีบ​อัด​ไม่​ได้​ด้วย​การเปลี่ยนรูป​แบบ​การแทน​ปัญหา (representation) ​ใดๆ ​ไม่​ว่า​จะ​ฉลาด​แค่​ไหน ​เท่าที่​ใคร​เคย​พิสูจน์​ได้​หรือ​น่าจะ​พิสูจน์​ได้​ใน​เร็ว​วัน ​เหตุผล​ไม่​ใช่​ว่า​ยัง​ไม่​มี​ใคร​ฉลาด​พอ Cook, Levin ​และ Karp ​แสดงให้เห็น​ว่า​ถ้า​บีบ​อัด​พื้นที่*​ข้อ​ใด​ข้อ​หนึ่ง*​ได้​อย่าง​มีประสิทธิภาพ ​ก็​จะ​บีบ​อัด*​ทุก​ข้อ*​ได้​อย่าง​มีประสิทธิภาพ​ไป​ด้วย ​และ​เจ็ดสิบ​ปี​ที่​สมอง​ดี​ที่สุด​ใน​วิทยาการ​คอมพิวเตอร์​พยายาม​ทำ​เรื่อง​นั้น​พอดี ​ก็​กลับมา​มือเปล่า

But notice what kind of knowledge that failure actually is. Knowing that a problem sits behind the NP-complete wall is not the absence of a solution — it is a piece of information about the problem, as concrete and useful as knowing its size or its symmetries. It tells you, immediately, not to waste a career hunting for an exact, always-fast algorithm. It tells you to reach instead for approximation, randomization, or a solver built to exploit whatever real-world structure your instances actually have, rather than their theoretical worst case. And, in RSA's case, it tells you the wall itself might be worth more standing than knocked down. Naming the wall is itself an act of solving — it is the last, hardest-won representation change this section of the book has to offer: reframing "I cannot find a fast algorithm" from a personal failure into a proven structural fact about the space, and then choosing, with open eyes, which door to walk through instead.

​แต่​ให้​สังเกตว่า​ความล้มเหลว​นั้น​เป็นความ​รู้​ชนิด​ไหน​กัน​แน่ ​การรู้​ว่า​ปัญหา​ข้อ​หนึ่ง​อยู่​หลัง​กำแพง NP-complete ​ไม่​ใช่​การไม่​มี​คำตอบ — ​มัน​คือ*​ชิ้น​ข้อมูล​เกี่ยวกับ​ปัญหา​นั้น* ​เป็น​รูปธรรม​และ​ใช้ได้​จริง​พอๆ ​กับ​การรู้​ขนาด​หรือ​ความสมมาตร​ของ​มัน ​มัน​บอก​ทันที​ว่า​อย่า​ผลาญ​ทั้ง​อาชีพ​ไป​กับ​การล่า​อัลกอริทึม​ที่​ตรง​เป๊ะ​และ​เร็ว​เสมอ ​มัน​บอก​ให้​เอื้อม​ไปหา​การประมาณ ​การสุ่ม ​หรือ​ตัว​แก้​ที่​สร้าง​มา​เพื่อ​ใช้ประโยชน์​จาก​โครงสร้าง​ใน​โลก​จริง​เท่าที่​อิน​สแตนซ์​ของ​คุณ​มี​อยู่​จริง ​แทน​กรณี​เลวร้าย​ที่สุด​ใน​ทางทฤษฎี​ของ​มัน ​และ​ใน​กรณี​ของ RSA ​มัน​บอก​ว่า​กำแพง​ที่​ยัง​ยืน​อยู่​อาจ​มีค่า​มากกว่า​กำแพง​ที่​ถูก​ทุบ​ลง ​การเรียกชื่อ​กำแพง​เป็นการ​แก้ปัญหา​ใน​ตัว​มัน​เอง — ​มัน​คือ​การเปลี่ยน representation ​ครั้งสุดท้าย​และ​ได้มา​ยาก​ที่สุด​ที่​ส่วน​นี้​ของ​หนังสือ​มี​ให้: ​เปลี่ยน​กรอบ "​ฉัน​หา​อัลกอริทึม​ที่​เร็ว​ไม่​ได้" ​จาก​ความล้มเหลว​ส่วนตัว ​ให้​เป็น​ข้อเท็จจริง​เชิง​โครงสร้าง​ที่​พิสูจน์​แล้ว​เกี่ยวกับ​พื้นที่ ​แล้ว​เลือก​ด้วย​ตา​ที่​เปิดกว้าง​ว่า​จะ​เดินผ่าน​ประตู​บาน​ไหน​แทน

The Move

​ท่า​ประจำ​บท

Move 06 — Name the wall, then trade: reduce, approximate, randomize, or repurpose the hardness.

Move 06 — ​เรียกชื่อ​กำแพง ​แล้ว​แลก: ​ลดรูป ​ประมาณ ​สุ่ม ​หรือ​เอา​ความยาก​ไป​ใช้ประโยชน์

  • Before searching for years, check whether your problem is a known monster in disguise. A reduction from a Karp-list problem, or from SAT itself, is proof that no one else has found a fast general solution either — that is worth knowing before, not after, a career's worth of failed attempts.
  • When exact and fast cannot both be had, choose which one to give up, deliberately. Christofides' bound trades exactness for a guaranteed-good approximation; Monte Carlo-style randomization trades certainty for overwhelming probability. Both are engineering decisions, not defeats.
  • Check whether your actual instances are the adversarial worst case or the friendly common case. CDCL solvers prove that "NP-complete in theory" and "intractable in your specific data" are different claims; industrial SAT is proof that real problems are often far kinder than the theorems that bound them.
  • Ask whether the hardness itself has value. RSA shows that a wall no one can climb can be turned into a fortress. Before treating intractability as pure obstacle, ask who would pay for a problem that stays hard forever.
  • ​ก่อน​จะ​ค้นหา​อยู่​หลาย​ปี ​ตรวจ​ก่อน​ว่า​ปัญหา​ของ​คุณ​คือ​สัตว์ประหลาด​ที่​รู้จัก​กัน​ดี​ซึ่ง​ปลอมตัว​มา​หรือเปล่า ​การลดรูป​จาก​ปัญหา​ใน​รายการ​ของ Karp ​หรือ​จาก SAT ​เอง ​คือ​หลักฐาน​ว่า​ไม่​มี​ใคร​อื่น​หา​คำตอบ​ทั่วไป​ที่​เร็ว​เจอ​เหมือนกัน — ​เรื่อง​นี้​ควร​รู้​ก่อน ​ไม่​ใช่​หลัง ​ความพยายาม​ที่​ล้มเหลว​คุ้มค่า​ทั้ง​อาชีพ
  • ​เมื่อ​ตรง​เป๊ะ​กับ​เร็ว​มี​พร้อมกัน​ไม่​ได้ ​จง​เลือก​อย่าง​ตั้งใจ​ว่า​จะ​สละ​อัน​ไหน ​ขอบเขต​ของ Christofides ​แลก​ความตรง​เป๊ะ​กับ​การประมาณ​ที่​รับประกัน​ว่า​ดี; ​การสุ่ม​แบบ​มอน​ติ​คาร์​โล​แลก​ความแน่นอน​กับ​ความน่าจะเป็น​ที่​ท่วมท้น ​ทั้งคู่​คือ​การตัดสินใจ​เชิง​วิศวกรรม ​ไม่​ใช่​ความพ่ายแพ้
  • ​ตรวจ​ว่า​อิน​สแตนซ์​จริง​ของ​คุณ​คือ​กรณี​เลวร้าย​ที่สุด​ที่​ถูก​ออกแบบ​มา​เล่นงาน ​หรือ​กรณี​ทั่วไป​ที่​เป็นมิตร SAT solver ​แบบ CDCL ​พิสูจน์​ว่า "NP-complete ​ใน​ทางทฤษฎี" ​กับ "​จัดการ​ไม่​ไหว (intractable) ​ใน​ข้อมูล​เฉพาะ​ของ​คุณ" ​เป็น​คนละ​ข้ออ้าง​กัน; SAT ​ระดับ​อุตสาหกรรม​คือ​หลักฐาน​ว่า​ปัญหา​จริง​มัก​ใจดี​กว่า​ทฤษฎีบท​ที่​ตี​กรอบ​มัน​ไว้​มาก
  • ​ถาม​ว่าความ​ยาก​นั้น​เอง​มีค่า​หรือไม่ RSA ​แสดงให้เห็น​ว่า​กำแพง​ที่​ไม่​มี​ใคร​ปีน​ได้ ​เปลี่ยนเป็น​ป้อมปราการ​ได้ ​ก่อน​จะ​ปฏิบัติ​กับ​ความจัดการ​ไม่​ไหว​เหมือน​อุปสรรค​ล้วนๆ ​ให้​ถาม​ว่า​ใคร​จะ​ยอม​จ่าย​เงิน​ซื้อ​ปัญหา​ที่​ยาก​อยู่​อย่างนั้น​ตลอดไป

Next — Chapter 07 · Gallery I: The Single Move: theory now gives way to a gallery. Five solvers, four centuries, one move each — the history this book has built in the abstract, made concrete, one great solve at a time.

​ต่อไป — ​บท​ที่ 07 · ​หอ​เรื่องเล่า I: ​ท่าเดียว​จบ: ​ทฤษฎี​ถึงคราว​หลีกทาง​ให้​หอ​เรื่องเล่า ​นัก​แก้ปัญหา​ห้า​คน ​สี่​ศตวรรษ ​คนละ​หนึ่ง​ท่า — ​ประวัติศาสตร์​ที่​หนังสือ​เล่ม​นี้​ก่อ​ไว้​ใน​เชิง​นามธรรม ​ถูก​ทำให้​เป็น​รูปธรรม ​ทีละ​การแก้​ครั้ง​ใหญ่

บทถัดไป · 8 / 1207 · Gallery I: The Single Move
Size
Page
Font

The Shortest Path — A History of the Art and Science of Problem-Solving

❦
100 · The Knot and the Path00 · ปมและเส้นทาง201 · The First Methods01 · วิธีชุดแรก302 · The Reframe02 · การเปลี่ยนกรอบ403 · The Heuristic Age03 · ยุค heuristic504 · War and the Science of Search04 · สงครามกับศาสตร์แห่งการค้นหา605 · The Algorithmic Path05 · เส้นทางแบบอัลกอริทึม706 · The Wall06 · กำแพง807 · Gallery I: The Single Move07 · หอเรื่องเล่า I: ท่าเดียวจบ908 · Gallery II: The Modern Solves08 · หอเรื่องเล่า II: การแก้ครั้งใหญ่ยุคใหม่1009 · The Aesthetics of Solution09 · สุนทรียะของคำตอบ1110 · The Future Solver10 · นักแก้ปัญหาแห่งอนาคต1299 · The Leverage Route99 · เส้นทางคานงัด