1 / 20

An overview of lecture 8

An overview of lecture 8. When is a problem parallelizable? The complexity classes P and NC and the notion of P-completeness. The Circuit Value Problem is P-complete. When is a problem parallelizable?.

dugan
Download Presentation

An overview of lecture 8

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An overview of lecture 8 • When is a problem parallelizable? • The complexity classes P and NC and the notion of P-completeness. • The Circuit Value Problem is P-complete. Advanced Topics in Algorithms and Data Structures

  2. When is a problem parallelizable? • A problem is parallelizable if it can be solved very fast with a reasonable number of processors. • By very fast, we mean polylogarithmic time, i.e., O(logk n) time for some fixed constant k and input size n. • Another requirement is that the number of processors used should be a polynomial in the input size, i.e., O(nc) for a fixed constant c. Advanced Topics in Algorithms and Data Structures

  3. The class NC • We now discuss the complexity class NC. This is Nick’s class in honour of Nick Pippenger. • The class NC consists of all the problems that can be solved by polylogarithmic-time algorithms on a PRAM, using a polynomial number of processors. Advanced Topics in Algorithms and Data Structures

  4. The class NC • The class NC is defined to be the set of all language L such that: • on all inputs of length n, • L can be recognized by a PRAM algorithm running in O(logk n)time. Advanced Topics in Algorithms and Data Structures

  5. P and NC • Let P be the class of all languages that can be recognized by a deterministic Turing machine within a polynomial number of steps. • P can be defined as the class of all problems that can be solved on a RAM in polynomial time. Advanced Topics in Algorithms and Data Structures

  6. P and NC • Obviously, NCP since we can take any NC algorithm and convert it into a polynomial time sequential algorithm. • However, it is not known whether PNC. • Most people believe that PNC. Advanced Topics in Algorithms and Data Structures

  7. P and NC • If PNC, then there must be problems in P that cannot be solved efficiently in parallel. • The class of P-complete problems are most likely candidates of problems that are not in NC. Advanced Topics in Algorithms and Data Structures

  8. P and NC • The situation is similar to the relationship between the class NP and P. • If someone can prove that there is a polynomial-time algorithm for at least one NP-complete problem, then there are polynomial time algorithms for all NP-complete problems. Advanced Topics in Algorithms and Data Structures

  9. Reducibility • Similarly, if there is a polylogarithmic-time algorithm for at least one P-complete problem, then there are polylogarithmic-time algorithms for all P-complete problems. • How do we prove a problem to be P-complete? Advanced Topics in Algorithms and Data Structures

  10. Reducibility • Let L1 and L2 be two languages. The language L1 is NC-reducible to the language L2 if: • there exists an NC-algorithm that transforms an arbitrary input u1 for L1 into an input u2 for L2 such that: u1L1 if and only if u2L2. Advanced Topics in Algorithms and Data Structures

  11. The notion of P-completeness • A language L is P-complete if: • LP, and • every language in P is NC-reducible to P. • The next question is: Is there a P-complete problem? Advanced Topics in Algorithms and Data Structures

  12. The Circuit Value Problem (CVP) • We are given a Boolean circuit consisting of NOT gates and two-valued AND and OR gates. • The problem is to determine the output of the Boolean circuit for a given set of inputs. • More precisely, our Boolean circuit C is specified by a sequence of gates C = < g1, g2, …, gn >. Advanced Topics in Algorithms and Data Structures

  13. The Circuit Value Problem (CVP) • Each gi is: • either an input, or • gi = gj gk, or gi = gj gk , or gi = gj for j, k < i. Advanced Topics in Algorithms and Data Structures

  14. CVP is P-complete • We need to prove that: • CVP is in P, and • An arbitrary language LP is NC-reducible to CVP. • CVP is clearly in P. • Given an n-gate CVP, we can • evaluate the gates sequentially in O(n) time by evaluating g1, g2, …, gn. Advanced Topics in Algorithms and Data Structures

  15. CVP is P-complete • We next show that an arbitrary language LP is NC-reducible to CVP. • We provide an NC algorithm that takes an arbitrary instance IL of L, and • maps IL into an instance ICVP of CVP such that, • IL has a yes answer if and only if ICVP has a value 1. Advanced Topics in Algorithms and Data Structures

  16. Turing machine Advanced Topics in Algorithms and Data Structures

  17. Turing machine • Since LP , there exists a one-tape deterministic Turing machine M that accepts L in polynomial time T(n), for an input size n. • We can assume that the input bits appear in n consecutive tape cells numbered 1 to n and all other cells are initially blank. • The tape head is initially scanning cell 1 and after T(n) steps, the output is written into cell 1. Advanced Topics in Algorithms and Data Structures

  18. Turing machine • Let Q = { q1,…, qs } be the set of states of M and q1 is the initial state. • Let  = { a1,…, am } be the tape alphabet. • The state transition function is given by:  : Q    Q    {L , R } Advanced Topics in Algorithms and Data Structures

  19. Turing machine • We will show how to construct a Boolean circuit C such that the value of C is 1 if and only if M accepts L, i.e., cell 1 contains 1 at time T(n). • Note that, M can only access T(n) cells in T(n) time. Hence, all cell indices i will be in the range 1iT(n). • All time steps are within the range 0tT(n). • There are only s states in M hence, all states qj are within the range 1js. Advanced Topics in Algorithms and Data Structures

  20. Some tools • The circuit C will be defined by the following Boolean functions: • H(i , t), such that H(i , t) = 1 if and only if the head scans cell i at time t. • C(i , j, t), such that C(i , j, t) = 1 if and only if cell i contains character aj at time t. • S(k , t), such that S(k , t) = 1 if and only if the state of M is qk at time t. Advanced Topics in Algorithms and Data Structures

More Related