Docsity

Advanced Computational Complexity: Lecture 1 - Introduction, Slides of Advanced Computational Complexity

Partial preview of the text

Download Advanced Computational Complexity: Lecture 1 - Introduction and more Slides Advanced Computational Complexity in PDF only on Docsity!

Lecture 1: Introduction

Matthew Johnson

[email protected]

Learning Resources

19 one-hour lectures. Course text: Introduction to the theory of computation by Michael Sipser Course website: http://www.dur.ac.uk/matthew.johnson2/teaching/acc/ Assessment One summative assignment (due in March 2007). Part of end of year exam. Irregular formative assignments All content is examinable unless stated otherwise.

Examples

Given two collections of DNA sequences {a 1 ,... , ak } and {b 1 ,... , bk }: 1 What is the shortest DNA sequence that contains all of a 1 ,... , ak and b 1 ,... , bk as subsequences? 2 What is the shortest DNA sequence, formed by overlapping elements from these sets, which begins with a 1 and ends with bk? 3 Is there a sequence of indices i 1 ,... , in such that ai 1 + ai 2 + · · · + ain = bi 1 + bi 2 + · · · + bin? 4 Can each ai be paired with a distinct bj in such a way that ai and bj are 99% identical? How many ways can this be done?

Comments

Three of these examples are problems that can be solved by a computer. One is easy; the other two are hard. The other example cannot be solved by any known computer.

Models of Computation

To make statements about what can and cannot be computed we need to define a scientific model of computation. We start with a very simple model which identifies 3 aspects of any computation:

Input and Output

We shall also make some other simplifying assumptions: Input is a sequence of symbols in some fixed alphabet This means we need to define some way of encoding the description of our problem as a sequence of symbols. Output is either: A single bit, indicating yes or no; (In this model we consider only decision problems – that is, problems which require a yes/no answer) A sequence of symbols from the same alphabet as the input. (In this model we also allow optimisation problems – that is, problems which require the computation of a best answer from some set of possibilities)

Examples — Graph Problems

EULERIAN CIRCUIT

Instance : A finite graph G. Question: Does G have a Eulerian Circuit? — i.e., a cycle that goes through each edge exactly once.

HAMILTONIAN CIRCUIT Instance : A finite graph G. Question: Does G have a Hamiltonian Circuit? — i.e., a cycle that goes through each vertex exactly once.

Examples - Graph Problems

CLIQUE

Instance : A finite graph G and an integer K. Question: Does G have a clique of size K?

COLOURING Instance : A finite graph G and an integer K. Question: Does G have a colouring with K colours? — i.e., an assignment of colours to vertices such that adjacent vertices have different colours.

Example

TRAVELLING SALESMAN (D)

Instance : A finite set of cities {c 1 , c 2 ,... , cn}, a positive integer distance d(i, j) between each pair (ci , cj ), and an integer B. Question: Is there a permutation π of { 1 ,... , n} such that

(

n∑− 1 i= 1

d(π(i), π(i + 1 ))) + d(π(n), π( 1 )) ≤ B?

Encodings

To input problems to a computer, each instance must be encoded as a string of symbols over some alphabet. To do this, we need an encoding scheme. To ensure that encoding the problem does not change its essential nature, an encoding scheme must be concise: Represent numbers efficiently (not in base 1!) Not add unnecessary information, or padding (e.g. the solution) Question: What is a suitable encoding scheme for graphs, or, more simply, for trees?

What is a computation?

Alan Turing answered this question in 1936. He argued that any computation can be done using the following steps: Concentrate on one part of the problem. Depending on this, and the present state of the computer: Modify this part of problem; Move to another part of problem; Change to a new state. Repeat this until finished.

Implications

If the computation can be described in a finite number of steps, then there can only be a finite number of different situations to deal with. Therefore, there can only be a finite number of states and a finite number of symbols. In principle, the computation might continue forever and never finish, and it might use infinite storage space.

Turing Machines

Definition A k-tape Turing Machine is a 5-tuple 〈Q, Σ, δ, q 0 , F 〉, where 1 Q is a finite set of states 2 Σ is a finite alphabet 3 δ is a transition function 4 q 0 ∈ Q is an initial state 5 F ⊆ Q is a set of finite states Each tape contains a sequence of symbols from Γ = Σ ∪ {4} ( 4 is a special blank symbol – all unoccupied cells are blank) The transition function defines the action of the machine in each (non-final) state, for each collection of symbols being read: δ : (Q \ F ) × Γk^ → Q × Γk^ × {L, S, R}k

Turing Machine in Operation

1 At each step of operation, the machine is in one of the states, say q (initially, state is q 0 ) 2 The machine is reading one symbol on each tape, say s 1 ,... , sk 3 To execute one step, the machine looks up δ(q, (s 1 , s 2 ,... , sk )), which is, say, (q′, (s 1 ′, s′ 2 ,... , s k′ ), (m 1 , m 2 ,... , mk )) 4 The machine: changes its state to q′; overwrites the symbols s 1 ,... , sk with s′ 1 ,... , s′ k ; moves the heads along the tapes according to m 1 , m 2 ,... , mk (L=Left, S=Stay, R=Right). 5 Execution stops when a final state is reached.