Calculation of time complexity (3%)

Similar documents
Problem Set 9 Solutions

NP-Completeness : Proofs

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009

Finding Dense Subgraphs in G(n, 1/2)

Min Cut, Fast Cut, Polynomial Identities

6.842 Randomness and Computation February 18, Lecture 4

CS 331 DESIGN AND ANALYSIS OF ALGORITHMS DYNAMIC PROGRAMMING. Dr. Daisy Tang

The Minimum Universal Cost Flow in an Infeasible Flow Network

U.C. Berkeley CS294: Spectral Methods and Expanders Handout 8 Luca Trevisan February 17, 2016

Learning Theory: Lecture Notes

U.C. Berkeley CS294: Beyond Worst-Case Analysis Luca Trevisan September 5, 2017

Dynamic Programming. Preview. Dynamic Programming. Dynamic Programming. Dynamic Programming (Example: Fibonacci Sequence)

Complete subgraphs in multipartite graphs

Lecture 10: May 6, 2013

(k,?)-sandwich Problems: why not ask for special kinds of bread?

Stanford University CS359G: Graph Partitioning and Expanders Handout 4 Luca Trevisan January 13, 2011

Lecture Notes on Linear Regression

Edge Isoperimetric Inequalities

A 2D Bounded Linear Program (H,c) 2D Linear Programming

Which Separator? Spring 1

Chapter Newton s Method

Errors for Linear Systems

Kernel Methods and SVMs Extension

Singular Value Decomposition: Theory and Applications

APPENDIX A Some Linear Algebra

On the Multicriteria Integer Network Flow Problem

Simultaneous Optimization of Berth Allocation, Quay Crane Assignment and Quay Crane Scheduling Problems in Container Terminals

arxiv: v2 [cs.ds] 1 Feb 2017

Computing Correlated Equilibria in Multi-Player Games

NUMERICAL DIFFERENTIATION

Distance Three Labelings of Trees

Outline and Reading. Dynamic Programming. Dynamic Programming revealed. Computing Fibonacci. The General Dynamic Programming Technique

arxiv: v1 [math.co] 1 Mar 2014

Formulas for the Determinant

Resource Allocation and Decision Analysis (ECON 8010) Spring 2014 Foundations of Regression Analysis

Math Review. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

Solutions to exam in SF1811 Optimization, Jan 14, 2015

Ensemble Methods: Boosting

Lecture 10 Support Vector Machines II

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

ECE559VV Project Report

CS 770G - Parallel Algorithms in Scientific Computing

U.C. Berkeley CS294: Beyond Worst-Case Analysis Handout 6 Luca Trevisan September 12, 2017

HMMT February 2016 February 20, 2016

Assortment Optimization under MNL

An Interactive Optimisation Tool for Allocation Problems

Xiangwen Li. March 8th and March 13th, 2001

CHAPTER 17 Amortized Analysis

Module 9. Lecture 6. Duality in Assignment Problems

Homework Notes Week 7

Chapter 3 Describing Data Using Numerical Measures

The L(2, 1)-Labeling on -Product of Graphs

Compilers. Spring term. Alfonso Ortega: Enrique Alfonseca: Chapter 4: Syntactic analysis

Theoretical Computer Science

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

Correlation and Regression. Correlation 9.1. Correlation. Chapter 9

Introduction to Algorithms

Linear Classification, SVMs and Nearest Neighbors

Affine transformations and convexity

The Second Anti-Mathima on Game Theory

Clustering Affine Subspaces: Algorithms and Hardness

Lecture 17: Lee-Sidford Barrier

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 2/21/2008. Notes for Lecture 8

Lecture Space-Bounded Derandomization

Grover s Algorithm + Quantum Zeno Effect + Vaidman

MATH 5707 HOMEWORK 4 SOLUTIONS 2. 2 i 2p i E(X i ) + E(Xi 2 ) ä i=1. i=1

Design and Analysis of Algorithms

Example: (13320, 22140) =? Solution #1: The divisors of are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 41,

CHAPTER 13. Exercises. E13.1 The emitter current is given by the Shockley equation:

Problem Set 6: Trees Spring 2018

