亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hard.txt

?? java算法大全
?? TXT
字號:
                                             Data Structures and Algorithms13 Hard or Intractable ProblemsIf a problem has an O(nk) time algorithm (where k is a constant), then weclass it as having polynomial time complexity and as being efficientlysolvable.If there is no known polynomial time algorithm, then the problem is classedas intractable.The dividing line is not always obvious. Consider two apparently similarproblems:        Euler's problem                 asks whether there is a        (often characterized as the     path through a graph which        Bridges of K鰊igsberg - a       traverses each edge only        popular 18th C puzzle)          once.        Hamilton's problem              asks whether there is a                                        path through a graph which                                        visits each vertex exactly                                        once.Euler's problem        The 18th century German city of K鰊igsberg was situated on the        river Pregel. Within a park built on the banks of the river, there [Image]were two islands joined by seven bridges.        The puzzle asks whether it is possible to take a tour through the        park, crossing each bridge only once.An exhaustive search requires starting at every possible point andtraversing all the possible paths from that point - an O(n!) problem.However Euler showed that an Eulerian path existed iff   * it is possible to go from any vertex to any other by following the     edges (the graph must be connected) and   * every vertex must have an even number of edges connected to it, with at     most two exceptions (which constitute the starting and ending points).It is easy to see that these are necessary conditions: to complete the tour,one needs to enter and leave every point except the start and end points.The proof that these are sufficient conditions may be found in theliterature . Thus we now have a O(n) problem to determine whether a pathexists.   Transform the map into a        graph in which         We can now easily see that the Bridges of the nodes represent the "dry  K鰊igsberg does not have a solution.         land" points  and the arcs represent the   A quick inspection shows that it does have a           bridges.            Hamiltonian path.            [Image]     However there is no known efficient algorithm for determining     whether a Hamiltonian path exists.But if a path was found, then it can be verified to be a solution inpolynomial time: we simply verify that each edge in the path is actually anedge (O(e) if the edges are stored in an adjacency matrix) and that eachvertex is visited only once (O(n2) in the worst case).Classes P and NP                               What does NP mean?                               At each step in the algorithm, you guess                               which possibility to try next. This is the                               non-deterministic part: it doesn't matter Euler's problem lies in the   which possibility you try next. There is no class P: problems solvable in information used from previous attempts Polynomial time. Hamilton's   (other than not trying something that you've problem is believed to lie in already tried) to determine which class NP (Non-deterministic   alternative should be tried next. However, Polynomial).                  having made a guess, you can determine in                               polynomial time whether it is a solution or Note that I wrote "believed"  not. in the previous sentence. No-one has succeeded in       Since nothing from previous trials helps you proving that efficient (ie    to determine which alternative should be polynomial time) algorithms   tried next, you are forced to investigate don't exist yet!              all possibilities to find a solution. So the                               only systematic thing you can do is use some                               strategy for systematically working through                               all possibilities, eg setting out all                               permutations of the cities for the                               travelling salesman's tour.Many other problems lie in class NP. Some examples follow.Composite NumbersDetermining whether a number can be written as the product of two othernumbers is the composite numbers problem. If a solution is found, it issimple to verify it, but no efficient method of finding the solution exists.AssignmentAssignment of compatible room-mates: assume we have a number of students tobe assigned to rooms in a college. They can be represented as the verticeson a graph with edges linking compatible pairs. If we have two per room, aclass P algorithm exists, but if three are to be fitted in a room, we have aclass NP problem.Boolean satisfiabilityGiven an arbitrary boolean expression in n variables:     a1 op a2 op ... op anwhere op are boolean operators, and, or, ..Can we find an assignment of (true,false) to the ai so that the expressionis true? This problem is equivalent to the circuit-satisfiability problemwhich asks can we find a set of inputs which will produce a true at theoutput of a circuit composed of arbitrary logic gates.A solution can only be found by trying all 2n possible assignments.Map colouring The three-colour map colouring problem asks if we can colour a map so that no adjoining countries have the same colour. Once a solution has been guessed, then it is readily proved. [This problem is easily answered if there are only 2 colours -     [Image] there must be no point at which an odd number of countries meet - or 4 colours - there is a proof that 4 colours suffice for any map.]This problem has a graph equivalent: each vertex represents a country and anedge is drawn between two vertices if they share a common border.Its solution has a more general application. If we are scheduling work in afactory: each vertex can represent a task to be performed - they are linkedby an edge if they share a common resource, eg require a particular machine.A colouring of the vertices with 3 colours then provides a 3-shift schedulefor the factory.Many problems are reducible to others: map colouring can be reduced to graphcolouring. A solution to a graph colouring problem is effectively a solutionto the equivalent map colouring or scheduling problem. The map orgraph-colouring problem may be reduced to the boolean satisfiabilityproblem. To give an informal description of this process, assume the threecolours are red, blue and green. Denote the partial solution, "A is red" byar so that we have a set of boolean variables:                               ar  A is red                               ab  A is blue                               ag  A is green                               br  B is red                               bb  B is blue                               bg  B is green                               cr  C is red                               ... ...Now a solution to the problem may be found by finding values for ar, ab, etcwhich make the expression true:     ((ar and not ab and not ag) and ( (bb and (cb and (dg ....Thus solving the map colouring problem is equivalent to finding anassignment to the variables which results in a true value for the expression- the boolean satisfiability problem.There is a special class of problems in NP: the NP-complete problems. Allthe problems in NP are efficiently reducible to them. By efficiently, wemean in polynomial time, so the term polynomially reducible provides a moreprecise definition.In 1971, Cook was able to prove that the boolean satisfiability problem wasNP-complete. Proofs now exist showing that many problems in NP areefficiently reducible to the satisfiability problem. Thus we have a largeclass of problems which will are all related to each other: finding anefficient solution to one will result in an efficient solution for them all.An efficient solution has so far eluded a very large number of researchersbut there is also no proof that these problems cannot be solved inpolynomial time, so the search continues.Class NP problems are solvable by non-deterministic algorithms: thesealgorithms consist of deterministic steps alternating with non-deterministicsteps in which a random choice (a guess) must be made. A deterministicalgorithm must, given a possible solution,   * have at least one set of guessing steps which lead to the acceptance of     that solution, and   * always reject an invalid solution.We can also view this from the other aspect: that of trying to determine asolution. At each guessing stage, the algorithm randomly selects anotherelement to add to the solution set: this is basically building up a "game"tree. Various techniques exist for pruning the tree - backtracking when aninvalid solution is found and trying another branch, but this is where theexponential time complexity starts to enter!Travelling salesmanIt's possible to cast this problem - which is basically an optimality one,we're looking for the best tour - into a yes-no one also by simply asking:     Can we find a tour with a cost less than x?By asking this question until we find a tour with a cost x for which theanswer is provably no, we have found the optimal tour. This problem can alsobe proved to be in NP. (It is reducible to the Hamiltonian circuit problem.)Various heuristics have been developed to find near optimal solutions withefficient algorithms.One simple approach is the find the minimum spanning tree. One possible toursimple traverses the MST twice. So we can find a tour which is at most twiceas long as the optimum tour in polynomial time. Various heuristics can nowbe applied to reduce this tour, eg by taking shortcuts.An algorithm due to Christofides can be shown to produce a tour which is nomore than 50% longer than the optimal tour.        It starts with the MST and singles out all cities which are linked [Image]to an odd number of cities.        These are linked in pairs by a variant of the procedure used to        find compatible room-mates. [Image]This can then be improved by taking shortcuts.Another strategy which works well in practice is to divide the "map" intomany small regions and to generate the optimum tour by exhaustive searchwithin those small regions. A greedy algorithm can then be used to link theregions. While this algorithm will produce tours as little as 5% longer thanthe optimum tour in acceptable times, it is still not guaranteed to producethe optimal solution. Key termsPolynomial Time Complexity     Problems which have solutions with time complexity O(nk) where k is a     constant are said to have polynomial time complexity.Class P     Set of problems which have solutions with polynomial time complexity.Non-deterministic Polynomial (NP)     A problem which can be solved by a series of guessing     (non-deterministic) steps but whose solution can be verified as correct     in polynomial time is said to lie in class NP.Eulerian Path     Path which traverses each arc of a graph exactly once.Hamiltonian Path     Path which passes through each node of a graph exactly once.NP-Complete Problems     Set of problems which are all related to each other in the sense that     if any one of them can be shown to be in class P, all the others are     also in class P. Continue on to Games                 Back to the Table of Contents

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产性天天综合网| 欧美性xxxxxx少妇| 国产欧美日韩视频一区二区| 国产一区二三区| 国产午夜精品福利| 色综合 综合色| 亚洲国产精品人人做人人爽| 91精品国产品国语在线不卡| 麻豆国产精品官网| 国产午夜精品一区二区三区视频 | 欧美天堂一区二区三区| 91麻豆精品一区二区三区| 国产精品美女www爽爽爽| 国产一区二三区好的| 中文字幕一区二区三区四区不卡| 欧美怡红院视频| 麻豆精品久久精品色综合| 国产女主播一区| 色八戒一区二区三区| 欧美aaa在线| 中文字幕精品一区二区精品绿巨人| 色香蕉成人二区免费| 日韩福利视频导航| 国产日韩欧美不卡在线| 精品污污网站免费看| 国产自产高清不卡| 亚洲精品久久7777| 欧美大片在线观看一区二区| 99久久伊人精品| 日本大胆欧美人术艺术动态| 国产精品嫩草影院av蜜臀| 欧美精品日韩一区| av高清久久久| 精品中文字幕一区二区| 一区二区久久久| 久久精品欧美日韩| 91精品国产乱码久久蜜臀| 成人av一区二区三区| 日韩精品成人一区二区三区| 国产精品伦理在线| 日韩精品中文字幕在线一区| 99re亚洲国产精品| 久久国产人妖系列| 午夜精品久久久久久久久| 国产欧美精品一区| 欧美一级欧美三级| 色噜噜夜夜夜综合网| 成人一区二区三区| 蜜臀久久99精品久久久久宅男| 亚洲日穴在线视频| 久久久精品中文字幕麻豆发布| 欧美巨大另类极品videosbest| 成人av在线影院| 美女一区二区久久| 香蕉久久夜色精品国产使用方法| 亚洲欧洲av在线| 久久免费视频色| 欧美videossexotv100| 在线影院国内精品| 91在线高清观看| 成人黄色片在线观看| 国产毛片精品国产一区二区三区| 免费在线观看视频一区| 午夜精品福利久久久| 亚洲一本大道在线| 亚洲精选一二三| 亚洲嫩草精品久久| 亚洲精品乱码久久久久久黑人| 日本一区二区成人在线| 国产日韩欧美亚洲| 国产日本亚洲高清| 中文字幕免费观看一区| 国产日产欧产精品推荐色| 国产亚洲精久久久久久| 国产亚洲va综合人人澡精品| 久久色中文字幕| 久久夜色精品国产噜噜av | 色爱区综合激月婷婷| 成a人片国产精品| 不卡的看片网站| 91原创在线视频| 欧洲一区在线电影| 欧美性生活影院| 7777精品伊人久久久大香线蕉最新版| 欧美日本高清视频在线观看| 欧美美女直播网站| 欧美一级黄色录像| 精品粉嫩aⅴ一区二区三区四区| 2024国产精品| 国产精品麻豆视频| 亚洲已满18点击进入久久| 亚洲影院理伦片| 日本美女一区二区三区视频| 九九**精品视频免费播放| 国产在线播放一区| 精品日韩成人av| 欧美精品一区二区久久婷婷| 欧美国产日本韩| 亚洲精品久久久久久国产精华液| 亚瑟在线精品视频| 精品一区二区日韩| av亚洲产国偷v产偷v自拍| 在线观看国产一区二区| 欧美一级高清片| 国产精品素人一区二区| 亚洲在线视频网站| 久久精工是国产品牌吗| 白白色 亚洲乱淫| 欧美日韩极品在线观看一区| 精品久久免费看| 国产精品久久久久aaaa| 亚洲一二三四区| 国产一区二区在线免费观看| 日本乱人伦一区| wwwwww.欧美系列| 中文字幕一区二区三区在线播放 | caoporn国产精品| 欧美日韩亚洲国产综合| 欧美精品一区二区三区很污很色的| 国产精品久久免费看| 日本亚洲最大的色成网站www| 福利一区二区在线| 欧美日本一区二区三区四区 | 国产成人在线色| 日本乱人伦一区| 2023国产精品| 亚洲小少妇裸体bbw| 国产成人免费视频精品含羞草妖精| 91成人在线精品| 日本一区二区视频在线观看| 亚洲成av人片| 99精品在线免费| 精品日韩成人av| 亚洲成a人片在线观看中文| 国产精品系列在线观看| 在线综合视频播放| 91精品国产综合久久福利| 国产精品视频第一区| 日日嗨av一区二区三区四区| 91免费观看在线| 国产日韩一级二级三级| 麻豆精品在线播放| 欧美日韩精品二区第二页| 国产精品久久久久久户外露出| 麻豆精品在线看| 欧美精品在线视频| 亚洲女人的天堂| www.日韩大片| 国产亚洲一区二区在线观看| 久久er99热精品一区二区| 欧美日韩不卡一区二区| 亚洲日本在线观看| 成人毛片老司机大片| 26uuu亚洲综合色| 精品一区二区三区在线播放| 欧美日韩午夜在线视频| 亚洲久草在线视频| 99国产精品视频免费观看| 中文字幕欧美激情| 成人性视频免费网站| 久久久777精品电影网影网 | 91福利小视频| 亚洲欧美成人一区二区三区| 99久久er热在这里只有精品66| 欧美激情在线一区二区| 粉嫩高潮美女一区二区三区| 久久日一线二线三线suv| 国产原创一区二区| 久久影院电视剧免费观看| 国产乱子伦视频一区二区三区| 欧美videofree性高清杂交| 精品一区二区三区视频在线观看| 欧美一级久久久久久久大片| 久久成人麻豆午夜电影| 久久影院午夜论| 国产成人免费av在线| 国产精品福利电影一区二区三区四区| 成人精品视频一区二区三区| 国产精品久久久久久福利一牛影视| 不卡大黄网站免费看| 一区二区三区电影在线播| 欧美人牲a欧美精品| 成人中文字幕合集| 亚洲精品高清在线观看| 欧美视频一区在线| 久久精品免费观看| 国产欧美一区二区精品秋霞影院| 99精品视频在线观看免费| 亚洲免费在线视频一区 二区| 在线视频你懂得一区| 日本成人在线不卡视频| 亚洲精品在线一区二区| 成人一区在线观看| 亚洲一区二区三区四区中文字幕| 91精品欧美久久久久久动漫 | 国产精品1区二区.| 亚洲美女一区二区三区| 91精品国产入口在线| 国产精品 欧美精品| 亚洲一区二区精品久久av|