复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 12 NP-complete problems

Data Structures and Algorithm Xiaoqing Zheng Zhengxq@fudan.edu.cn
Data Structures and Algorithm Data Structures and Algorithm Xiaoqing Zheng zhengxq@fudan.edu.cn

Polynomial time algorithms Almost all the algorithms we have studied thus far have been polynomial-time algorithms On input of size n, their worst-case running time is O(nk) for some constant k
Pol l lh ynomia l time a lgorit hms Al ll h l i h h di d h f Almost all t he a lgor i t hms we have studi e d t hus far have been polynomial-time algorithms. y Oi fi n input o f s ize n, th i e ir worst-case runniii ng t ime i s O ( n k ) for some constant k

Undecidable HALTS(P, X DIAGONAL(X 1. a: if HALTS(X, X) then goto a else halt How about DIAGONAL(DIAGONAL)
Und d bl ecidable HALTS(P, X) DIAGO AN L(X) 1. a: if HALTS(X, X) 2. then goto a 3. else halt How about DIAGONAL(DIAGONAL)

Shortest vs longest simple paths Shortest simple path Given a directed graph G=(V, E), find the shortest simple path between two vertices Longest simple path Given a directed graph G=(v, E), find the longest simple path between two vertices
Sh l l h Shortest vs. longest simp le pat h s Sh i l h Shortest s imp le pat h Given a directed graph G = ( V, E ) , find the shortest si l hb i imp le pat h between two vert ices. Longest simple path Longest simple path Given a directed graph G = ( V, E ) , find the longest simple path between two vertices simple path between two vertices

Konigsberg's Bridges problem D B The river Pregel divides the town of Konigsberg into four separate land masses, A, B, C, and D Seven bridges connect the various parts of town, C and some of the town's curious citizens wondered if it were possible to take a journey across all seven bridges without having to cross B any bridge more than once
Konigsb ' d bl berg's Bri dges Problem A C D B The river Pregel divides the town of Konigsberg The river Pregel divides the town of Konigsberg A into four separate land masses, A, B, C, and D. Seven bridges connect the various parts of town, C D Seven bridges connect the various parts of town, and some of the town's curious citizens wondered if it were possible to take a journey B across all seven bridges without having to cross any bridge more than once

Euler tour vs. Hamiltonian cycle Euler tour An Euler tour of a connected, directed graph G=(, E) s a cycle that traverses each edge of g exactly once Hamiltonian cycle An Hamiltonian cycle of a directed graph G=(V, E)is a simple cycle that contains each vertex in v
Eul ll er tour vs. Hami ltonian cyc l e E l u ler tour An Euler tour of a connected, directed graph G = ( V, E ) i lh s a cyc le t hat traverses each d e dge o f G exact ly once. Hamiltonian cycle Hamiltonian cycle An Hamiltonian cycle of a directed graph G = ( V, E ) is a simple cycle that contains a simple cycle that contains each vertex each vertex in V

Euler tour
Euler tour b a b c a c d d e f g

Traveling salesman problem
T l l bl Trave ling sa lesman problem

Analysis of traveling salesman problem Given a finite number of cities" along with the cost of travel between each pair of them, find the cheapest way of visiting each city exactly once and finishing at the city he starts from ·19 Cities Possible routes=18=6.40237x1015 life time=80×365×24×60×60 3.1536×10 Computer speed=10000 routes/second 253.77 Generation!
Analysis of traveling salesman problem Gi fi i b f " i i " l i h h Given a fi n ite num ber o f " c i t ies " a long w i t h t he cost of travel between each pair of them, find the cheapest way of i i i h i l d fi i hi f v i s i t ing eac h c ity exact ly once an d fi n i shing at the city he starts from. y 19 Cities y Possible routes = 18! = 6.40237 × 1015 y life time = 80 × 365 × 24 × 60 × 60 = 3,1536 × 10 9 y Computer speed = 10000 routes /second 253.77 Generation!

Certificate The class NP consists of those problems that are verifiable" in polynomial time If we were given a certificate of a solution, then we could verify that the "certificate"is correct in time polynomial in the size of the input to the problem P C NP P CnP or P= np The Clay Mathematics Institute is offering a USSI million reward to anyone who has a formal proof that problem
C f erti icate y Th l e c ass NP consi f h bl h ists of those problems that are "verifiable" in polynomial time. y If i we were given a certificate of li h a solution, then we could verify that the "certificate" is correct in time pol i l i h i f h i h bl lynomial in the size of the input to the problem. P NP ⊆ P NP ⊂ or P = NP Th Cl M h I ff US$1 ll d The Clay Mathematics Institute is offering a US$1 million reward to anyone who has a formal proof that problem
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 11 String Matching.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 10 Graph algorithms.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 09 Greedy algorithms.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 08 Dynamic programming.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 07 Amortized analysis.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 06 Binary search trees.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 05 Hash tables.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 04 Soring.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 03 Basic data structure - Elementary data structures.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 02 Divide-and-conquer design paradigm.pdf
- 复旦大学:《数据结构与算法设计 Data Structures and Algorithm》课程英文讲义_Chapter 01 Algorithm analysis and recurrences.pdf
- 复旦大学:《数据结构与算法设计》综合项目_Project3. All-pairs shortest path.pdf
- 复旦大学:《数据结构与算法设计》综合项目_Project2. English-Chinese dictionary based on binary search tree.pdf
- 复旦大学:《数据结构与算法设计》综合项目_Project1. Combining quicksort with insertion sort.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 8. String Matching.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 7. Single-Source Shortest Paths.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 6. Greedy Algorithms.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 5. Red-Black Tree.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 4. Binary Search Trees.pdf
- 复旦大学:《数据结构与算法设计》实验设计_Lab 3. Hash Tables.pdf
- 复旦大学:《计算机网络 Computer Networking》课程教学资源_考试样卷.doc
- 复旦大学:《计算机网络 Computer Networking》课程教学资源_各章节练习题.docx
- 复旦大学:《计算机网络 Computer Networking》课程教学资源_考试样卷.doc
- 《计算机网络》课程教学资源(参考文献)END-TO-END ARGUMENTS IN SYSTEM DESIGN.pdf
- 《计算机网络》课程教学资源(参考文献)The Design Philosophy of the DARPA Internet Protocols.pdf
- 《计算机网络》课程教学资源(参考文献)Interdomain Internet Routing.pdf
- 《计算机网络》课程教学资源(参考文献)Stable Internet Routing Without Global Coordination.pdf
- 《计算机网络》课程教学资源(参考文献)9e5f3e30-0aac-407f-b55f-4b04f28fcc05.pdf
- 《计算机网络》课程教学资源(参考文献)Congestion Avoidance and Control.pdf
- 《计算机网络》课程教学资源(参考文献)Random Early Detection Gateways for Congestion Avoidance.pdf
- 《计算机网络》课程教学资源(参考文献)Congestion Control for High Bandwidth-Delay Product Networks.pdf
- 《计算机网络》课程教学资源(参考文献)Analysis and Simulation of a Fair Queueing Algorithm.pdf
- 《计算机网络》课程教学资源(参考文献)Core-St at eless Fair Queueing:Achieving Approximately Fair Bandwidth Allocations in High Speed Networks.pdf
- 《计算机网络》课程教学资源(参考文献)Fundamental Design Issues for the Future Internet.pdf
- 《计算机网络》课程教学资源(参考文献)Supporting Real-Time Applications in an Integrated Services Packet Network:Architecture and Mechanism.pdf
- 《计算机网络》课程教学资源(参考文献)A Fifty Gigabit Per Second IP Router.pdf
- 《计算机网络》课程教学资源(参考文献)The iSLIP Scheduling Algorithm for Input-Queued Switches.pdf
- 《计算机网络》课程教学资源(参考文献)MACAW_A Media Access Protocol for Wireless LAN’s.pdf
- 《计算机网络》课程教学资源(参考文献)A Comparison of Mechanisms for Improving TCP Performance over Wireless Links.pdf
- 《计算机网络》课程教学资源(参考文献)Self-Management in Chaotic Wireless Deployments.pdf