Société de Calcul Mathématique SA

arxiv: v1 [cs.gt] 14 Mar 2019

FE REVIEW OPERATIONAL AMPLIFIERS (OP-AMPS)( ) 8/25/2010

Maximizing the number of nonnegative subsets

10-701/ Machine Learning, Fall 2005 Homework 3

ECE 534: Elements of Information Theory. Solutions to Midterm Exam (Spring 2006)

Math1110 (Spring 2009) Prelim 3 - Solutions

arxiv: v3 [cs.dm] 7 Jul 2012

Difference Equations

Single-Facility Scheduling over Long Time Horizons by Logic-based Benders Decomposition

5 The Rational Canonical Form

O-line Temporary Tasks Assignment. Abstract. In this paper we consider the temporary tasks assignment

Foundations of Arithmetic

Lecture 4. Instructor: Haipeng Luo

Lecture 3: Shannon s Theorem

princeton univ. F 13 cos 521: Advanced Algorithm Design Lecture 3: Large deviations bounds and applications Lecturer: Sanjeev Arora

LINEAR TRANSFORMATION OF BINARY DECISION DIAGRAMS TROUGH SPECTRAL DOMAIN

Introduction to Statistical Methods

Introduction to Information Theory, Data Compression,

Exercises. 18 Algorithms

Chapter 8 SCALAR QUANTIZATION

Maximal Margin Classifier

Finding Primitive Roots Pseudo-Deterministically

Tornado and Luby Transform Codes. Ashish Khisti Presentation October 22, 2003

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

Notes on Frequency Estimation in Data Streams

For now, let us focus on a specific model of neurons. These are simplified from reality but can achieve remarkable results.

Norms, Condition Numbers, Eigenvalues and Eigenvectors

Double Layered Fuzzy Planar Graph

arxiv: v1 [q-bio.qm] 6 Jun 2008

Transcription:

Problem 1. (30%) Calculaton of tme complexty (3%) Gven n ctes, usng exhaust search to see every result takes O(n!). Calculaton of tme needed to solve the problem (2%) 40 ctes:40! dfferent tours 40 add operatons per each tour computng power: 0.5 trllon add operatons per second: 40! 40/(0.5 10 12 ) seconds = 2069800312653215967391200582435.6 years 1

Problem 2. Brds n a graph (20%) 1. (5%) The correspondng decson problem can be defned as follows: Gven an undrected graph G = (V, E) wth capacty c, V, decde whether k brds can lve n the gven graph wthout fghtng. Because the maxmum number of brds must be n the [max c, c ], we can solve the orgnal optmzaton problem by bnary search on k. That s, fnd the maxmum k such that the decson problem returns true. The bnary search requres solvng the decson problem log c tmes, whch s lnear to the nput sze. If the decson problem belongs to P, there exsts an algorthm solvng t n polynomal tme. By the bnary search on k, we also can solve the orgnal optmzaton problem n polynomal tme. 2. (5%) Gven any brd allocaton as the certfcate, we can check that no two adjacent vertces are occuped by brds n O( V 2 ) and that the number of brds >= k n O( V ). Obvously, the above verfcaton algorthm runs n polynomal tme. For a problem nstance of whch answer s no, t s clear that no such certfcate exsts. Therefore, the decson problem s n NP. 3. (7%) The followng s a reducton from 3-CNF-SAT to the decson problem. Gven a 3- CNF-SAT nstance F = C 1 C 2 C m, where C j s the dsjuncton of 3 varables, drawn form x 1, x 2,..., x l and x 1, x 2,..., x l. Construct graph G as follows: Frst, create a vertex wth capacty = 1 for each varable n each clause. Second, add an edge between two vertces correspondng the varables from the same clause. Fnally, add an edge between every par of vertces correspondng the varables x and x. Now, we use the black box of the decson problem to determne whether m brds can lve n G wthout fghtng. If they can, return yes. Otherwse, return no. (We do not requre the proof of correctness n ths homework problem. The proof s smlar to that of the reducton from 3-SAT to the maxmum ndependent set, whch s a well-known problem.) Let us check the tme complexty of the reducton. The frst and second steps run n O(m), and the last step runs n O(m 2 ). Therefore, 3-CNF-SAT s polynomal-tme reducble to the decson problem. 4. (3%) By the fact that 3-CNF-SAT s a known NP-complete problem and the polynomaltme reducton from 3-CNF-SAT to the decson problem, the decson problem s n NP-hard. Because the decson problem s n NP and NP-hard, the decson problem s a NP-complete problem. 2

