16
ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS 1 April 1, 1999 OPTIMIZATION PROBLEMS Problem: a general class, e.g. ‘‘the shortest-path problem for directed acyclic graphs’’. Instance: a specific case of a problem, e.g. the shortest-path problem in a specific graph, between two given vertices. An instance I + (F, c) , where: * F is the set of feasible solutions, and * c is a cost function, assigning a cost value to each feasible solution; c : F ³ R The solution of the optimization problem is the feasible solution with op- timal (minimal/maximal) cost.

Chap 4

Embed Size (px)

Citation preview

Page 1: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

1

April 1, 1999

OPTIMIZATION PROBLEMSProblem: a general class, e.g. ‘‘the shortest-path problem for directed

acyclic graphs’’.Instance: a specific case of a problem, e.g. the shortest-path problem

in a specific graph, between two given vertices.

An instance I � (F,c), where:* F is the set of feasible solutions, and* c is a cost function, assigning a cost value to each feasible solution;

c : F � R

The solution of the optimization problem is the feasible solution with op-timal (minimal/maximal) cost.

Page 2: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

2

April 1, 1999

THE SATISFIABILITY PROBLEMPROBLEM DEFINITION:Given n binary variables that are used in a product-of-sums Booleanexpression, consisting of m disjunctions, where some variables occur‘‘as such’’ and some inverted, is there an assignment such that all dis-junctions are satisfied?

Example: (x1 + x3 + x4)(x1 + x2 + x5)(x3 + x4 + x5)

Page 3: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

3

April 1, 1999

THE TRAVELING SALESMANPROBLEM (1)

PROBLEM DEFINITION:Find the shortest tour that visit all cities in a given set exactly once.

c9

c1 c2 c3

c4

c5

c7

c6

c8

c9

c1 c2 c3

c4

c5

c7

c6c8

c9

c1 c2 c3

c4

c5

c7

c6c8

Euclidean version

Page 4: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

4

April 1, 1999

THE TRAVELING SALESMANPROBLEM (2)

A B

C

D

E

F

9

5 45

8

2

7

1

5

3

A B

C

D

E

F

9

5 45

8

2

7

1

5

3

Graph version

Page 5: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

5

April 1, 1999

DECISION PROBLEMSA decision problem is a problem that can only be answered with ‘‘yes’’or ‘‘no’’.There is always a decision version of an optimization problem.Suppose it is a minimization problem; then instead of asking:

‘‘what is the minimal solution?’’ one might as well ask:

‘‘is there a solution with cost less than k?’’A decision problem �, has instances:

I � (F,c, k).The set of instances for which the answer is ‘‘yes’’ is given by: Y

�.

A subtask of a decision problem is solution checking: given f � F,check whether the cost is less than k.

Page 6: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

6

April 1, 1999

COMPLEXITY CLASS PComplexity class P contains those problems that can be solved in poly-nomial time (the number of computation steps necessary can be ex-pressed as a polynomial of the input size n).Remarks:* ‘‘reasonable’’ encoding of the input;* the computer concerned is a deterministic Turing machine:

+ deterministic means that each step in a computation is predict-able.

+ a Turing machine is a mathematical model of a universal comput-er (any computation that needs polynomial time on a Turing ma-chine can also be performed in polynomial time on any other ma-chine).

Page 7: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

7

April 1, 1999

COMPLEXITY CLASS NPSuppose that solution checking for some problem can be done in poly-nomial time on a deterministic machine � the problem can be solvedin polynomial time on a nondeterministic Turing machine.

Remarks:* nondeterministic means: the machine makes a guess, viz. the right

one (or the machine evaluates all possibilities in parallel).

A problem that can be solved in polynomial time on a nondeterministicmachine, belongs to complexity class NP.

Page 8: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

8

April 1, 1999

DECISION PROBLEMS

NPP

set of all problems

Simplistic classification of decision problems

Page 9: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

9

April 1, 1999

NP-COMPLETE PROBLEMS (1)An issue which is still unsettled:

P � NP or P � NP?

There is a strong belief that P � NP, due to the existence of NP-com-plete problems.

Property of NP-complete problems:* all problems in NPC have the same degree of difficulty: if one of them

could be solved in polynomial time, all of them would have a poly-nomial-time solution.

Page 10: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

10

April 1, 1999

NP-COMPLETE PROBLEMS (2)

NPP

NPC

Probable composition of the class NP

Page 11: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

11

April 1, 1999

POLYNOMIAL-TIME REDUCTIONS

algorithm for�1

transfor-mation f

Yes/No

�1 �2

instance I

polynomial!

polynomial? polynomial?

instance f(I)

algorithm for �2

Yes/No

The reduction of problem �1 to problem �2: f is such thatI � Y

�1� f (I) � Y

�2

Page 12: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

12

April 1, 1999

EXAMPLE OF REDUCTIONHAMILTONIAN CYCLE: Given a graph G(V,E), n = |V|, does it contain

a simple cycle going through all vertices?TRAVELING SALESMAN: Given n cities and their pairwise distances,

is there a tour visiting all cities with length less than k?HAMILTONIAN CYCLE can be reduced to TRAVELING SALESMANwith the following construction:* there is a city for each vertex in V.* if there is an edge e� E, e� (v,w),then set the distance between

the cities corresponding to v and w to 1; set the distance to 2 other-wise (cities not necessarily in Euclidean space).

* there is a Hamiltonian cycle in the original graph if and only if thereis a tour of length n in the traveling salesman problem.

Page 13: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

13

April 1, 1999

PROOF OF NP-COMPLETENESSThe proof of the NP-completeness of some problem �1 consists of twosteps:* show that �1 is in NP.

* show that some �2 � NPC polynomially reduces to �1.

Cook’s theorem: SATISFIABILITY is NP-complete.

Page 14: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

14

April 1, 1999

NP-HARD PROBLEMSA problem is called NP-hard when it is sure that no polynomial algo-rithm exists for it unless P � NP. The optimization versions of NP-com-plete decision problems are e.g. NP-hard.

Page 15: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

15

April 1, 1999

PRACTICAL CONSEQUENCESMany problems in CAD for VLSI are NP-complete or NP-hard. There-fore:* Exact solutions to such problems can only be found when the prob-

lem size is small.* One should otherwise be satisfied with suboptimal solutions found

by:+ approximation algorithms: they can e.g. guarantee a solution

within 20% of the optimum.+ heuristics: nothing can be said a priori about the quality of the so-

lution.

Page 16: Chap 4

ALGORITHMS FOR VLSI DESIGN AUTOMATION

TRACTABLE AND INTRACTABLE PROBLEMS

16

April 1, 1999

EXAMPLESTractable and intractable problems can be very similar:* The SHORTEST-PATH problem for undirected graphs is in P

(solved e.g. by Dijkstra’s Algorithm) while the LONGEST-PATHproblem is NP-complete.

* The MINIMAL RECTILINEAR SPANNING TREE problem is in P(solved e.g. by Prim’s Algorithm), while the MINIMAL RECTILIN-EAR STEINER TREE problem is NP-complete. The spanning treealgorithm can be an approximation for the Steiner tree problem.