Problem Set 8 Solutions

Similar documents
Lecture 21. The Lovasz splitting-off lemma Topics in Combinatorial Optimization April 29th, 2004

List coloring hypergraphs

Preemptive scheduling on a small number of hierarchical machines

Chapter Landscape of an Optimization Problem. Local Search. Coping With NP-Hardness. Gradient Descent: Vertex Cover

Bogoliubov Transformation in Classical Mechanics

c n b n 0. c k 0 x b n < 1 b k b n = 0. } of integers between 0 and b 1 such that x = b k. b k c k c k

μ + = σ = D 4 σ = D 3 σ = σ = All units in parts (a) and (b) are in V. (1) x chart: Center = μ = 0.75 UCL =

CS 170: Midterm Exam II University of California at Berkeley Department of Electrical Engineering and Computer Sciences Computer Science Division

IEOR 3106: Fall 2013, Professor Whitt Topics for Discussion: Tuesday, November 19 Alternating Renewal Processes and The Renewal Equation

Avoiding Forbidden Submatrices by Row Deletions

Codes Correcting Two Deletions

EE 508 Lecture 16. Filter Transformations. Lowpass to Bandpass Lowpass to Highpass Lowpass to Band-reject

Online Appendix for Managerial Attention and Worker Performance by Marina Halac and Andrea Prat

Chapter 5 Consistency, Zero Stability, and the Dahlquist Equivalence Theorem

Clustering Methods without Given Number of Clusters

Chapter 4. The Laplace Transform Method

Control Systems Analysis and Design by the Root-Locus Method

7.2 INVERSE TRANSFORMS AND TRANSFORMS OF DERIVATIVES 281

SOLUTIONS TO ALGEBRAIC GEOMETRY AND ARITHMETIC CURVES BY QING LIU. I will collect my solutions to some of the exercises in this book in this document.

List Coloring Graphs

Root Locus Diagram. Root loci: The portion of root locus when k assume positive values: that is 0

Theoretical Computer Science. Optimal algorithms for online scheduling with bounded rearrangement at the end

SOME RESULTS ON INFINITE POWER TOWERS

Multicolor Sunflowers

THE SPLITTING SUBSPACE CONJECTURE

Suggested Answers To Exercises. estimates variability in a sampling distribution of random means. About 68% of means fall

Electronic Theses and Dissertations

Z a>2 s 1n = X L - m. X L = m + Z a>2 s 1n X L = The decision rule for this one-tail test is

Convex Hulls of Curves Sam Burton

3.1 The Revised Simplex Algorithm. 3 Computational considerations. Thus, we work with the following tableau. Basic observations = CARRY. ... m.

Chapter 7. Network Flow. CS 350: Winter 2018

CHAPTER 8 OBSERVER BASED REDUCED ORDER CONTROLLER DESIGN FOR LARGE SCALE LINEAR DISCRETE-TIME CONTROL SYSTEMS

New index matrix representations of operations over natural numbers

Question 1 Equivalent Circuits

TRIPLE SOLUTIONS FOR THE ONE-DIMENSIONAL

EE 508 Lecture 16. Filter Transformations. Lowpass to Bandpass Lowpass to Highpass Lowpass to Band-reject

Minimum Cost Noncrossing Flow Problem on Layered Networks

USPAS Course on Recirculated and Energy Recovered Linear Accelerators

NOTE: The items d) and e) of Question 4 gave you bonus marks.

6. KALMAN-BUCY FILTER

March 18, 2014 Academic Year 2013/14

Computers and Mathematics with Applications. Sharp algebraic periodicity conditions for linear higher order

MATEMATIK Datum: Tid: eftermiddag. A.Heintz Telefonvakt: Anders Martinsson Tel.:

Social Studies 201 Notes for March 18, 2005

Comparing Means: t-tests for Two Independent Samples

Optimal Coordination of Samples in Business Surveys

arxiv: v4 [math.co] 21 Sep 2014

arxiv: v1 [math.mg] 25 Aug 2011

Math 273 Solutions to Review Problems for Exam 1

Competitive Analysis of Task Scheduling Algorithms on a Fault-Prone Machine and the Impact of Resource Augmentation

Suggestions - Problem Set (a) Show the discriminant condition (1) takes the form. ln ln, # # R R

ONLINE APPENDIX: TESTABLE IMPLICATIONS OF TRANSLATION INVARIANCE AND HOMOTHETICITY: VARIATIONAL, MAXMIN, CARA AND CRRA PREFERENCES

arxiv: v2 [math.nt] 30 Apr 2015

Technical Appendix: Auxiliary Results and Proofs

