CSE838 Lecture notes copy right: Moon Jung Chung

Slides:



Advertisements
Similar presentations
Models of Computation Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms Week 1, Lecture 2.
Advertisements

Complexity Theory Lecture 6
1 Nondeterministic Space is Closed Under Complement Presented by Jing Zhang and Yingbo Wang Theory of Computation II Professor: Geoffrey Smith.
A Model of Computation for MapReduce
Parallel vs Sequential Algorithms
Theory of Computing Lecture 16 MAS 714 Hartmut Klauck.
Efficient Parallel Algorithms COMP308
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
1 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 · L 2 means: For some polynomial time computable map r : 8 x: x 2 L 1 iff.
Advanced Topics in Algorithms and Data Structures
CS151 Complexity Theory Lecture 5 April 13, 2015.
CS151 Complexity Theory Lecture 5 April 13, 2004.
Computability and Complexity 32-1 Computability and Complexity Andrei Bulatov Boolean Circuits.
Submitted by : Estrella Eisenberg Yair Kaufman Ohad Lipsky Riva Gonen Shalom.
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
Alternating Turing Machine (ATM) –  node is marked accept iff any of its children is marked accept. –  node is marked accept iff all of its children.
1 Lecture 3 PRAM Algorithms Parallel Computing Fall 2008.
1 Slides by Michael Lewin & Robert Sayegh. Adapted from Oded Goldreich’s course lecture notes by Vered Rosen and Alon Rosen.
Theory of Computing Lecture 19 MAS 714 Hartmut Klauck.
CS 461 – Nov. 21 Sections 7.1 – 7.2 Measuring complexity Dividing decidable languages into complexity classes. Algorithm complexity depends on what kind.
Complexity Classes Kang Yu 1. NP NP : nondeterministic polynomial time NP-complete : 1.In NP (can be verified in polynomial time) 2.Every problem in NP.
1 Lecture 2: Parallel computational models. 2  Turing machine  RAM (Figure )  Logic circuit model RAM (Random Access Machine) Operations supposed to.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
Approximation Algorithms Pages ADVANCED TOPICS IN COMPLEXITY THEORY.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Télécom 2A – Algo Complexity (1) Time Complexity and the divide and conquer strategy Or : how to measure algorithm run-time And : design efficient algorithms.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 3, 2005 Session 7.
Umans Complexity Theory Lectures Lecture 1a: Problems and Languages.
Parallel computation Section 10.5 Giorgi Japaridze Theory of Computability.
06/12/2015Applied Algorithmics - week41 Non-periodicity and witnesses  Periodicity - continued If string w=w[0..n-1] has periodicity p if w[i]=w[i+p],
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 7 Time complexity Contents Measuring Complexity Big-O and small-o notation.
Graph Theory. undirected graph node: a, b, c, d, e, f edge: (a, b), (a, c), (b, c), (b, e), (c, d), (c, f), (d, e), (d, f), (e, f) subgraph.
3/12/2013Computer Engg, IIT(BHU)1 PRAM ALGORITHMS-1.
P, NP, and NP-Complete Problems Section 10.3 The class P consists of all problems that can be solved in polynomial time, O(N k ), by deterministic computers.
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
Space Complexity Guy Feigenblat Based on lecture by Dr. Ely Porat Complexity course Computer science department, Bar-Ilan university December 2008.
CSCI 2670 Introduction to Theory of Computing November 15, 2005.
Chapters 11 and 12 Decision Problems and Undecidability.
The NP class. NP-completeness
CSCI 2670 Introduction to Theory of Computing
L is in NP means: There is a language L’ in P and a polynomial p so that L1 ≤ L2 means: For some polynomial time computable map r :  x: x  L1 iff.
PRAM Model for Parallel Computation
CS137: Electronic Design Automation
CSC 4170 Theory of Computation The class P Section 7.2.
Time complexity Here we will consider elements of computational complexity theory – an investigation of the time (or other resources) required for solving.
Summary of lectures Introduction to Algorithm Analysis and Design (Chapter 1-3). Lecture Slides Recurrence and Master Theorem (Chapter 4). Lecture Slides.
CSC 4170 Theory of Computation The class P Section 7.2.
Lecture 2: Parallel computational models
Umans Complexity Theory Lectures
PRAM Algorithms.
PRAM Model for Parallel Computation
Intro to Theory of Computation
Other Models of Computation
Computational Complexity
Richard Anderson Lecture 29 Complexity Theory
CS21 Decidability and Tractability
Time Complexity We use a multitape Turing machine
CLASSES P AND NP.
Chapter 11 Limitations of Algorithm Power
CS154, Lecture 12: Time Complexity
Part II Theory of Nondeterministic Computation
Time Complexity Classes
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Instructor: Aaron Roth
Instructor: Aaron Roth
CS151 Complexity Theory Lecture 5 April 16, 2019.
Time Complexity and the divide and conquer strategy
Presentation transcript:

CSE838 Lecture notes copy right: Moon Jung Chung Theory Moon Jung Chung 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

Parallel Minimum Spanning Tree (Deterministics) Each node is a super node. Repeat until only one super node For each super node, among edges which connects to another super node, select an edge with minimum merge two super nodes into one super node How many phase? --> O(logn) phase. each phase: O(logn) time in CRCW. Actually, with priority CRCW, O(1) time. Complexity: O(logn) time with O(m) PEs with priority CRCW, where m is the number of edges. 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

