2ALGORITHMS 5. Decision problem which is NP-complete We will use the Travelling Salesman Problem Envision that you have to go to 5 urban communities on a business visit. You have all the distances. What will be the most short trip to pursue? ABCEDA? ADECBA? A conspicuous arrangement is to look at all potentialoutcomes. In any case, this works for little problems. On the off chance that you include another city it should be given a shot in each past combination. Thus this technique will take "factorial time": t = n! (As a matter of fact t = (n-1)! in any case, it is as yet a factorial.) Envision the program takes care of a 19-city issue in one second, at that point 2-city problem takes around 20 seconds to get a solution..
3ALGORITHMS What's more, a 21-city issue will take around 420 seconds (more than 6 minutes), furthermore, a 31-city issue takes 3 Million Years. Fortunately, there exist uncommon approaches to break the issue into sub-issues (known as "dynamic programming", yet the best will take an exponential time: t = 2n (2 having an exponent of n) Thus a program that unravels 19 urban areas in 1 second solves 31-urban areas in around 10 minutes, and a further 60-urban communities in around 35,000 Years (also a bit excessively long). In any case, in the event that we had the "Stunning Computer", it could, for instance, make duplicates of itself to check every one of the conceivable outcomes, and ideally tackle the issue all around rapidly. NP-hardproblems are informally defined as those that can’t be solved in polynomial time wherePis the set of all problems that can be solved inpolynomial timePis the set of all problems that can be solved in polynomial time. (a)Tightest Big omega Expression =Θ(n^2) (b) Reason is because the big O notation defines this upper bound for this algorithm. (c) A Non-comparison based sorting algorithm usually outperforms the comparison based sorting algorithm due to the speed of execution and this is because it does not do any comparisons. A good example is the Divide and Conquer algorithm