Algorithmic Paradigms: Understanding Polynomial Time and Non-Deterministic Problems, Study notes of Mathematics

An introduction to algorithmic paradigms, focusing on the classes of polynomial time (p) and non-deterministic polynomial time (np) problems. It discusses the unsolvable problems, the difference between p and np, and the concept of np-complete and np-hard problems. The document also covers various algorithmic choices, including exponential algorithms, special case algorithms, approximation algorithms, and heuristic algorithms.

Typology: Study notes

Pre 2010

Uploaded on 08/19/2009

koofers-user-0uw
koofers-user-0uw 🇺🇸

8 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Mat 3770
Algorithmic Paradigms
Spring 2009
1
Algorithmic Paradigms
Not all problems are solvable by computer
Example: the Halting Problem—whether or not an arbitrary
program halts on all possible inputs—is not solvable.
IProblems which are not solvable by computer programs are
called unsolvable.
IThe class of solvable problems can be partitioned into two
general classes: P and NP.
2
P and NP Problems
IPis the set of Polynomial Time, or tractable, problems.
IAll problems that can be solved by a deterministic Turing
Machine in polynomial time are in P.
(TMs are the theoretical equivalent of “conventional”
computers.)
INP is the set of Non–deterministic Polynomial Time
problems these are problems for which we can guess the
answer (the non–determinism) and then verify it in
Polynomial Time... And we always guess the right answer!
3
P and NP Problems, Continued
IAll problems that can be solved in polynomial time by a
non-deterministic TM (NTM) are NP.
INTMs are similar to parallel machines with as many
processors as we may need—every time there is a choice(s),
start a new processor and pursue all paths. This is not very
realistic.
IIt is not known if P = NP. It is generally believed, but it has
not been proven that P 6=NP.
4
NP–Complete Problems
IAnother class of problems: NP–Complete, the “hardest”
problems in NP.
IThese problems have the property that if any one of the
NP–Complete problems can be solved in polynomial time,
then every problem in NP has a polynomial time solution.
IIf this is ever proven, one result would be that P = NP.
I.e., all the problems that have been shown to be in NP can
actually be solved in Polynomial Time.
IHowever, there are several thousand problems which have
been shown to be in the class NP-Complete, so the likelihood
is fairly slim that anyone will be able to prove any
NP–Complete problem is in P.
5
NP–Complete and NP–Hard Problems
A problem may be stated in two different ways:
1. Decision version: Does there exist a subgraph H of a graph
G, which has a specic property and has size k or bigger?
2. Optimization version: What is the largest subgraph of G
with a specic problem.
6
pf3
pf4

Partial preview of the text

Download Algorithmic Paradigms: Understanding Polynomial Time and Non-Deterministic Problems and more Study notes Mathematics in PDF only on Docsity!

Mat 3770

Algorithmic Paradigms

Spring 2009

1

Algorithmic Paradigms

Not all problems are solvable by computer

Example : the Halting Problemówhether or not an arbitrary program halts on all possible inputsóis not solvable.

I (^) Problems which are not solvable by computer programs are called unsolvable.

I (^) The class of solvable problems can be partitioned into two general classes: P and NP.

2

P and NP Problems

I (^) P is the set of Polynomial Time, or tractable , problems.

I (^) All problems that can be solved by a deterministic Turing Machine in polynomial time are in P.

( TM s are the theoretical equivalent of ìconventionalî computers.)

I (^) NP is the set of Nonñdeterministic Polynomial Time problems ó these are problems for which we can guess the answer (the nonñdeterminism) and then verify it in Polynomial Time... And we always guess the right answer!

3

P and NP Problems, Continued

I (^) All problems that can be solved in polynomial time by a non-deterministic TM (NTM) are ∈ NP.

I (^) NTMs are similar to parallel machines with as many processors as we may needóevery time there is a choice(s), start a new processor and pursue all paths. This is not very realistic.

I (^) It is not known if P = NP. It is generally believed , but it has not been proven that P 6 = NP.

4

NPñComplete Problems

I (^) Another class of problems: NPñComplete , the ìhardestî problems in NP.

I (^) These problems have the property that if any one of the NPñComplete problems can be solved in polynomial time, then every problem in NP has a polynomial time solution.

