P and NP

P: The problems that can be solved in polynomial time.

NP: The problems whose solutions can be verified in polynomial time.

NP-complete: The problems in the set of NP problems and also in the
set of NP-hard problems.Although any given solution to
such a problem can be verified quickly, there is no known
efficient way to locate a solution in the first place;
indeed, the most notable characteristic of NP-complete
problems is that no fast solution to them is known.
What makes NP-complete problems important is that if a
deterministic polynomial time algorithm can be found to
solve one of them, every NP problem is solvable in
polynomial time (one problem to rule them all).--Cook's theorem.

NP-hard: The problems that are at least as hard as NP-complete problems.
NP-hard problems do not have to be in NP.


Usually there are three kinds of algorithms to solve NP-complete and
NP-hard problems:
1. Backtracking algorithms with good prunning techniques.
2. Heuristic algorithms.
3. Approximation algorithms.

Differences between heuristic algorithms and approximation algorithms are
approximation algorithms are like putting money in the banks -- you always
get 3% benefit a year (approximation algorithms always return solutions
with a guarantee attached, you can never go too far wrong when using them)
Heuristic algorithms are like putting your money into the stock market,
you may do much better than approximation algorithms or even get the
optimal solution, but they are without guarranty.

 

转载于:https://www.cnblogs.com/tanghulu321/archive/2013/05/20/3088060.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值