模擬退火算法解決np_P和NP問題與解決方案| 演算法

模擬退火算法解決np

P問題 (P Problems)

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

P是多項式時間內確定性算法可解決的所有決策問題的集合。

NP問題 (NP Problems)

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

NP是可由多項式時間內的非確定性算法解決的所有決策問題的集合。

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

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

P and NP problems

Relation between P and NP

P和NP之間的關系

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.

當且僅當可滿足性降低到L時,問題L才是NP難。只有當L是NP難且L屬于NP時,問題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.

只有決策問題才能完成NP。 但是,優化問題可能是NP難題。 此外,如果L1是決策問題,L2是優化問題,則L1αL2是可能的。 可以簡單地表明,背包決策問題可以簡化為背包優化問題。 對于群體問題,可以很容易地表明,群體決策問題可以簡化為群體優化問題。 實際上,還可以證明這些優化問題可以簡化為相應的決策問題。

P, NP and HNP problems

NP完整性問題 (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 “less than or equal to” notation for reduction is mnemonic. NP complete are the problems whose status are unknown.

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

Some of the examples of NP complete problems are:

NP完全問題的一些示例是:

1. Travelling Salesman Problem:

1. 旅行商問題 :

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個城市,它們之間的距離與數字D確實存在一個推銷員計劃,以供銷售人員訪問所有城市,這樣總行駛距離最多為D。

2. Zero One Programming Problem:

2.零編程問題:

Given m simultaneous equations,

給定m個聯立方程,

Zero One Programming Problem

3. Satisfiability Problem:

3.滿意度問題:

Given a formula that involves propositional variables and logical connectives.

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

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

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

  1. L belongs to NP and

    L屬于NP

  2. 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完全問題都是NP困難的,但是某些NP困難問題并不是NP完全的。

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

如果NP難題可以在多項式時間內解決,那么所有NP完全問題都可以在多項式時間內解決。

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

模擬退火算法解決np

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/377904.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/377904.shtml
英文地址,請注明出處:http://en.pswp.cn/news/377904.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

POJ2251Dungeon Master

http://poj.org/problem?id2251 題意 &#xff1a; 就是迷宮升級版&#xff0c;從以前的一個矩陣也就是一層&#xff0c;變為現在的L層&#xff0c;" . "是可以走&#xff0c;但是“#”不可以走&#xff0c;從S走到E&#xff0c;求最短的路徑&#xff0c;若是找不到…

六、聚類算法

一、聚類概念 1&#xff0c;通俗易懂而言&#xff0c;聚類主要運用于無監督學習中&#xff0c;也就是將沒有標簽的東西如何分為幾堆兒。 2&#xff0c;無監督學習即沒有標簽&#xff0c;不知道這些玩意到底是啥。當然&#xff0c;有監督學習就是由標簽&#xff0c;我們是提前知…

Apache服務器通過.htaccess文件設置防盜鏈

用戶經常面對的一個問題就是服務器的流量問題&#xff0c;而站點文件被盜鏈是其中最為主要的部分。所謂盜鏈&#xff0c;是指其他網站直接鏈接我們網站上的文件&#xff0c;一般來 說&#xff0c;盜鏈的對象大多為很耗帶寬的大體積文件&#xff0c;如圖片、視頻等。這樣造成的后…

【C++grammar】string類和array類

目錄1、C11的string類1、創建 string 對象2、追加字符串append函數3、為字符串賦值assign函數4、at, clear, erase, and empty函數5、比較字符串compare()6、獲取子串at() 、substr()函數7、搜索字符串find()8、插入和替換字符串insert() 、replace()9、字符串運算符10、string…

六、聚類算法實戰

所有代碼塊都是在Jupyter Notebook下進行調試運行&#xff0c;前后之間都相互關聯。 文中所有代碼塊所涉及到的函數里面的詳細參數均可通過scikit-learn官網API文檔進行查閱&#xff0c;這里我只寫下每行代碼所實現的功能&#xff0c;參數的調整讀者可以多進行試驗調試。多動手…

超圖軟件試用許可操作步驟_軟件中的操作步驟

超圖軟件試用許可操作步驟The software comprises of three things: Program code, Documentation, and the Operating Procedures. The Program code is the entire software code. The Documentation is produced while the development of the software itself for the time…

mysql 2013錯誤

參考資料&#xff1a; 自由呼吸的世界-mysql 2013錯誤解決 windows下mysql日志文件開啟 今天&#xff0c;莫名其妙的來了個mysql 2013錯誤&#xff0c;導致無法登陸mysql gui工具&#xff0c;而且dos也進不去&#xff0c;提示ping 127.0.0.1,百度google后&#xff1a; 這是在使…

【嵌入式系統】STM32配置FreeRTOS以及利用多線程完成流水燈、按鍵、蜂鳴器、數碼管工作

目錄1、利用STM32CubeMX配置FreeRTOS2、完成流水燈、按鍵、蜂鳴器數碼管工作1、在gpio.c和.h文件里面書寫并聲明按鍵掃描和led、數碼管子程序2、在freertos.c文件里面設置全局變量并且在各自任務中載入程序3、關于FreeRTOS的注意事項1、利用STM32CubeMX配置FreeRTOS 假設我們之…

學好Java開發的關鍵七步

在學習編程的過程中&#xff0c;我覺得不止要獲得課本的知識&#xff0c;更多的是通過學習技術知識提高解決問題的能力&#xff0c;這樣我們才能走在最前方&#xff0c;本文主要講述如何學好Java開發的關鍵七步&#xff0c;更多Java專業知識&#xff0c;廣州瘋狂Java培訓為你講…

css模糊_如何使用CSS模糊圖像?

css模糊Introduction: 介紹&#xff1a; Sometimes even the professional developers tend to forget the various basic properties which can be applied to solve very simple problems, therefore the fundamentals of developing a website or web page should be very …

七、決策樹算法和集成算法

一、決策樹算法 Ⅰ&#xff0c;樹模型 決策樹&#xff1a;從根節點開始一步步走到葉子節點&#xff08;決策&#xff09; 所有的數據最終都會落到葉子節點&#xff0c;既可以做分類也可以做回歸 對于分類&#xff1a;是由眾數決定的&#xff0c;例如爺爺奶奶媽媽都是負數&…

leetcode 538. 把二叉搜索樹轉換為累加樹 思考分析

題目 給出二叉 搜索 樹的根節點&#xff0c;該樹的節點值各不相同&#xff0c;請你將其轉換為累加樹&#xff08;Greater Sum Tree&#xff09;&#xff0c;使每個節點 node 的新值等于原樹中大于或等于 node.val 的值之和。 提醒一下&#xff0c;二叉搜索樹滿足下列約束條件&…

SQL中GROUP BY語句與HAVING語句的使用

最近在學習SQL Server相關知識&#xff0c;一直不知道怎么使用GROUP BY語句&#xff0c;經過研究和練習&#xff0c;終于明白如何使用了&#xff0c;在此記錄一下同時添加了一個自己舉的小例子&#xff0c;通過寫這篇文章來加深下自己學習的效果&#xff0c;還能和大家分享下&a…

scala語言示例_var關鍵字與Scala中的示例

scala語言示例Scala var關鍵字 (Scala var keyword) The var Keyword in scala is used to declare variables. As Scala does not require explicit declaration of data type of the variable, var keyword is used. The variable declared using the var keyword as mutable…

八、決策樹算法實驗可視化展示

一、樹模型的可視化展示 官網下載安裝包 右擊管理員身份運行&#xff0c;直接下一步即可。 配置環境變量&#xff1a; 將安裝好的可視化軟件的bin文件夾路徑添加到系統環境變量Path下即可 打開cmd&#xff0c;輸入dot -version&#xff0c;出現相關信息即安裝成功 二、決策…

關于在頁面中針對不同版本的IE瀏覽器實現不同的JS或者CSS樣式

一般會用到<!--[if IE]>這里是正常的html代碼<![endif]--> 條件注釋只能在windows Internet Explorer(以下簡稱IE)下使用&#xff0c;因此我們可以通過條件注釋來為IE添加特別的指令。因為這只是IE瀏覽器支持的注釋。 1&#xff0c;條件注釋的基本結構和HTML的注釋…

機器學習筆記:PCA的簡單理解以及應用建議

用notability做的筆記&#xff0c;比較隨意&#xff0c;對于第五點的PCA錯誤使用需要特別強調。 目錄1、PCA與線性回歸2、PCA主成分數量選擇3、壓縮重現4、PCA應用建議5、PCA的錯誤使用1、PCA與線性回歸 2、PCA主成分數量選擇 3、壓縮重現 4、PCA應用建議 5、PCA的錯誤使用

關于asp.net中的錯誤提示“將截斷字符串或二進制數據。 語句已終止。”

好久沒有更新博客了&#xff0c;今天在寫asp.net網站的時候&#xff0c;出現了這個問題。錯誤提示“將截斷字符串或二進制數據。 語句已終止。”通過調試&#xff0c;發現在插入數據的時候&#xff0c;由于插入的數據的字符或者二進制數據的長度大于原來定義的類型的長度。及保…

c# 無法將類型隱式轉換_C#中的隱式類型數組

c# 無法將類型隱式轉換C&#xff03;隱式類型數組 (C# Implicitly Typed Arrays) Like implicitly typed variables, we can also declare an array without specifying its type such type of arrays are known as Implicitly typed arrays. 像隱式類型的變量一樣&#xff0c;…

一、信用卡卡號識別

一、思路分析 大體思路&#xff1a;首先拿到一張銀行卡&#xff0c;我們得有銀行卡號數字的0-9樣式的模板&#xff0c;然后再通過不同數字的輪廓的外接矩形來進行匹配&#xff0c;最終識別出銀行卡號所對應的數字。 銀行卡數字模板&#xff1a; 銀行卡信息&#xff1a; 拿到…