I (^) If this is ever proven, one result would be that P = NP.

I.e., all the problems that have been shown to be in NP can actually be solved in Polynomial Time.

I (^) However, there are several thousand problems which have been shown to be in the class NP-Complete, so the likelihood is fairly slim that anyone will be able to prove any NPñComplete problem is in P.

NPñComplete and NPñHard Problems

A problem may be stated in two different ways:

  1. Decision version : Does there exist a subgraph H of a graph G, which has a specic property and has size k or bigger?
  2. Optimization version : What is the largest subgraph of G with a specic problem.

I The Optimization version of any problem is called NPñHard if the Decision version of the problem is NPñComplete.

I (^) Most optimization problems in physical (VLSI chip) design are NPñHard.

I (^) If a problem is known to be NPñComplete or NPñHard, it is unlikely, although not proven , that a polynomial time algorithm exists for the problem.

7

Algorithmic Choices

I (^) Because the problems in physical design are so complex, however, we still need the help of computers to nd feasible (workable) solutions, which are not necessarily optimal.

I (^) This is true of many problems, not just VLSI design.

I We have four choices:

  1. Exponential (or worse) Algorithms (optimal)
  2. Special Case Algorithms
  3. Approximation Algorithms
  4. Heuristic Algorithms

8

I. Exponential Algorithms

I (^) If the input size is sufciently small, it may be feasible to use algorithms with exponential time complexity.

I (^) If the solution to a certain problem is critical to the chip performance, it may be practical to spend extra resources to solve the problem optimally. (E.g., using Integer Programming).

I (^) One possibility is to solve small subproblems optimally, then use another algorithm to combine them into an overall solution.

9

II. Special Case Algorithms

I (^) It may be possible to simplify a general problem by applying some restrictions to the problem.

I (^) Layout problems are easier for simplied VLSI design styles such as standard cell, and this allows the use of special case algorithms.

10

III. Approximation Algorithms

These algorithms produce results with a guarantee they will never be worse than a lower bound determined by the performance ratio of the algorithm:

approximate solution

optimal solution

IV. Heuristic Algorithms

These algorithms produce (feasible) solutions, but do not guarantee the optimality of them.

To be effective, a heuristic algorithm must:

  1. have low time and space complexity
  2. produce an optimal or nearñoptimal solution in most realistic problem instances, and
  3. have good average case complexities

5. Mathematical Programming

(e.g., 0ñ1, linear, and integer programming)

I (^) a set of constraints on the solution are expressed as a collection of inequalities

I (^) the objective function is a minimization (or max) problem subject to the set of constraints

19

6. Simulated Annealing & Other Probabilistic

Algorithms

I (^) A technique to solve general optimization problems

I (^) especially useful when the solution space of the problem is not well understood

I (^) originated from observing crystal formation of physical materials (temperature, random movement)

I (^) SA examines the congurations (feasible solutions) of the problem in sequence

20

I SA evaluates these feasible solutions as they are encountered and moves from one solution to another

I (^) at ìhigh temperatureî ó lots of random movement

I (^) as ìtemperatureî is lowered, less movement occurs, and we approach a minimum solution

I (^) Stochastic Evolution, similar to SA, has produced even better results

21

7. Branch and Bound

I (^) a general and usually inefcient method for solving optimization problems

I (^) the congurations of solutions can be stored in a tree structure where the traversal of one (downward) path in the tree produces a (possibly infeasible) solution

I (^) aim: avoid searching the entire space by stopping at nodes ( pruning ) when it is ascertained an optimal solution cannot be represented by the current path

I (^) generally, it is hard to claim anything about the running time of B & B algorithms

22

8. Genetic Algorithms

(based on population genetics)

I (^) population : a solution subñspace

I (^) evolve : be modied

I (^) crossover : merge previous solutions

I (^) mutation : modify previous solution

I (^) tness value : a measure of the competence or quality of a solution

I (^) at each stage of a GA, a population of solutions is stored and allowed to evolve through successive generations

I (^) to create a new generation, new solutions are formed by crossovers and / or mutations

I the solutions selected for the next generation are probabilistically selected based on a tness value