In presenting the dissertation as a partial fulfillment of the requirements for an advanced degree from the Georgia Institute of Technology, I agree

Midterm Review - Part 1

ALLOCATING BANDWIDTH FOR BURSTY CONNECTIONS

NCAAPMT Calculus Challenge Challenge #3 Due: October 26, 2011

An Inequality for Nonnegative Matrices and the Inverse Eigenvalue Problem

Assignment for Mathematics for Economists Fall 2016

MAE140 Linear Circuits Fall 2012 Final, December 13th

into a discrete time function. Recall that the table of Laplace/z-transforms is constructed by (i) selecting to get

THE DIVERGENCE-FREE JACOBIAN CONJECTURE IN DIMENSION TWO

Chapter 13. Root Locus Introduction

4. Connectivity Connectivity Connectivity. Whitney's s connectivity theorem: (G) (G) (G) for special

Lecture 8: Period Finding: Simon s Problem over Z N

Lecture 10 Filtering: Applied Concepts

Geometric Measure Theory

Primitive Digraphs with the Largest Scrambling Index

STOCHASTIC GENERALIZED TRANSPORTATION PROBLEM WITH DISCRETE DISTRIBUTION OF DEMAND

(b) Is the game below solvable by iterated strict dominance? Does it have a unique Nash equilibrium?

1. The F-test for Equality of Two Variances

The machines in the exercise work as follows:

White Rose Research Online URL for this paper: Version: Accepted Version

Lecture 7: Testing Distributions

Source slideplayer.com/fundamentals of Analytical Chemistry, F.J. Holler, S.R.Crouch. Chapter 6: Random Errors in Chemical Analysis


Laplace Transformation

ME2142/ME2142E Feedback Control Systems

Optimizing Cost-sensitive Trust-negotiation Protocols

Sociology 376 Exam 1 Spring 2011 Prof Montgomery

ON THE DETERMINATION OF NUMBERS BY THEIR SUMS OF A FIXED ORDER J. L. SELFRIDGE AND E. G. STRAUS

On the chromatic number of a random 5-regular graph

NAME (pinyin/italian)... MATRICULATION NUMBER... SIGNATURE

ON TESTING THE DIVISIBILITY OF LACUNARY POLYNOMIALS BY CYCLOTOMIC POLYNOMIALS Michael Filaseta* and Andrzej Schinzel 1. Introduction and the Main Theo

Social Studies 201 Notes for November 14, 2003

Nonlinear Single-Particle Dynamics in High Energy Accelerators

Lecture 9: Shor s Algorithm

ON A CERTAIN FAMILY OF QUARTIC THUE EQUATIONS WITH THREE PARAMETERS. Volker Ziegler Technische Universität Graz, Austria

The Impact of Imperfect Scheduling on Cross-Layer Rate. Control in Multihop Wireless Networks

ON THE APPROXIMATION ERROR IN HIGH DIMENSIONAL MODEL REPRESENTATION. Xiaoqun Wang

The Hassenpflug Matrix Tensor Notation

Solving Differential Equations by the Laplace Transform and by Numerical Methods

UNIT 15 RELIABILITY EVALUATION OF k-out-of-n AND STANDBY SYSTEMS

Department of Mechanical Engineering Massachusetts Institute of Technology Modeling, Dynamics and Control III Spring 2002

Online Parallel Scheduling of Non-uniform Tasks: Trading Failures for Energy

Fair Game Review. Chapter 6. Evaluate the expression. 3. ( ) 7. Find ± Find Find Find the side length s of the square.

ON A CERTAIN FAMILY OF QUARTIC THUE EQUATIONS WITH THREE PARAMETERS

Online Appendix for Corporate Control Activism

Chip-firing game and a partial Tutte polynomial for Eulerian digraphs

Transcription:

Deign and Analyi of Algorithm April 29, 2015 Maachuett Intitute of Technology 6.046J/18.410J Prof. Erik Demaine, Srini Devada, and Nancy Lynch Problem Set 8 Solution Problem Set 8 Solution Thi problem et i due at 11:59pm on Friday, April 24, 2015. Exercie 8-1. Read CLRS, Chapter 29. Exercie 8-2. Exercie 29.2-2. Exercie 8-3. Exercie 29.2-4. Exercie 8-4. Read CLRS, Chapter 34. Exercie 8-5. Exercie 34.2-8. Exercie 8-6. Exercie 34.3-5. Problem 8-1. A Simple Simplex Example [25 point] Conider a linear program (LP) coniting of two variable x 1 and x 2 atifying the following three contraint: x 1 + x 2 10 x 2 4x 1 20 x 1 + 3x 2 24 x 1, x 2 0 The goal i to maximize the value of the objective function p = 4x 1 + x 2. (a) [5 point] Draw a diagram of the feaible region. See Figure 1.