Problem 3. MCS (15%) 1. (5%) Show that L NP Frst transform the problem nto decson problem that determne whether there s an nduced subgraph of both G 1 and G 2 wth edges k, a constant value. we can desgn an algorthm that verfy H s the nduced subgrapg of G, whch can be done n polynomal tme (O( H + mappng(v H V G )) = O(n)), so totally t takes polynomal to decde that H has edges k and H s nduced subgrapg of oth G 1 and G 2. Second we need to fnd the maxmum k to be the Maxmum Commom Subgraph, so we just need to do a for loop k = 0:mn( G 1, G 2 ) and the last teraton that the decson output yes s the maxmum k we want, so ts stll takes polynomal tme to fnd k. Then L NP. 2. (10%) Show that L NP -Hard To reduce the Maxmum Clque nto MCS, we just need to buld a new complete graph G, wth V G vertces (each 2 vertces have edge), then take the nput of Maxmum Clque, G, and G, as the nput of MCS, then we can get the maxmal k of 2 graphes, whch means that G has the maxmum clque wth vertces = k. To buld G only takes O( V G 2 ), so the reducton can be done n polynomal tme. Snce we know that Maxmum Clque s n NP -Complete, L NP -Hard. L NP and L NP -Hard L NP -complete. 3

A 2 for all possble y Problem 4. (15%) Show that any language n NP can be decded by an algorthm runnng n tme 2 O(nk) for some constant k. By the defnton of the class NP: A language L belongs to NP f and only f there exst a two-nput polynomal-tme algorthm A and a constant c such that L={x {0, 1} : there exsts a certfcate y wth y = O( x c ) such that A(x, y) = 1} Then algorthm A verfes L n polynomal tme. Therefore, for a language L n NP, we can desgn an algorthm A 2 that decdes L n tme 2 O(nk) for some constant k. f A(x, y) == 1: return 1 return 0 There are 2 y possbltes of y. y = O( x c ), therefore there are 2 O( x c) possbltes of y. And for every y, the algorthm runs A(x,y) once, n polynomal tme, O( x t ) for some constant t. So totally the runtme of the algorthm s 2 O( x c) O( x t ) = 2 O(nc) (c 2 n t ) = 2 O(nc) (2 log2c2+tlog2n ) = 2 O(nk ) 4

Problem 5. Vertex Cover(20%) 1. (4%) Fnd a mnmum vertex cover of the graph n Fgure 1. 2. No, there s no such constant k. For n N, defne G n = (V n, E n ). n V n = =0 V n, There are n! vertces n V n,0. For = 1, 2, 3,..., n, there are n! vertces n V n,. Each vertex n V n, are connected to vertces n V n,0 wthout duplcaton, so they are of degree. Therefore, every vertex n V n,0 s of degree n. The fgure of problem 5.1 s an example of G 3. The top 6 ponts are n V 3,1. The 6 ponts n the mddle are n V 3,0. The bottom left 2 ponts are n V 3,3. The bottom rght 3 ponts are n V 3,2. Snce our algorthm arbtrarly pck one of the vertces that has the greatest degree, t mght choose vertces n V n,n over V n,0, and V n,n 1 over V n,0, and so on. Our algorthm may choose all vertces n V n,n, V n,n 1, V n,n 2,..., V n,1 and none n V n,0. Therefore, we would have a n n! vertex cover of sze whle the mnmum vertex cover s V n,0. n n! n k (n!) k 1 whch would approach as n grows. 3. Yes. k = 2. By the defnton of vertex cover, f (u, v) E, at least one of u and v would be n V C. For every edge (u, v) we pcked durng the process, we add both u and v nto C and at least one of them would be n V C. Therefore, C 2 V C. 5