ALG 2-1: Computational Tractability (计算复杂性理论)

时间:2020-11-14 09:30:32   收藏:0   阅读:35

1.   简介

在计算理论中;有一种理论称作‘计算复杂性理论’(computational complexity theory ),专门研究计算问题时所需的资源,比如时间和空间,以及如何尽可能地节省这些资源。

 

2. Polynomial-Time

Brute force. For many non-trivial problems, there is a natural brute force search algorithm that checks every possible solution.

(暴力求解。许多大的问题,通常可以用暴力求解检查每一个可能的解决方案。)

Desirable scaling property. When the input size doubles, the algorithm should only slow down by some constant factor C.

(理想状况: 当输入大小翻倍时,算法只会减慢某个常数因子C。)  

Def. An algorithm is poly-time if the above scaling property holds. (choose C = 2^d)

定义:如果上述属性成立,则算法是poly-time的. (choose C = 2^d)

 

3. Worst-Case Analysis

Worst case running time. Obtain bound on largest possible running time of algorithm on input of a given size N.

最坏情况下运行时间。求算法在给定大小N的输入下最大运行时间的界

 

Average case running time. Obtain bound on running time of algorithm on random input as a function of input size N.

平均情况运行时间。得到随机输入作为输入大小N的函数时算法运行时间的上界。

4. Worst-Case Polynomial-Time

Def. An algorithm is efficient if its running time is polynomial. (定义:如果一个算法的运行时间是多项式的,那么它就是有效率的。

Justification: It really works in practice! (理由:它在实践中确实有效!

Exceptions

 

5. Why It Matters

技术分享图片

技术分享图片

 

 

原文:https://www.cnblogs.com/JasperZhao/p/13972192.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!