Presentation is loading. Please wait.

Presentation is loading. Please wait.

Complexity Theory in Practice

Similar presentations


Presentation on theme: "Complexity Theory in Practice"— Presentation transcript:

1 Complexity Theory in Practice
-Benjamin Daggolu

2 Introduction Knowing that a problem is NP-hard or worse does not disappear the problem, we need to design an algorithm to solve it. Approximation algorithm- runs quickly and returns good results. Probabilistic approach- uses efficient algorithms that returns optimal results in most cases but may fail miserably in some cases.

3 Very little can be said about which technique can be used to solve a specific problem. The complexity theory helps the algorithms designer in assessing hard problems bases on their complexity.

4 8.1 Circumscribing Hard Problems
It is not fully clear that a program is correct, under certain inputs it may fail. Most of the instances of the problems are easily solvable i.e. the solution algorithm runs quickly on most or all instances to which it applies.

5 It is not possible to measure the time required by an algorithm on a single instance in usual terms like polynomial or exponential as these terms are defined only for infinite classes of instances. Hence we consider only some restricted versions of hard problems to examine their complexity

6 Restrictions of Hard Problems
SAT problem is NP complete and it remains so even if it is restricted to instances where each clause contains exactly three literals. SAT problem becomes tractable when restricted to instances where each clause contains at most two literals. In terms of the number of literals per clause different variants of the problem can be classified.

7 Other dimensions: We can consider the number of times a variable may appear among all clauses. A satisfiability problem with instances containing k literals and each variable appears at most l times among all clauses is called as k,l-SAT

8 3,4-SAT is NP-complete. (Page no-288) It contains 3 literals and each variable appears at most 4 times among all clauses

9 Binpacking problem: Instance of this problem is given by a set ‘S’ of elements each with size s:S->N, and with a bin size ‘B’. The goal of this problem is to pack all the elements into the smallest number of bins.

10 Restricted Binpacking problem:
Let the problem be restricted only to the instances where all the elements have sizes at least equal to a third of the bin size. Now the restricted problem can be claimed to be solved in polynomial time.

11 The solution for the restricted problem involves preprocessing of identifying the elements which are at least a third of the bin size which takes at most linear time. Identify all possible pairs of elements that can fit together in a bin, which takes at most quadratic time.

12 Elect the largest subset of pairs that do not share any element which is a matching problem which can be solved in polynomial time. Overall the run time of the algorithm is dominated by the run time of the matching algorithm which is a low polynomial. Hence the binpacking algorithm is optimal.

13 Planar G3C is NP-complete Two crossing edges cannot share an endpoint; hence they are independent of each other from the point of view of coloring.

14 The crossing gadget must replace the two edges in such a way that -the gadget is planar and the three colorable -the coloring of original edge’s endpoint do not effect the coloring of the other edge -two endpoints of an original edge cannot be given the same color.

15 Embedding an arbitrary graph in a plane detecting all edge crossings and replacing each crossing with the gadget are all easily done in polynomial time. Planarity is not the only reasonable parameter involved in the graph. Other such parameter is the maximum degree of its vertices.

16 G3C is NP-complete even when restricted to instances where no vertex degree may exceed four. Replace any vertex of degree larger than four with a gadget such that: -the gadget is three colorable -there is connection for each vertex with the original vertex -all attaching points are colored identically.

17 Contd.. -Thank you!


Download ppt "Complexity Theory in Practice"

Similar presentations


Ads by Google