lec-1 (11)

download lec-1 (11)

of 32

Transcript of lec-1 (11)

  • 7/21/2019 lec-1 (11)

    1/32

    Ragesh Jaiswal

    CSE, IIT Delhi

    CSL 356: Analysis and Design of

    Algorithms

  • 7/21/2019 lec-1 (11)

    2/32

    Topics

    Greedy Algorithms

    Divide and Conquer

    Dynamic Programming

    Network Flow

    Computational intractability

    Other topics: Randomized algorithms, Computational

    Geometry, Number-theoretic algorithms etc.

  • 7/21/2019 lec-1 (11)

    3/32

    Computational Intractability

    Introduction

  • 7/21/2019 lec-1 (11)

    4/32

    Computational Intractability Efficient Algorithms: All algorithms that run in time

    polynomialin the input size. We will call them polynomialtime algorithms.

  • 7/21/2019 lec-1 (11)

    5/32

    Computational Intractability Efficient Algorithms: All algorithms that run in time

    polynomialin the input size. We will call them polynomialtime algorithms.

    Question: Given a problem, does there exist an efficient

    algorithm to solve the problem?

  • 7/21/2019 lec-1 (11)

    6/32

    Computational Intractability Efficient Algorithms: All algorithms that run in time

    polynomialin the input size. We will call them polynomialtime algorithms.

    Question: Given a problem, does there exist an efficient

    algorithm to solve the problem?

    There are a lot of problems arising in various fields for which

    this question is still unresolved.

  • 7/21/2019 lec-1 (11)

    7/32

    Computational Intractability Efficient Algorithms: All algorithms that run in time

    polynomialin the input size. We will call them polynomialtime algorithms.

    Question: Given a problem, does there exist an efficient

    algorithm to solve the problem?

    There are a lot of problems arising in various fields for which

    this question is still unresolved.

    Question: Are these problems relatedin some manner? Are

    there certain aspects that are common to all these problems?

  • 7/21/2019 lec-1 (11)

    8/32

    Computational Intractability Efficient Algorithms: All algorithms that run in time

    polynomialin the input size. We will call them polynomialtime algorithms.

    Question: Given a problem, does there exist an efficient

    algorithm to solve the problem?

    There are a lot of problems arising in various fields for which

    this question is still unresolved.

    Question: Are these problems relatedin some manner? Are

    there certain aspects that are common to all these problems?

    Question: If someone discovers an efficient algorithm to one

    of these difficult problems, then does that mean that there

    are efficient algorithms for other problems? If so, how do we

    obtain such an algorithm.

  • 7/21/2019 lec-1 (11)

    9/32

    Computational Intractability NP-Complete Problems: This is a large class of problems

    such that all problems in this class are equivalent in thefollowing sense:

    A polynomial time algorithm for any one problem in this class implies

    the existence of polynomial time algorithm for all of them.

  • 7/21/2019 lec-1 (11)

    10/32

    Computational Intractability NP-Complete Problems: This is a large class of problems

    such that all problems in this class are equivalent in thefollowing sense:

    A polynomial time algorithm for any one problem in this class implies

    the existence of polynomial time algorithm for all of them.

    Polynomial time reduction: Consider two problemsand .

    Suppose there is a black boxthat solves arbitrary instances of

    problem.

    Suppose any arbitrary instance of problem can be solved usinga polynomial number of standard computational steps and a

    polynomial number of calls to the black box that solves instance

    of problemcorrectly.

    We say that is polynomial time reducible toor .

  • 7/21/2019 lec-1 (11)

    11/32

    Computational Intractability Polynomial time reduction:

    Consider two problemsand . Suppose there is a black boxthat solves arbitrary instances of

    problem.

    Suppose any arbitrary instance of problem can be solved using

    a polynomial number of standard computational steps and apolynomial number of calls to the black box that solves instance

    of problemcorrectly.

    We say that is polynomial time reducible toor .

    Is ?

  • 7/21/2019 lec-1 (11)

    12/32

    Computational Intractability Polynomial time reduction:

    Consider two problemsand . Suppose there is a black boxthat solves arbitrary instances of

    problem.

    Suppose any arbitrary instance of problem can be solved using

    a polynomial number of standard computational steps and apolynomial number of calls to the black box that solves instance

    of problemcorrectly.

    We say that is polynomial time reducible toor .

    Claim 1: Suppose . Ifcan be solved in polynomialtime, then can be solved in polynomial time.

    Claim 2: Suppose . If cannot be solved in

    polynomial time, thencannot be solved in polynomial time.

  • 7/21/2019 lec-1 (11)

    13/32

    Computational Intractability

    Polynomial-time reductions

  • 7/21/2019 lec-1 (11)

    14/32

    Computational Intractability: Reduction Problem(Independent set): Given a graph = (, )and

    an integer , check if there is an independent set of size at leastin .

    Independent set: A subset of vertices is called an independent set

    if there is no edge between any pair of vertices in .

    Problem(Maximum independent set): Given a graph = (, ), output the size of the independent setofofmaximum size.

  • 7/21/2019 lec-1 (11)

    15/32

    Computational Intractability: Reduction Problem(Independent set): Given a graph = (, )and

    an integer , check if there is an independent set of size at leastin .

    Independent set: A subset of vertices is called an independent set

    if there is no edge between any pair of vertices in .

    Problem(Maximum independent set): Given a graph = (, ), output the size of the independent set ofofmaximum size.

  • 7/21/2019 lec-1 (11)

    16/32

    Computational Intractability: Reduction Problem(Independent set): Given a graph = (, )and

    an integer , check if there is an independent set of size at leastin .

    Independent set: A subset of vertices is called an independent set

    if there is no edge between any pair of vertices in .

    Problem(Maximum independent set): Given a graph

    = (, ), output the size of the independent set ofof

    maximum size.

    Claim 1: Maximum-independent-set Independent-set

    Claim 2: Independent-set Maximum-independent-set

  • 7/21/2019 lec-1 (11)

    17/32

    Computational Intractability: Reduction Problem(Vertex cover): Given a graph = (, )and an

    integer , check if there is a vertex cover of size at most in . Vertex cover: A subset of vertices is called a vertex cover of if

    for any edge (,)in the graph is in or is in .

    Problem(Minimum vertex cover): Given a graph =(,)

    , output the size of thevertex cover

    of

    of minimumsize.

  • 7/21/2019 lec-1 (11)

    18/32

  • 7/21/2019 lec-1 (11)

    19/32

    Computational Intractability: Reduction Problem(Vertex cover): Given a graph = (, )and an

    integer , check if there is a vertex cover of size at most in . Vertex cover: a subset of vertices is called a vertex cover of if

    for any edge (,)in the graph is in or is in .

    Problem(Minimum vertex cover): Given a graph = (, ),output the size of the vertex cover of of minimum size.

    Claim 1: Minimum-vertex-cover

    Vertex-cover.

    Claim 2: Vertex-cover Minimum-vertex-cover

  • 7/21/2019 lec-1 (11)

    20/32

    Computational Intractability: Reduction Claim: Independent-set Vertex-cover.

  • 7/21/2019 lec-1 (11)

    21/32

    Computational Intractability: Reduction Claim: Independent-set Vertex-cover.

    Proof:

    Claim 1: Let be an independent set of , then is a

    vertex cover of .

  • 7/21/2019 lec-1 (11)

    22/32

    Computational Intractability: Reduction Claim: Independent-set Vertex-cover.

    Proof:

    Claim 1: Let be an independent set of , then is a

    vertex cover of .

    Claim 2: Let be a vertex cover of , then is an

    independent set of .

  • 7/21/2019 lec-1 (11)

    23/32

    Computational Intractability: Reduction Claim: Independent-set Vertex-cover.

    Proof:

    Claim 1: Let be an independent set of , then is a

    vertex cover of .

    Claim 2: Let be a vertex cover of , then is an

    independent set of .

    Claim 3: has an independent set of size at least if and only if

    has a vertex cover of size at most ( ).

  • 7/21/2019 lec-1 (11)

    24/32

    Computational Intractability: Reduction Claim: Independent-set Vertex-cover.

    Proof:

    Claim 1: Let be an independent set of , then is a

    vertex cover of .

    Claim 2: Let be a vertex cover of , then is an

    independent set of .

    Claim 3: has an independent set of size at least if and only if

    has a vertex cover of size at most ( ).

    Given an instance of the independent set problem (,)create

    an instance of the vertex cover problem (, ), make aquery to the black box solving the vertex cover problem and

    return the answer that is returned by the black box.

  • 7/21/2019 lec-1 (11)

    25/32

    Computational Intractability: Reduction Claim: Minimum-vertex-cover Maximum-independent-

    set.

  • 7/21/2019 lec-1 (11)

    26/32

  • 7/21/2019 lec-1 (11)

    27/32

    Computational Intractability: Reduction Claim: Minimum-vertex-cover p Maximum-independent-

    set. Proof 1: has an independent set of size at least if and

    only if has a vertex cover of size at most ( ).

    Proof 2:

    Minimum-vertex-cover Vertex-cover.

    Vertex-cover Independent-set.

    Independent-set Maximum-independent-set.

  • 7/21/2019 lec-1 (11)

    28/32

    Computational Intractability: Reduction Claim: Minimum-vertex-cover p Maximum-independent-

    set. Proof 1: has an independent set of size at least if and

    only if has a vertex cover of size at most ( ).

    Proof 2:

    Minimum-vertex-cover Vertex-cover.

    Vertex-cover Independent-set.

    Independent-set Maximum-independent-set.

    Theorem: If and , then .

  • 7/21/2019 lec-1 (11)

    29/32

  • 7/21/2019 lec-1 (11)

    30/32

    Computational Intractability: Reduction Problem(Deg-3-Independent set): Given a graph

    = (, )of bounded degree3and an integer , check ifthere is an independent set of size at least in .

    Graph with bounded degree 3: A graph is said to have bounded

    degree 3if the degrees of all vertices in the graph is at most 3.

    Claim: Independent-set Deg-3-Independent-set.

  • 7/21/2019 lec-1 (11)

    31/32

    Computational Intractability: Reduction

    Claim: Independent-set

    Deg-3-Independent-set.

    Claim: has an independent set of size at least if and only

    if has an independent set of size at least ( + 1).

  • 7/21/2019 lec-1 (11)

    32/32

    End