Parallel Minimum Spanning Tree (Deterministic: detailed) Repeat until there is only one super node, for each edge (x,y), if x and y are different component, component (x) = y component (y) = x For each node with priority -CW, accept the minimum value of component. Merge two super nodes into a single super node. Complexity: O(logn) time with O(m) PEs with priority CRCW, where m is the number of edges. How to avoid priority-CR? ==> If tree is a spanning tree? 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

Parallel Spanning Tree (Probablistic) For each edge, if it connects two different super nodes, add the edge in a spanning tree, and merge two super node as a single node. For two super nodes, two edges may be selected at the same time connecting them. How about cycle? To prevent these troubles, For each super node, select an edge randomly which connects to other super node. Verify if two different super nodes selected the same edge Verify if there is no cycles If the selected edge is OK, include the edge in a spanning tree, and merge two super nodes. How many phase? --> O(logn) phase in average. each phase: O(1) time in average Complexity: O(logn) time with O(m) CREW PEs. Parallel Connected Components in EREW => Use matrix multiplication: O(log2n) time using O(n2) PEs. 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

CSE838 Lecture notes copy right: Moon Jung Chung Parallel Models (i) Shared Memory (PRAM) -- deterministic how about probablistic? example minimum spanning tree (ii) Circuit: depth and size (iii) Alternating Turing Machine Brent Theorem: Any depth-d size-n combinational circuit with bounded fan-in can be simulated by p-processor CREW algorithm in O(n/p + d) time. proof: store inputs to the combinational circuit in the PRAM Each gate evaluate its output if all inputs are ready. If there are not enough PEs, evaluate gates in the order of depth. (depth of a gate: longest path from the primary inputs) Complexity: Let ni be number of gates at depth i. The simulation takes  ni/p  for the gates at the depth i total time: sum of i ni/p i ( ni/p + 1) = n/p + d. 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

CSE838 Lecture notes copy right: Moon Jung Chung Parallel Models Brent Theorem for EREW: Any depth-d size-n combinational circuit with bounded fan-in, fan-out can be simulated by p-processor EREW algorithm in O(n/p + d) time. proof: For exclusive reading, output values are copied to all gates where it is used. With bounded fan-in, fan-out, it takes constant time. Reading them one by one also takes constant time. 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

CSE838 Lecture notes copy right: Moon Jung Chung Uniform Circuit L be a language. Circuit complexity of L? Definition1: f(n) = number of gates of a circuit accepting strings of length in L. Def. 1 may not be acceptable one: L = {0n| n-th TM accepts n-th input} L is not even recursively enumerable. But L has circuit complexity 1 yes no two candidate circuits accepting a string of length. 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

CSE838 Lecture notes copy right: Moon Jung Chung Uniform Circuit Let Ln = {w | w is in L and |w| = n} There is a family of circuits {Cn}, and generating Cn can be done using polynomial time using O(logn) space. Each gate has bounded fan-in degree. Example of non-uniform: Division circuit => O(logn) time, but generation of it will require polynomial size space! NCk = {L | there is a uniform circuit of poly size and (logn)k depth} NC = k NCk Note: SCk = {L | there is a TM with time poly and (logn)k space} Relationship between SC and NC? 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

CSE838 Lecture notes copy right: Moon Jung Chung Alternating TM TM forks at each state. Subprocesses cannot communicate! TM has two types of states: universal existential At Universal: all branches must be accepted. Existential: one branch should lead to accepting state That is, each computation can be represented as a computation tree. Depth of computation tree: time complexity. Note: Deterministic TM: a path Parallel random access machine: processes can communicate. ASPACE (logn) = P 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

Parallel Computation Thesis parallel time is polynomially equivalent to sequential space. example: parallel time of vector machine is equivalent to sequential space ATIME (f(n)) and DSPACE (f(n)). ATM (S(n), T(n)): Language accepted by ATM with space S(n), time T(n). Theorem: ATM (logn, (logn)k) = NCk 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

NC-algorithm and P-complete problems Let f be a function Input: input of f Output: compute f NC1 reducible from f to g: using oracles of g, we can construct NC1 circuits computing f. oracle gate is counted as depth logn, size n. Division: input: x and y output: x/y Reciprocal: input: x output: x-1 Powering: Input: x Output: xi expressed in n2 bits Example: Division < Reciprocal Using reciprocal, compute y-1 compute x*y-1 Reciprocal < Powering: trivial How to construct log depth powering circuit? ==> seems not easy 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

NC-algorithm and P-complete problems Special case of function: language recognition. Let A, B be languages A is NC1 reducible to B, if using oracle, A can be solved in NC1. log space reduction is NC reduction. A NCB, and B is in NC, then A is also in NC. A is complete for P <=> for any B in P, A <logn B. Theorem: Let A be a P-complete problem (with respect to log space reduction). If A is in NC, then P  NC. 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung

P-complete and hard problems to make parallel Examples of P-complete problems: Monotone Circuit Value problem: Input: Monotone circuit (and, or gates, but without “not” gate, and values to primary input. Question: Is the output of circuit 0 with the given primary input values? Generating lexiographically smallest depth first search tree These P-complete problems may not be parallelizable! Open question: Perfect matching, depth first search (directed, undirected), integer GCD, modular exponentiation 12/9/2018 CSE838 Lecture notes copy right: Moon Jung Chung