日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

模拟退火算法解决np_P和NP问题与解决方案| 演算法

發(fā)布時(shí)間:2023/12/1 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 模拟退火算法解决np_P和NP问题与解决方案| 演算法 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

模擬退火算法解決np

P問(wèn)題 (P Problems)

P is the set of all the decision problems solvable by deterministic algorithms in polynomial time.

P是多項(xiàng)式時(shí)間內(nèi)確定性算法可解決的所有決策問(wèn)題的集合。

NP問(wèn)題 (NP Problems)

NP is the set of all the decision problems that are solvable by non - deterministic algorithms in polynomial time.

NP是可由多項(xiàng)式時(shí)間內(nèi)的非確定性算法解決的所有決策問(wèn)題的集合。

Since deterministic algorithms are just the special case of non - deterministic ones, so we can conclude that P is the subset of NP.

由于確定性算法只是非確定性算法的特例,因此我們可以得出結(jié)論,P是NP的子集。

Relation between P and NP

P和NP之間的關(guān)系

NP難題 (NP Hard Problem)

A problem L is the NP hard if and only if satisfiability reduces to L. A problem is NP complete if and only if L is the NP hard and L belongs to NP.

當(dāng)且僅當(dāng)可滿足性降低到L時(shí),問(wèn)題L才是NP難。只有當(dāng)L是NP難且L屬于NP時(shí),問(wèn)題NP才是完整的。

Only a decision problem can be NP complete. However, an optimization problem may be the NP hard. Furthermore if L1 is a decision problem and L2 an optimization problem, then it is possible that L1 α L2. One can trivially show that the knapsack decision problem reduces to knapsack optimization problem. For the clique problem one can easily show that the clique decision problem reduces to the clique optimization problem. In fact, one can also show that these optimization problems reduce to their corresponding decision problems.

只有決策問(wèn)題才能完成NP。 但是,優(yōu)化問(wèn)題可能是NP難題。 此外,如果L1是決策問(wèn)題,L2是優(yōu)化問(wèn)題,則L1αL2是可能的。 可以簡(jiǎn)單地表明,背包決策問(wèn)題可以簡(jiǎn)化為背包優(yōu)化問(wèn)題。 對(duì)于群體問(wèn)題,可以很容易地表明,群體決策問(wèn)題可以簡(jiǎn)化為群體優(yōu)化問(wèn)題。 實(shí)際上,還可以證明這些優(yōu)化問(wèn)題可以簡(jiǎn)化為相應(yīng)的決策問(wèn)題。

NP完整性問(wèn)題 (NP Completeness Problem)

Polynomial time reductions provide a formal means for showing that one problem is at least as hard as another, within a polynomial time factor. This means, if L1 <= L2, then L1 is not more than a polynomial factor harder than L2. Which is why the “l(fā)ess than or equal to” notation for reduction is mnemonic. NP complete are the problems whose status are unknown.

多項(xiàng)式時(shí)間縮減提供了一種形式化的方法,用于顯示在多項(xiàng)式時(shí)間因子內(nèi)一個(gè)問(wèn)題至少與另一個(gè)問(wèn)題一樣困難。 這意味著,如果L1 <= L2,則L1不大于比L2難的多項(xiàng)式因數(shù)。 這就是為什么“小于或等于”減少表示法是助記符的原因。 NP完全是狀態(tài)未知的問(wèn)題。

Some of the examples of NP complete problems are:

NP完全問(wèn)題的一些示例是:

1. Travelling Salesman Problem:

1. 旅行商問(wèn)題 :

Given n cities, the distance between them and a number D, does exist a tor programme for a salesman to visit all the cities so that the total distance travelled is at most D.

給定n個(gè)城市,它們之間的距離與數(shù)字D確實(shí)存在一個(gè)推銷員計(jì)劃,以供銷售人員訪問(wèn)所有城市,這樣總行駛距離最多為D。

2. Zero One Programming Problem:

2.零編程問(wèn)題:

Given m simultaneous equations,

給定m個(gè)聯(lián)立方程,

3. Satisfiability Problem:

3.滿意度問(wèn)題:

Given a formula that involves propositional variables and logical connectives.

給定一個(gè)涉及命題變量和邏輯連接詞的公式。

A language L is the subset [0, 1]* is NP complete if,

語(yǔ)言L是子集[0,1] *是NP完整,如果,

  • L belongs to NP and

    L屬于NP

  • L' ← L for every L' belongs to NP

    L'←L每L'都屬于NP

  • All NP complete problems are NP hard, but some NP hard problems are not known to be NP complete.

    所有的NP完全問(wèn)題都是NP困難的,但是某些NP困難問(wèn)題并不是NP完全的。

    If NP hard problems can be solved in polynomial time, then all the NP complete problems can be solved in polynomial time.

    如果NP難題可以在多項(xiàng)式時(shí)間內(nèi)解決,那么所有NP完全問(wèn)題都可以在多項(xiàng)式時(shí)間內(nèi)解決。

    翻譯自: https://www.includehelp.com/algorithms/p-and-np-problems.aspx

    模擬退火算法解決np

    總結(jié)

    以上是生活随笔為你收集整理的模拟退火算法解决np_P和NP问题与解决方案| 演算法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

    如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。