Vous êtes sur la page 1sur 16

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

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:FR The solution of the optimization problem is the feasible solution with optimal (minimal/maximal) cost.
April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

THE SATISFIABILITY PROBLEM


PROBLEM DEFINITION: Given n binary variables that are used in a product-of-sums Boolean expression, consisting of m disjunctions, where some variables occur as such and some inverted, is there an assignment such that all disjunctions are satisfied? Example: ( x 1 + x 3 + x 4 )( x 1 + x 2 + x 5 )( x 3 + x 4 + x 5 )

April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

THE TRAVELING SALESMAN PROBLEM (1)


PROBLEM DEFINITION: Find the shortest tour that visit all cities in a given set exactly once. c1 c2 c9 c8 c7 c6 c5 c8 c3 c4 c9 c7 c6 c1 c2 c3 c4 c5 c9 c7 c8 c6 c5 c1 c2 c3 c4

Euclidean version
April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

THE TRAVELING SALESMAN PROBLEM (2)


A 5 3 5 E 1 D F 7 8 2 9 4 5 C E 1 D 3 5 F 7 8 2 B A 9 5 4 5 C B

Graph version
April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

DECISION PROBLEMS
A 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 P, has instances: I + (F, c, k). The set of instances for which the answer is yes is given by: Y P. A subtask of a decision problem is solution checking: given f F, check whether the cost is less than k.
April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

COMPLEXITY CLASS P
Complexity class P contains those problems that can be solved in polynomial time (the number of computation steps necessary can be expressed 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 predictable. + a Turing machine is a mathematical model of a universal computer (any computation that needs polynomial time on a Turing machine can also be performed in polynomial time on any other machine).
April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

COMPLEXITY CLASS NP
Suppose that solution checking for some problem can be done in polynomial time on a deterministic machine the problem can be solved in 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 nondeterministic machine, belongs to complexity class NP.

April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

DECISION PROBLEMS
set of all problems NP P

Simplistic classification of decision problems

April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

NP-COMPLETE PROBLEMS (1)


An issue which is still unsettled: P NP or P + NP? There is a strong belief that P 0 NP, due to the existence of NP-complete 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 polynomial-time solution.

April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

10

NP-COMPLETE PROBLEMS (2)


NPC NP P

Probable composition of the class NP

April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

11

POLYNOMIAL-TIME REDUCTIONS
P1 P2

instance I

transformation f polynomial!

instance f(I)

algorithm for P 1
polynomial? Yes/No

algorithm for P 2
polynomial? Yes/No

The reduction of problem P 1 to problem P 2: f is such that I Y P f (I) YP


1 2
April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

12

EXAMPLE OF REDUCTION
HAMILTONIAN 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 SALESMAN with 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 otherwise (cities not necessarily in Euclidean space). * there is a Hamiltonian cycle in the original graph if and only if there is a tour of length n in the traveling salesman problem.
April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

13

PROOF OF NP-COMPLETENESS
The proof of the NP-completeness of some problem P 1 consists of two steps: * show that P 1 is in NP. NPC polynomially reduces to P 1. * show that some P 2

Cooks theorem: SATISFIABILITY is NP-complete.

April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

14

NP-HARD PROBLEMS
A problem is called NP-hard when it is sure that no polynomial algorithm exists for it unless P + NP. The optimization versions of NP-complete decision problems are e.g. NP-hard.

April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

15

PRACTICAL CONSEQUENCES
Many problems in CAD for VLSI are NP-complete or NP-hard. Therefore: * Exact solutions to such problems can only be found when the problem 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 solution.

April 1, 1999

ALGORITHMS FOR VLSI DESIGN AUTOMATION TRACTABLE AND INTRACTABLE PROBLEMS

16

EXAMPLES
Tractable and intractable problems can be very similar: * The SHORTEST-PATH problem for undirected graphs is in P (solved e.g. by Dijkstras Algorithm) while the LONGEST-PATH problem is NP-complete. * The MINIMAL RECTILINEAR SPANNING TREE problem is in P (solved e.g. by Prims Algorithm), while the MINIMAL RECTILINEAR STEINER TREE problem is NP-complete. The spanning tree algorithm can be an approximation for the Steiner tree problem.

April 1, 1999

Vous aimerez peut-être aussi