2 Problem Set 8 Solution Figure 1: The feaible region of the LP problem. Image courtey of Finite mathematic & Applied calculu (http://www.zweigmedia.com). (b) [5 point] Write the given LP in tandard form, and tranform thi tandard form repreentation into lack form. Standard form: Maximize p = 4x 1 + x 2, ubject to: x 1 + x 2 10 4x 1 x 2 20 x 1 + 3x 2 24 x 1, x 2 0 Slack form: Introduce three new variable x 3, x 4, x 5. Maximize p = 4x 1 + x 2, ubject to: x 3 = 10 x 1 x 2 x 4 = 20 4x 1 + x 2 x 5 = 24 x 1 3x 2 x 1,..., x 5 0 (c) [10 point] Ue Simplex to olve the reulting lack form LP. Identify the pivot you chooe and give the reulting modified LP and the ucceive feaible olution. Indicate the ucceive olution on your diagram from Part (a).

Problem Set 8 Solution 3 Start with x 1 = x 2 = 0, x 3 = 10, x 4 = 20, x 5 = 24, that i, the olution (0, 0, 10, 20, 24), with objective function value p = 0. The firt nonbaic variable we elect for pivoting can be either x 1 or x 2, ince both have poitive coefficient in the objective function. To be pecific, let chooe x 2. A we increae x 2, the value of x 3 and x 5 decreae. The limiting contraint i the one for x 5 : we can only increae x 2 to 8, becaue any more would make x 5 negative. We exchange x 2 with x 5 : We olve the third contraint for x 2, obtaining x 2 = 8 1x 3 1 1x 3 5. Then we ubtitute, reulting in the following new LP: Maximize p = 8 + 11 x 1 1 x 5, ubject to: 3 3 2 1 x 3 = 2 x 1 + x 5 3 3 13 1 x 4 = 28 x 1 x 5 3 3 1 1 x 2 = 8 x 1 x 5 3 3 x 1,..., x 5 0 We get a new olution by etting the non-baic variable, x 1 and x 5 equal to 0 and calculating the other: (0, 8, 2, 28, 0). The value of the objective function i now p = 8. The only option now for pivoting i x 1, becaue the coefficient of x 5 in the objective function i negative. A we increae x 1, the value of x 2, x 3, and x 4 all decreae. The limiting contraint i the one for x 3 ; we can only increae x 1 to 3. We exchange x 1 3 1 with x 3, and olve the firt contraint for x 1, obtaining x 1 = 3 2 x 3 + 2 x 5. We get the following new LP: Maximize p = 19 11 x 3 + 3 x 5, ubject to: 2 2 3 1 x 1 = 3 x 3 + x 5 2 2 13 5 x 4 = 15 + x 3 x 5 2 2 1 1 x 2 = 7 + x 3 x 5 2 2 x 1,..., x 5 0 We get a new olution by etting x 3 and x 5 to 0, obtaining (3, 7, 0, 14, 0). The value of the objective function i now p = 19. Next, we pivot on x 5. Increaing x 5 caue x 4 and x 2 to decreae, with the limiting contraint being the one for x 4. We exchange x 5 with x 4, and obtain x 5 = 6 + 13 x 3 5 2 x 5 4. We obtain the following new LP:

4 Problem Set 8 Solution Maximize p = 28 8 5 x 3 5 3 x 4, 1 1 x 1 = 6 x 3 x 4 5 5 13 2 x 5 = 6 + x 3 x 4 5 5 4 1 x 2 = 4 x 3 + x 4 5 5 x 1,..., x 5 0 We get a new olution by etting x 3 and x 4 to 0, obtaining (6, 4, 0, 0, 6), with an objective function value of 28. At thi point no further pivot are poible (their coefficient in the objective function are both negative). Thu, an optimal olution i x 1 = 6, x 2 = 4. In the above proce, we tarted from the baic olution (0,0) meaning x 1 = 0, x 2 = 0, gradually improved our etimate through (0,8), (3,7), and finally arrived at the final olution (6,4). In Figure 1, thi correpond to travering four corner of the white region tarting from the origin in the clockwie direction. (d) [5 point] Give the dual LP of your tandard-form LP from Part (b) and give it optimal value. (Hint: Ue your olution to Part (c).) The tandard-form LP from Part (b) i: Maximize p = 4x 1 + x 2, ubject to: x 1 + x 2 10 4x 1 x 2 20 x 1 + 3x 2 24 x 1, x 2 0 A in CLRS p. 880, the dual LP ue new variable y 1, y 2, and y 3. The LP i: Minimize 10y 1 + 20y 2 + 24y 3, ubject to: y 1 + 4y 2 + y 3 4 y 1 y 2 + 3y 3 1 y 1, y 2, y 3 0 By LP duality (Theorem 29.10), the minimum value for thi LP i 28. Thi value i attained when y 1 = 5 8, y 2 = 5 3, and y 3 = 0. You can find thi olution manually, or by conidering the final lack form LP in your olution in Part (c) and uing formula (29.91) on p. 882.

Problem Set 8 Solution 5 Problem 8-2. NP-Completene [25 point] In thi problem, you will prove NP-completene of a few deciion problem. To prove NPhardne, you may reduce from any problem that ha been hown, in cla or in CLRS, to be NP-complete. (a) [5 point] Let TRIPLE-SAT denote the following deciion problem: given a Boolean formula φ, decide whether φ ha at leat three ditinct atifying aignment. Prove that TRIPLE-SAT i NP-complete. To how that TRIPLE-SAT i in NP, for any input formula φ, we need only gue three ditinct aignment and verify that they atify φ. To how that TRIPLE-SAT i NP-hard, we reduce SAT to it. Let φ denote the input Boolean formula to a SAT problem and uppoe that the et of variable in φ are X = {x 1,..., x n }. We contruct a TRIPLE-SAT problem with a Boolean formula φ / over a new variable et X / a follow: X / = {x 1,..., x n, y, z}. φ / = φ. Now we claim φ i atifiable iff φ / ha at leat 3 atifying aignment. If φ i atifiable, then we can augment any particular aignment by adding any of the 4 poible pair of value for {y, z} to give at leat four atifying aignment overall. On the other hand, if φ i not atifiable, then neither i φ /. (b) [10 point] In Problem Set 1, we conidered how one might locate donut hop at ome of the vertice of a treet network, modeled a an arbitrary undirected graph G = (V, E). Each vertex u ha a nonnegative integer value p(u), which decribe the potential profit obtainable from a hop located at u. Two hop cannot be located at adjacent vertice. The problem wa to deign an algorithm that output a ubet U V that maximize the total profit u U p(u). No doubt, you found an algorithm with time complexity that wa exponential in the graph parameter. Now we will ee why. Define DONUT to be the following deciion problem: given an undirected graph G = (V, E), given a mapping p from vertice u V to nonnegative integer profit p(u), and given a nonnegative integer k, decide whether there i a ubet U V uch that no two vertice in U are neighbor in G, and uch that u U p(u) k. Prove that DONUT i NP-hard. (Hint: Try a reduction from 3SAT.) Alo, explain why thi implie that, if there i a polynomial-time algorithm to olve the original problem, i.e., to output a ubet U that maximize the total profit, then P = NP.

6 Problem Set 8 Solution Let φ = C 1 C 2... C m be the input formula to a 3SAT problem, where each claue C c ha three literal choen from {x i, x i11 i n}. We contruct a DONUT problem (G, p, k) a follow. The vertice V of G are {v c,j 11 c m, 1 j 3}, where v c,j correpond to literal j in claue C c. We label each vertex v c,j with x i or x i, whichever appear in poition j of claue C c. The edge E of G are of two type: For each claue C c, an edge between each pair of vertice correponding to literal in claue C c, that i, between v c,j1 and v c,j2 for j 1 = j 2. For each i, an edge between each pair of vertice for which one i labeled by x i and the other by x i. The function p map all vertice to 1. The threhold k i equal to m. We claim that φ i atifiable iff the total profit in the DONUT problem (G, p, k) can be at leat k. Firt, uppoe that φ i atifiable. Then there i ome truth aignment A mapping the variable to {true, fale}. A mut make at leat one literal per claue true; for each claue, elect the vertex correponding to one uch literal to be in the et U. Since there are m claue, thi yield exactly m = k vertice, o the total profit i k. Moreover, we claim that U cannot contain two neighboring vertice in G. Suppoe for contradiction that u, v U and (u, v) E. Then the edge (u, v) mut be of one of the two type above. But u and v cannot correpond to literal in the ame claue becaue we elected only one vertex for each claue. And u and v cannot be labeled by x i and x i for the ame i, becaue A cannot make both a variable and it negation true. Since neither poibility can hold, U cannot contain two neighboring vertice. U achieve a total profit of k for the DONUT problem (G, p, k). Converely, uppoe that there exit U V, U k = m containing no two neighbor in G. Since U doe not contain neighbor, it cannot contain two vertice from the ame claue. Therefore, we mut have U = m, with exactly one vertex from each claue. Now define a truth aignment A for the variable: A(x i ) = true if ome vertex with label x i i in U, and A(x i ) = fale if ome vertex with label x i i in U. For other variable the truth value can be arbitrary. Alo ince U doe not contain neighbor, U cannot contain two vertice with contradictory label, o aignment A i well-defined. A atifie all claue by making one literal correponding to a vertex in U true in each claue. Therefore, A atifie φ. For the lat quetion, uppoe that there i a polynomial-time algorithm to olve the original problem, i.e., to output a ubet U that maximize the total profit. Then thi algorithm can be eaily adapted to a polynomial-time algorithm for DONUT: for any (G, p, k), imply run the aumed algorithm and obtain an optimal ubet U. Then output true if k U, and fale otherwie. Since we have already hown that DONUT i NP-hard, thi implie that P= NP.

Problem Set 8 Solution 7 (c) [10 point] Suppoe we have one machine and a et of n tak a 1, a 2,..., a n. Each tak a j require t j unit of time on the machine, yield a profit of p j, and ha a deadline d j. Here, the t j, p j, and d j value are nonnegative integer. The machine can proce only one tak at a time. Not all tak have to be run, but if a tak tart running, it mut run without interruption and mut complete by it deadline. A chedule for a ubet of the tak decribe when each of the tak in the ubet tart running. A chedule mut oberve the contraint given above. The profit for the chedule i the um of all the p j value for the tak a j in the chedule. The problem i to produce a chedule for a ubet of the tak that return the greatet poible amount of profit. State thi problem a a deciion problem and how that it i NP-complete. In howing thi, you may reduce from any problem that ha been hown, in cla or in CLRS, to be NP-complete. Define SCHED to be the following deciion problem: given (T, P, D, k) where T, P, and D are equence {t j }, {p j } and {d j }, each of length n, decide whether there exit a ubet I {1,..., n} and an ordering i 1, i 2,..., i m of I, uch that: 1. For every j, j l=1 T (i l) D(i j ). That i, the um of the running time of the firt j tak being run i no greater than the deadline for the j th tak. That mean that, when run in the given order, all tak meet their deadline. 2. m l=1 P (i l ) k. That i, the total profit i at leat k. To ee that SCHED i in NP, given an intance (T, P, D, k), we can gue a ubet of the tak and a equence of tart time, and verify that it meet all the contraint for a chedule and that it finihe within the given time k. To how that SCHED i NP-hard, we can reduce from SUBSET-SUM, defined on p. 1097 of CLRS. Given an intance (S, t) of SUBSET-SUM, where S = n, order the element of S arbitrarily, a 1,..., n. We contruct an intance (T, P, D, k) of SCHED a follow: Let T = P = { 1,..., n } in that order, let D be a length-n equence coniting of t in every poition, and let k = t. We claim that the anwer to the SUBSET-SUM problem (S, t) i ye, iff the anwer to the SCHED problem (T, P, D, k) i ye. Firt, the anwer to the SUBSET-SUM problem (S, t) i ye. Then there i a ubet S / of the element in S whoe um i exactly t. Let I be the et of indice of the S / element within the equence 1,..., n, and let i 1, i 2,..., i m order I in increaing m order. Then the um of the running time of all tak i exactly t, that i, l=1 T (i l) = t. Thi implie that all tak meet their deadline. Moreover, the total profit i exactly m l=1 P (i l) = t = k. Therefore, the anwer to the SCHED problem (T, P, D, k) i ye. Converely, uppoe the anwer to the SCHED problem (T, P, D, k) i ye. Then there i a ubet I of 1,..., n and an ordering i 1, i 2,..., i m of I, uch that: 1. For every j, j l=1 T (i l) D(i j ).

8 Problem Set 8 Solution m 2. l=1 P (i l) k. Since all of the deadline are equal to k = t, thi i the ame a aying: m 1. l=1 T (i l) t. 2. m l=1 P (i l) t. m m Since each T (i j ) = P (i j ), thi ay that l=1 T (i l ) = l=1 P (i l ) = t. Now let S / be the ubet of S correponding to the indice in I, that i, S / = { i 1i I}. Then the um of the element of S / i exactly t. Therefore, the anwer to the SUBSET-SUM problem (S, t) i ye.

MIT OpenCoureWare http://ocw.mit.edu 6.046J / 18.410J Deign and Analyi of Algorithm Spring 2015 For information about citing thee material or our Term of Ue, viit: http://ocw.mit.edu/term.