CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Efficient.

Slides:



Advertisements
Similar presentations
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 17: ProvingUndecidability.
Advertisements

NP-Hard Nattee Niparnan.
Cs3102: Theory of Computation Class 25: NP-Complete Appetizers Spring 2010 University of Virginia David Evans PS6 is due Tuesday, April 27 (but don’t wait.
Department of Computer Science & Engineering
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
CSE373: Data Structures & Algorithms Lecture 24: The P vs. NP question, NP-Completeness Nicki Dell Spring 2014 CSE 373 Algorithms and Data Structures 1.
Umans Complexity Theory Lectures Lecture 2a: Reductions & Completeness.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Variants.
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
NP and NP-completeness
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Graph Colouring Lecture 20: Nov 25.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA minimization.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Interaction,
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Polynomial.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Polynomial.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Turing Machines.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Graph Colouring Lecture 20: Nov 25. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Interaction,
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Turing Machines.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong The Cook-Levin.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 7 Time complexity Contents Measuring Complexity Big-O and small-o notation.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 0 Introduction Some slides are in courtesy of Prof.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NP-complete.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Great Theoretical Ideas in Computer Science.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Polynomial.
Computational Complexity Theory
NP and NP-completeness
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
CSE 105 theory of computation
Polynomial time The Chinese University of Hong Kong Fall 2010
Algorithms and Networks
Reducibility The Chinese University of Hong Kong Fall 2010
NP-complete problems The Chinese University of Hong Kong Fall 2008
Great Ideas in Computing Complexity Theory
More on DFA minimization and DFA equivalence
Richard Anderson Lecture 25 NP-Completeness
Efficient computation
Decidable and undecidable languages
Richard Anderson Lecture 30 NP-Completeness
Richard Anderson Lecture 27 NP Completeness
NP-completeness The Chinese University of Hong Kong Fall 2008
CSE 105 theory of computation
More undecidable languages
More on NP-completeness
More NP-complete problems
More undecidable languages
Richard Anderson Lecture 25 NP Completeness
Presentation transcript:

CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Efficient computation Fall 2008

Why do we care about undecidability? decidableundecidable TM M accepts input w TM M accepts all inputs CFG G is ambiguous Post Correspondence Problem... pretty much everything else anything you can write a computer program for Is P a valid java program? Can you pair up people so that every pair is happy? Can you get from point A to point B in 100 steps? Can you schedule final exams so that there are no conflicts? L = {0 n 1 n : n > 0}

Decidable problems L = {0 n 1 n : n > 0} On input x : n := |x| if n is odd reject for i := 0 to n/2 : if x i ≠ 0 or x n-i ≠ 1 reject otherwise accept Is P a valid java program? Can you get from point A to point B in 100 steps? Option 1: Try all derivations Option 2: CYK algorithm Option 3:LR(1) algorithm A B For all paths out of point A of length at most 100 : Try this path If path reaches B, accept Otherwise, reject

Scheduling Can you schedule final exams so that there are no conflicts? Say we have n exams, k slots (maybe n = 200, k = 10 ) Exams → vertices Slots → colors Conflicts → edges CSC 3230 CSC 2110 CSC 3160 CSC Task: Assign one of k colors to the vertices so that no edge has both endpoints of same color

Scheduling algorithm For every possible assignment of colors to vertices: Try this assignment If every edge has endpoints of different colors, accept If all colorings failed, reject Task: Assign one of k colors to the vertices so that no edge has both endpoints of same color CSC 3230 CSC 2110 CSC 3160 CSC

Matching Can you pair up people so that every pair is happy? People → vertices Happy together → edges Pairing → matching For every possible pairing: If each pair is happy, accept If all pairings failed, reject

Shades of decidability Is P a valid java program? Can you pair up people so that every pair is happy? Can you get from point A to point B in 100 steps? Can you schedule final exams so that there are no conflicts? L = {0 n 1 n : n > 0} Sure, we can write a computer program......but what happens when we run it?

How fast? L = {0 n 1 n : n > 0} On input x : n := |x| if n is odd reject for i := 0 to n/2 : if x i ≠ 0 or x n-i ≠ 1 reject otherwise accept Is P a valid java program? Can you get from point A to point B in 100 steps? Option 1: Try all derivations Option 2: CYK algorithm Option 3:LR(1) algorithm A B For all paths out of point A of length at most 100 : Try this path If path reaches B, accept Otherwise, reject

How fast? the lifetime of the universe P = 100 line java program Is P a valid java program? Option 1: Try all derivations Option 2: CYK algorithm Option 3:LR(1) algorithm 1 week a few milliseconds very inefficient efficient?

Finding paths Can you get from point A to point B in 1000 steps? A B For all paths out of point A of length at most 1000 : Try this path If path reaches B, accept Otherwise, reject Is there a better way to do this? Yes! Dijkstra’s algorit hm Edsger Dijkstra ( )

Matching For every possible pairing: If each pair is happy, accept If all pairings failed, reject Can we do better? Yes! Edmonds’ algorithm Jack Edmonds

Scheduling algorithm For every possible assignment of colors to vertices: Try this assignment If every edge has endpoints of different colors, accept If all colorings failed, reject Task: Assign one of k colors to the vertices so that no edge has both endpoints of same color CSC 3230 CSC 2110 CSC 3160 CSC vertices, 10 colors assignments Can we do better?

Some history first electronic computer UNIVAC 1950s integrated circuits

The need for optimization routing problems how to route calls through the phone network? packing problems how many trucks do you need to fit all the boxes?

The need for optimization scheduling problems how do you schedule jobs to complete them as soon as possible? constraint satisfaction can you satisfy a system of local constraints? 30 min 40 min 45 min 50 min 0 min

Fast algorithms shortest paths 1956 matchings 1965 and a few more…

Proving theorems Kurt Gödel J. von Neumann Princeton, 20 March 1956 Dear Mr. von Neumann: With the greatest sorrow I have learned of your illness. […] Since you now, as I hear, are feeling stronger, I would like to allow myself to write you about a mathematical problem: […] This would have consequences of the greatest importance. It would obviously mean that in spite of the undecidability of the Entscheidungsproblem, the mental work of a mathematician concerning Yes-or-No questions could be completely replaced by a machine.

Proving theorems We know some true statements are not provable But let’s forget about those. Can you get a computer to find the proof reasonably quickly? –Better than “try all possible proofs?” 52 years later, we still don’t know!

Optimization versus proofs If we can find proofs quickly, then we can also optimize quickly! Question: Can we color G with so there are no conflicts? Proof: We can, set v1v1 v2v2 v3v3 v4v4 v1v1 v2v2 v3v3 v4v4 (v1,R), (v2,Y), (v3,R), (v4,Y)

The Cook-Levin Theorem However, Constraint satisfaction is no harder than finding proofs quickly It is no easier, either Stephen Cook Leonid Levin Cook 1971, Levin 1973

Equivalence of optimization problems constraint satisfaction schedulingpacking covering routing are all as hard as one another! theorem-proving Richard Karp Q: So are they all easy or all hard? A: We don’t know, but we suspect all hard (1972)