Comp Online Algorithms
|
|
- Ashley Jennings
- 5 years ago
- Views:
Transcription
1 Comp Online Algorithms Assignment 1: Introduction, Searching & List Update Shahin Kamalli University of Manitoa - Fall 2018 Due: Thursday, Octoer 4th at 11:59 pm Octoer 29, 2018 The real prolem is not whether machines think ut whether men do. B.F.Skinner Please pay attention to the followings when preparing/sumitting your assignment: All prolems are written prolems. There are six prolems with a total of 74 marks plus 108 onus marks! If you feel the assignment is too hard (or too simple), do not panic! To some extent, this assignment serves to indicate how easy/hard the future assignments/exam should e. More importantly, the assignment is designed to raise a group discussion. I would love to see a discussion on Piazza and when you are confused drop a hint aout a prolem. Think of the assignment as a project that you need to work on together on Piazza. If you are not active on Piazza, you will miss the hints that I plan to drop. Do not approach the onus prolems efore finishing the work on the mandatory parts. Bonus prolems are much harder and you are not expected to know them for your final exam. Indeed one of the onus prolems has 100 marks and is a great topic for a research project. If you are interested, come and talk to me aout it (if you solve it, you make me impressed and very happy). Let me e redundant: if you have any question related to the assignment, you are encouraged to post it on Piazza. Note that you can sumit anonymously. Also, instead of ing me, you can always write a private note in Piazza. It is likely that I drop hints when a question is posted pulicly on Piazza (ecause all students can enefit from it). It is not the case when you ask questions in s or during office hours. Do not post any answer or hint on Piazza. You are welcome to discuss the prolems with your friends (or enemies). But you should write your answers individually. You might e interviewed aout your answers. Be careful not to accidentally copy. Sumit your answers electronically using UMLearn. You should sumit a single pdf file. You are encouraged to prepare your assignment using L A TEX. The LaTex file for this assignment is posted.
2 Prolem 1 Ski-rental & Randomization [4+4 = 8 marks] I) Consider the following randomized algorithm for the ski-rental prolem: with a chance of 1, uy the equipment at the eginning, and with a chance of 1 always rent and never uy. Recall that the cost of uying is and the cost of renting is 1 per day; let x denote the numer of days that the the player goes skiing. a) What is the expected cost of the algorithm in terms of and x? ) Is the algorithm competitive? You need to either prove a constant ound for the competitive ratio OR show via adversarial input that the competitive ratio is not constant. a) The cost of the algorithm is with a chance of 1 and x with a chance of 1 1. On expectation, it is + 1 x = 1+x/. ) Despite using randomization, the algorithm is not competitive. Consider the following adversarial input: the adversary selects a very large x, for example x ω(2 ). The expected cost of the algorithm grows with x while the cost of Opt is (it knows x is pretty large and uys at the eginning). The competitive ratio will e at least ω( x 2 ) which is unounded for large values of. II) consider another randomized algorithm that works as follows. It rents equipment for the first 1 days. For each day that follows, it uys the equipment with a chance of 1/2 and rents it otherwise (note that if the algorithm uys the equipment at some day, it oviously does not make a decision in the days that follows). What is the competitive ratio of the algorithm? To answer this question, put yourself in the shoes of an adversary who wants to make a worst-case scenario for the algorithm. For sufficiently large values of x, the algorithms rents for the first 1 days, and, on average, it rents for another two days ( = 2). So, the adversary chooses x = + 3. The cost of Opt will e and the expected cost of the algorithm will e + 1 (for renting) plus (for uying) which gives The competitive ratio will e 2+1. Note that a smaller value of x decreases the expected cost of algorithm and larger x does not change its cost. So, this particular choice of x reflects the worst-case scenario. 2
3 Prolem 2 Path-cow Prolem [6+6+8 = 20 marks] I) Consider the following algorithm for path-cow prolem. The cow starts at the origin, moves x = 1 unit to the right. If the target is not found, the cow comes ack to the origin and goes x = 1 unit to the left. If the target is not found, the cow comes ack to the origin and repeats this procedure with x = 2, 4,..., 2 i,... until the target is found. a) Assume the cow finds the hole at distance u from the origin on its left. Assume the largest power of 2 which is smaller than u is 2 k. What is the total distance moved y the cow? ) Where does the adversary place the hole in order to harm the algorithm? c) What is the competitive ratio of this algorithm? a) The total moved distance would e: 4( k ) k+1 + u = 6 2 k+1 + u 4. ) Adversary places the hole at distance u = 2 k + ɛ on the left. The cost of Opt will e u = 2 k + ɛ. c) The competitive ratio would e: 6 2k+1 +u 4 u small ɛ and large u). = k k +ɛ k+1 2 k = 13 (to get this ratio, the adversary chooses II) In part I we assumed the algorithm is deterministic and the first move is to the right. Consider the same algorithm in which the first move is randomly selected to e to the right or left (each with a chance of 1/2). What the competitive ratio of this randomized algorithm is? As efore, let 2 k e the largest power of 2 smaller than u. We consider the algorithm Alg1 whose first move is to the right and Alg2 whose first move is to the left. The total cost of the two algorithms is Alg1 + Alg2 = 4( k ) k+1 + u + 4( k ) + u = 8 2 k u k+1 So, the expected cost of the randomized algorithm is 4 2 k k + u 4 = 2 k k + u 4. As efore, the adversary places the target at distance 2 k + ɛ (this time it does not matter on which side). The competitive ratio will e: 2 k k+1 + u 4 u = 1 + 2k k k 11 III) Assume instead of a path, we have a inary tree with each edge having a length of 1. Originally, the cow is located at the root. First, she moves to the left child; if the target is not found, she goes ack to the root and then moves to the right child. If the target is still not found, she returns to the root and goes to visit all nodes of depth 2 on the left (i.e., at distance 2 from the root on the left). After checking these nodes, the cow returns to the root and repeats the same for nodes of depth 2 in the right side of the root. This procedure is repeated until at some point the target is found. Assume the cow uses depth first strategy to check nodes of depth i. In a nutshell, the algorithm works y working in rounds, where at round i it visits all vertices of depth 2 i. What is the competitive ratio of this algorithm? To answer, assume the target is at depth k and write the competitive ratio in terms of k. As efore, you have to indicate where the adversary places the target and deduce the competitive ratio accordingly. At step i, nodes of depth i are visited. The induced inary sutree is formed y 2 i leaves and 2 i+1 2 edges. Each of these edges are visited 2 times in a round. So, the cost of the algorithm at round i is 2 i+2 4. In the worst case, the target is located at depth k and is the last vertex checked y the algorithm at round k. In this case, the distance moved y round k is 2 k+2 4 k (the last deduction is ecause the algorithm does not return to the root after finding the target). On the other hand, the cost of Opt is k. The competitive ratio will e ( ) + ( ) (2 (k 1)+2 2) + (2 k+2 2 k) = (2 k+3 1) ( ) 2k k = 2 k+3 3k 8 The competitive ratio will e 2k+3 3k 8 k. 3
4 Prolem 3 Online Bidding and Advice [4 + 6 = 10 marks] We saw in the class that a simple douling approach gives the est competitive ratio that a deterministic online idding algorithm can achieve. That ratio was 4. In this prolem, we examine the power of advice and randomization for this prolem; asically we want to show that advice is stronger that randomization. Consider two determnistic algorithms Alg1 and Alg2, where Alg1 guesses are 1, 4, 16,... 4 i and Alg2 guesses are 2, 8, 32,..., 2 4 i. a) Consider an algorithm that flips a fair coin at the eginning and randomly chooses etween Alg1 and Alg2, and uses the guesses of the selected algorithm. What is the competitive ratio of this randomized algorithm? The adversary chooses u = 2 k + ɛ. The sum of the costs of the two algorithms is k + 2 k k+2 = 2 k+3 1. The expected cost is therefore 2 k+2 1/2 and the competitive ratio is 2k Note that this no etter 2 k +ɛ than the deterministic algorithm. ) Assume an algorithm that receives 1 it of advice. For each instance of the prolem the advice it indicates the algorithm which has smaller cost etween Alg1 and Alg2. What is the competitive ratio of the algorithm with 1 it of advice? As efore, assume the adversary chooses u = 2 k + ɛ. If k is even, Alg2 has cost k k+1 = 2( (k 2)/2 + 4 k/2 ) = 2 4k/ /3 2 k. The ratio etween the cost of Alg2 and Opt will converge to 8/3 for large values of k. If k is odd, Alg1 has cost k k+1 = (k 1)/2 + 4 (k+1)/2 = 4(k+1)/ k. Like efore the ratio etween the cost of the algorithm and Opt approaches to 8/3 for large values of k. Note that only one it of advice resulted in an algorithm with etter competitive ratio than any purely-online algorithm. 4
5 Prolem 4 Clustering & Advice [5 + 7 = 12 marks] Considering the online clustering prolem. Recall that in this prolem, we need to partition a sequence of online points into k clusters so that the maximum diameter of clusters is minimized. Assume the length of the input sequence (i.e., the numer of points) is n. a) Show that O(n log k) its of advice are sufficient to achieve an optimal clustering. To get the full mark, you need to precisely indicate i) what the advice encodes? ii) how the algorithm works? iii) why the algorithm is optimal? Consider an optimal clustering Opt. Let c(x) indicates the cluster at which x elongs to in the final clustering of Opt. The four steps for an algorithm with advice are as follows: what is the advice? for each point x, the advice indicates c(x). what is the size of advice? the value of c(x) can e encoded in O(log k). This is ecause there are at most k clusters in the final packing of Opt. So, the total advice size is O(n log k). how the algorithm uses advice? the algorithm places each input point x in cluster c(x) (indicated y advice). why the algorithm is optimal? the algorithm creates the same clustering as Opt. ) The competitive ratio of the est deterministic algorithm that we saw in the class was 8. Consider inputs for which the cost of Opt is a large value. Show that for any such input σ, provided with O(log(Opt(σ))) its of advice, we can achieve a competitive ratio of 2. Here, Opt(σ) is the cost of Opt for σ. To get the full mark, you need to precisely indicate i) what the advice encodes? ii) how the algorithm works? iii) why the algorithm is 2-competitive? Let Opt e an optimal algorithm, and d Opt e the maximum diameter of any cluster in the clustering of Opt, i.e., cost(opt) = d Opt. Here are the four steps for an scheme with advice: what is the advice? the value of d Opt. what is the size of advice? the value of d Opt can e encoded in O(log(d Opt )). So, the size of advice is O(log(d Opt ). how the algorithm uses advice? the algorithm works like the last step of the algorithm we saw in the class. It maintains k clusters and for each cluster considers a center as the first point in the cluster. Now, for any input point x, it works as follows: if x is within distance d Opt from any center c i, place x in the same cluster as c i. otherwise, create a new cluster with center x. We claim that the numer of clusters is no more than k. Consider otherwise; since the pairwise distance of all centres is more than d Opt, there will e at least k + 1 centres with pairwise distance more than d Opt. By the pigeon-hole principle, Opt places at least two of these centres in the same cluster. It means the maximum diameter of a cluster in Opt s clustering is more than d Opt, which is a contradiction. why the algorithm is 2-competitive? the distance of any two points x and y that elong to the same cluster is at most d(x, c) + d(c, y) where c is the center of the cluster. By the definition of the algorithm, d(x, c) d Opt. So, the d(x, y) 2d Opt. This implies the diameter of any cluster is at most 2d Opt. 5
6 Prolem 5 List-Update Algorithms [ = marks] Consider the Move-By-Bit algorithm for the list update prolem. Here, each item has a it associated with it. At the eginning, all its are 0. After an access to an item x, Move-By-Bit moves it to the front if the it of x is 1; otherwise it keeps x at its position. In addition, after each access, the it of the accessed item is flipped. a) Use an adversarial argument to show that competitive ratio of Move-By-Bit is at least 2. You should show the worst-case sequence and indicate the cost of Opt and Move-By-Bit. The adversarial sequence for list a 1 a 2... a m 1 a m will repeat the following sequence: a m, a m, a m 1, a m 1,..., a 1, a 1 The cost of the algorithm for a sequence of length n is n m. The cost of Mtf (or the static offline algorithm we saw in the class) will e nm/2, i.e., the cost of Opt is at most nm/2. Hence, the competitive ratio of Move-To-Front- Every-Other-Access algorithm is at least 2. ) Use a potential function argument to show the competitive ratio of Move-By-Bit is at most 3. You should clearly indicate what your potential function is, what the amortized cost of the algorithm for different scenario is, and provide an uuper ound for the ratio etween the amortized cost of the algorithm and Opt. Define inversions as we did for the analysis of MTF. Consider a pair of items which appear as x y in the list of Move-By-Bit and y x in the list of Opt (hence they form an inversion). Define the weight of the inversion etween x and y as 2 if the it of y is 0 and 1 if the it of y is 1. Define the potential as the total weight of all inversions. Assume there is a request to an item a. As in the analysis of MTF, assume a is at index i of the algorithm and index j of Opt, and assume Opt makes k paid exchanges efore serving a. Note that the cost of Opt is j + k. Any paid exchange of Opt creates at most one inversion and increases the potential y 2. So, the increase in potential ecause of Opt s actions is opt Φ = 2k. For the algorithm, we need to consider two events: Assume Move-y-Bit moves a to the front (it means the it of a was 1 efore the access). In this case, at least i j inversions are removed (all having weight 1 since it of a is 1), and at most j inversions are added (each having a weight of at most 2). So, the difference in potential ecause of the actions of the algorithm is Alg Φ (i j)+2j = i+3j. The amortized cost will e actual cost+delta Alg Φ+ opt Φ (i)+( i+3j)+2k = 3j+2k. Comparing with the cost j + k of Opt, we conclude that amortized cost is at most 3 times the cost of opt. Assume Move-y-Bit does not move a to the front (it means the it of a was 0 efore the access). In this case, the numer of inversions does not change; ut the weight of all inversions including a will decrease from 2 to 1. As efore, the numer of such inversions is at least i j. Hence for the increase of potential for actions of the algorithm we have Alg Φ (i j) = i + j. The amortized cost will e actual cost + Delta Alg Φ + opt Φ (i) + ( i + j) + 2k = j + 2k. Comparing with the cost j + k of Opt, we conclude that amortized cost is at most twice the cost of opt in this case. c (onus) Show that, with 1 it of advice, it is possile to achieve a deterministic list-update algorithm with a competitive ratio of 2. Consider two variants of Move-By-Bit: one starts with all its (for all items) eing 0 while these its are 1 in the other algorithm. We can use the same potential function as part (). But we need to find the sum of the cost of the two algorithms and show the total amortized costs of the two algorithms is at most 4 times that of Opt. This will e followed from the same potential argument in part (). The total amortized cost of the two algorithms is (3j + 2k) + (j + 2k) = 4j + 4k, which is 4 times cost j + k of Opt. Hence, the total cost of oth algorithms is 4 times that of Opt. This means that the etter of them has a competitive ratio of 2. 6
7 Prolem 6 List Update Algorithms [ = marks] In this prolem, we consider a variant of the list update prolem where no free exchange is allowed, i.e., after each access the algorithm can adjust the list only using paid exchanges. Note that algorithms like Move-To-Front are still well-defined ut they need to simulate their free-exchanges with paid-exchanges, for example, Move-To-Front moves a requested item to the front using a sequence of paid-exchanges instead of a single free-exchange. a) Show that the competitive ratio of Move-To-Front is exactly 4. We need to figure out how the competitive ratio of MTF and Opt change in the new model. For MTF, after accessing an item at index i, the algorithm has to make i 1 paid-exchanges to move the item to the front. So, if the cost of MTf was X under standard model, it ecomes 2X n under the new model. On the other hand, the cost of Opt does not change at all (recall that there is an optimal algorithm which does not use free exchanges; such algorithm has the same cost under the new model). For the upper ound, we have cost new model(mt F ) cost new model (Opt) 2 cost standard model(mt F ) cost standard model (Opt) 2cost standard model(mt F ) n cost standard model (Opt) = 2. The last equation comes from the analysis of MTF under standard model. For the lower ound, consider the same adversarial sequence we saw in the class for standard model (keep asking for the last item in the list of MTF). For a list of length m, the access cost for each request will e m and moving to front adds another cost of m 1, summing up to 2m 1. The total cost for n requests will e 2mn n. The cost of opt, is at most equal to the cost of an static offline algorithm, that is, n(m/2). The competitive ratio of MTF will e at least 2mn n nm/2 = 4mn 2n mn = 4 2/m. This ratio approaches to 4 for large values of m. ) Show that any online algorithm A for this model has a competitive ratio of at least 3. For that, consider an offline algorithm OFF which maintains a list that is reverse of that of A. For example, if the list of A is a c d, then the list of OFF is d c a. If A uses k paid exchanges to update its list, OFF can also use k paid exchanges to maintain a list reverse of A. To answer the question, use OFF and optimal static algorithms to find an upper ound for the cost of Opt. Consider an adversarial sequence of length n in which we keep asking for the last item in the list. Let m denote the length of the list. The cost of A is n m + X; here n m indicates the total accessing cost and let X denotes the numer of paid exchanges that X makes. We consider two possiilities for X and show that the competitive ratio of A is at least 3 in oth cases. Assume X nm/2. Hence, we have cost(a) nṁ + nṁ/2 = 3nm/2. Note that an static offline algorithm has a cost of nm/2 + O(m 2 ). So, the cost of Opt is at most nm/2 + O(m 2 ), and the competitive ratio of A will e 3nm/2 at least nm/2+o(m 2 ) = 3 O(m 2 ) nm/2+o(m 2 ), which approaches to 3 when n is sustantially larger than m. Assume X nm/2. Then the offline algorithm that maintains the reverse list has a total access cost of n and paid-exchange cost of X which sums to n + X = nm/2 + n. Hence, the cost of Opt is at most nm/2 + n, and 3nm/2 the competitive ratio of A will e at least nm/2+n = 3 n nm/2+n, which approaches to 3 when m is sufficiently large. c (onus) Provide an algorithm which has a competitive ratio etter than 4 (this is an open research question.) Let me know if you know the answer :) 7
Comp Online Algorithms
Comp 7720 - Online Algorithms Assignment 2: Compression, Splay Trees, Caching, and k-server Shahin Kamalli University of Manitoba - Fall 2018 Due: Monday, October 22th at 11:59 pm October 27, 2018 [Computer
More informationCOMP Online Algorithms. k-server Problem & Advice. Shahin Kamali. Lecture 13 - Oct. 24, 2017 University of Manitoba
COMP 7720 - Online Algorithms k-server Problem & Advice Shahin Kamali Lecture 13 - Oct. 24, 2017 University of Manitoba COMP 7720 - Online Algorithms k-server Problem & Advice 1 / 20 Review & Plan COMP
More informationDepartment of Mathematics and Computer Science University of Southern Denmark, Odense. Exercises for Week 47 on. Online Algorithms
Department of Mathematics and Computer Science University of Southern Denmark, Odense November 7, 06 KSL Exercises for Week 7 on Online Algorithms a topic in DM5 Introduction to Computer Science Kim Skak
More informationComp Online Algorithms
Comp 7720 - Online Algorithms Notes 4: Bin Packing Shahin Kamalli University of Manitoba - Fall 208 December, 208 Introduction Bin packing is one of the fundamental problems in theory of computer science.
More informationCOMP Online Algorithms. Online Bin Packing. Shahin Kamali. Lecture 20 - Nov. 16th, 2017 University of Manitoba
COMP 7720 - Online Algorithms Online Bin Packing Shahin Kamali Lecture 20 - Nov. 16th, 2017 University of Manitoba COMP 7720 - Online Algorithms Online Bin Packing 1 / 24 Review & Plan COMP 7720 - Online
More informationCOMP Online Algorithms. List Update with Advice & Bin Packing. Shahin Kamali. Lecture 14 - Oct. 23, 2018 University of Manitoba
COMP 7720 - Online Algorithms List Update with Advice & Bin Packing Shahin Kamali Lecture 14 - Oct. 23, 2018 University of Manitoba COMP 7720 - Online Algorithms List Update with Advice & Bin Packing 1
More informationCOMP Analysis of Algorithms & Data Structures
COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Approximation Algorithms CLRS 35.1-35.5 University of Manitoba COMP 3170 - Analysis of Algorithms & Data Structures 1 / 30 Approaching
More informationprinceton univ. F 17 cos 521: Advanced Algorithm Design Lecture 24: Online Algorithms
princeton univ. F 17 cos 521: Advanced Algorithm Design Lecture 24: Online Algorithms Lecturer: Matt Weinberg Scribe:Matt Weinberg Lecture notes sourced from Avrim Blum s lecture notes here: http://www.cs.cmu.edu/
More informationCSE Discrete Structures
CSE 2315 - Discrete Structures Homework 3- Solution - Fall 2010 Due Date: Oct. 28 2010, 3:30 pm Sets 1. Rewrite the following sets as a list of elements. (8 points) a) {x ( y)(y N x = y 3 x < 30)} {0,
More informationOnline Algorithms. - Lecture 4 -
Online Algorithms - Lecture 4 - Outline Quick recap.. The Cashing Problem Randomization in Online Algorithms Other views to Online Algorithms The Ski-rental problem The Parking Permit Problem 2 The Caching
More informationEfficient Online Strategies for Renting Servers in the Cloud. Shahin Kamali, Alejandro López-Ortiz. University of Waterloo, Canada.
Efficient Online Strategies for Renting Servers in the Cloud Shahin Kamali, Alejandro López-Ortiz University of Waterloo, Canada. arxiv:408.456v [cs.ds] 8 Aug 04 Abstract. In Cloud systems, we often deal
More informationOnline Algorithms. Lecture Notes for CSCI 570 by David Kempe December 1, 2006
Online Algorithms Lecture Notes for CSCI 570 by David Kempe December 1, 2006 So far in class, we have only considered the traditional framework for algorithm design, as follows: we are given an input I,
More informationIntroduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14
600.363 Introduction to Algorithms / 600.463 Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14 23.1 Introduction We spent last week proving that for certain problems,
More informationTreaps. 1 Binary Search Trees (BSTs) CSE341T/CSE549T 11/05/2014. Lecture 19
CSE34T/CSE549T /05/04 Lecture 9 Treaps Binary Search Trees (BSTs) Search trees are tree-based data structures that can be used to store and search for items that satisfy a total order. There are many types
More informationLecture 8 Sept 25, 2014
CS 224: Advanced Algorithms Fall 2014 Prof. Jelani Nelson Lecture 8 Sept 25, 2014 Scribe: Jean Pouget-Abadie 1 Online Algorithms - Overview In this lecture, we are going to cover Online algorithms which
More informationA Guide to Deterministic and Randomized Online Algorithms for the List Access Problem
MT F, BIT, and COMB: A Guide to Deterministic and Randomized Online Algorithms for the List Access Problem Kevin Andrew kandrew@cs.hmc.edu David Gleich dgleich@cs.hmc.edu April 30, 2004 Abstract In this
More informationAlgorithms Exam TIN093/DIT600
Algorithms Exam TIN093/DIT600 Course: Algorithms Course code: TIN 093 (CTH), DIT 600 (GU) Date, time: 22nd October 2016, 14:00 18:00 Building: M Responsible teacher: Peter Damaschke, Tel. 5405 Examiner:
More informationOn the Max Coloring Problem
On the Max Coloring Problem Leah Epstein Asaf Levin May 22, 2010 Abstract We consider max coloring on hereditary graph classes. The problem is defined as follows. Given a graph G = (V, E) and positive
More information/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18
601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 22.1 Introduction We spent the last two lectures proving that for certain problems, we can
More informationCS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem
CS61: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem Tim Roughgarden February 5, 016 1 The Traveling Salesman Problem (TSP) In this lecture we study a famous computational problem,
More informationSelf Adjusting Data Structures
Self Adjusting Data Structures Pedro Ribeiro DCC/FCUP 2014/2015 Pedro Ribeiro (DCC/FCUP) Self Adjusting Data Structures 2014/2015 1 / 31 What are self adjusting data structures? Data structures that can
More informationCMPSCI611: Approximating SET-COVER Lecture 21
CMPSCI611: Approximating SET-COVER Lecture 21 Today we look at two more examples of approximation algorithms for NP-hard optimization problems. The first, for the SET-COVER problem, has an approximation
More informationOnline Algorithms with Advice
Online Algorithms with Advice Marc Renault Supervisor: Adi Rosén, Algorithms and Complexity LRI August 21, 2010 This report is written in English as the maternal language of Marc Renault is English and
More informationAlgorithmen II. Peter Sanders, Christian Schulz, Simon Gog. Übungen: Michael Axtmann. Institut für Theoretische Informatik, Algorithmik II.
Schulz, Gog, Sanders: Algorithmen II - 31. Januar 2017 Algorithmen II Peter Sanders, Christian Schulz, Simon Gog Übungen: Michael Axtmann Institut für Theoretische Informatik, Algorithmik II Web: http://algo2.iti.kit.edu/algorithmenii_ws16.php
More informationProblem set 2. Problem 1. Problem 2. Problem 3. CS261, Winter Instructor: Ashish Goel.
CS261, Winter 2017. Instructor: Ashish Goel. Problem set 2 Electronic submission to Gradescope due 11:59pm Thursday 2/16. Form a group of 2-3 students that is, submit one homework with all of your names.
More informationCS261: Problem Set #1
CS261: Problem Set #1 Due by 11:59 PM on Tuesday, April 21, 2015 Instructions: (1) Form a group of 1-3 students. You should turn in only one write-up for your entire group. (2) Turn in your solutions by
More informationCOMP Online Algorithms. Online Graph Problems. Shahin Kamali. Lecture 23 - Nov. 28th, 2017 University of Manitoba
COMP 7720 - Online Algorithms Online Graph Problems Shahin Kamali Lecture 23 - Nov. 28th, 2017 University of Manitoba COMP 7720 - Online Algorithms Online Graph Problems 1 / 13 Review & Plan COMP 7720
More informationOn Rainbow Cycles in Edge Colored Complete Graphs. S. Akbari, O. Etesami, H. Mahini, M. Mahmoody. Abstract
On Rainbow Cycles in Edge Colored Complete Graphs S. Akbari, O. Etesami, H. Mahini, M. Mahmoody Abstract In this paper we consider optimal edge colored complete graphs. We show that in any optimal edge
More informationCME 305: Discrete Mathematics and Algorithms Instructor: Reza Zadeh HW#3 Due at the beginning of class Thursday 02/26/15
CME 305: Discrete Mathematics and Algorithms Instructor: Reza Zadeh (rezab@stanford.edu) HW#3 Due at the beginning of class Thursday 02/26/15 1. Consider a model of a nonbipartite undirected graph in which
More informationThe Probabilistic Method
The Probabilistic Method Po-Shen Loh June 2010 1 Warm-up 1. (Russia 1996/4 In the Duma there are 1600 delegates, who have formed 16000 committees of 80 persons each. Prove that one can find two committees
More informationSEARCHING, SORTING, AND ASYMPTOTIC COMPLEXITY
1 A3 and Prelim 2 SEARCHING, SORTING, AND ASYMPTOTIC COMPLEXITY Lecture 11 CS2110 Fall 2016 Deadline for A3: tonight. Only two late days allowed (Wed-Thur) Prelim: Thursday evening. 74 conflicts! If you
More informationProblem Set 4 Solutions
Design and Analysis of Algorithms March 5, 205 Massachusetts Institute of Technology 6.046J/8.40J Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Problem Set 4 Solutions Problem Set 4 Solutions This
More informationALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007
ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007 This examination is a three hour exam. All questions carry the same weight. Answer all of the following six questions.
More information/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/27/17
01.433/33 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/2/1.1 Introduction In this lecture we ll talk about a useful abstraction, priority queues, which are
More information1 Leaffix Scan, Rootfix Scan, Tree Size, and Depth
Lecture 17 Graph Contraction I: Tree Contraction Parallel and Sequential Data Structures and Algorithms, 15-210 (Spring 2012) Lectured by Kanat Tangwongsan March 20, 2012 In this lecture, we will explore
More informationAVL Trees. Version of September 6, AVL Trees Version of September 6, / 22
VL Trees Version of September 6, 6 VL Trees Version of September 6, 6 / inary Search Trees x 8 4 4 < x > x 7 9 3 inary-search-tree property For every node x ll eys in its left subtree are smaller than
More informationMC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points
MC 0 GRAPH THEORY 0// Solutions to HW # 0 points + XC points ) [CH] p.,..7. This problem introduces an important class of graphs called the hypercubes or k-cubes, Q, Q, Q, etc. I suggest that before you
More informationBalanced Trees Part Two
Balanced Trees Part Two Outline for Today Recap from Last Time Review of B-trees, 2-3-4 trees, and red/black trees. Order Statistic Trees BSTs with indexing. Augmented Binary Search Trees Building new
More informationAssignment 5: Solutions
Algorithm Design Techniques Assignment 5: Solutions () Port Authority. [This problem is more commonly called the Bin Packing Problem.] (a) Suppose K = 3 and (w, w, w 3, w 4 ) = (,,, ). The optimal solution
More informationNotes for Recitation 9
6.042/18.062J Mathematics for Computer Science October 8, 2010 Tom Leighton and Marten van Dijk Notes for Recitation 9 1 Traveling Salesperson Problem Now we re going to talk about a famous optimization
More informationPrimality Testing. Public-Key Cryptography needs large prime numbers How can you tell if p is prime? Try dividing p by all smaller integers
Primality Testing Public-Key Cryptography needs large prime numbers How can you tell if p is prime? Try dividing p by all smaller integers Exponential in p (number of bits to represent p) Improvement:
More informationCS 157 Design and Analysis of Algorithms Valiant. Homework 3
CS 157 Design and Analysis of Algorithms Valiant Homework 3 Due: Oct. 3, 2017 at 6:00 pm (early) Oct. 6, 2017 at 6:00 pm (on time) Oct. 8, 2017 at 6:00 pm (late) This is a partner homework as usual: work
More informationArray Dependence Analysis as Integer Constraints. Array Dependence Analysis Example. Array Dependence Analysis as Integer Constraints, cont
Theory of Integers CS389L: Automated Logical Reasoning Omega Test Işıl Dillig Earlier, we talked aout the theory of integers T Z Signature of T Z : Σ Z : {..., 2, 1, 0, 1, 2,..., 3, 2, 2, 3,..., +,, =,
More informationOnline Algorithms. Lecture 11
Online Algorithms Lecture 11 Today DC on trees DC on arbitrary metrics DC on circle Scheduling K-server on trees Theorem The DC Algorithm is k-competitive for the k server problem on arbitrary tree metrics.
More informationSolution to Graded Problem Set 4
Graph Theory Applications EPFL, Spring 2014 Solution to Graded Problem Set 4 Date: 13.03.2014 Due by 18:00 20.03.2014 Problem 1. Let V be the set of vertices, x be the number of leaves in the tree and
More informationVLSI Logic Test, Validation and Verification Lecture 7 Properties & Applications of Binary Decision Diagrams
VLSI Logic Test, Validation and Verification Lecture 7 Properties & Applications of Binary Decision Diagrams 1 Instructor: Priyank Kalla Department of Electrical and Computer Engineering University of
More informationGraph Theory Questions from Past Papers
Graph Theory Questions from Past Papers Bilkent University, Laurence Barker, 19 October 2017 Do not forget to justify your answers in terms which could be understood by people who know the background theory
More informationHot X: Algebra Exposed
Hot X: Algera Exposed Solution Guide for Chapter 5 Here are the solutions for the Doing the Math exercises in Hot X: Algera Exposed! (assume that all denominators 0) DTM from p.59 2. Since they have the
More informationCS 188: Artificial Intelligence Fall Search Gone Wrong?
CS 188: Artificial Intelligence Fall 2009 Lecture 3: A* Search 9/3/2009 Pieter Aeel UC Berkeley Many slides from Dan Klein Search Gone Wrong? 1 Announcements Assignments: Project 0 (Python tutorial): due
More informationCS264: Homework #4. Due by midnight on Wednesday, October 22, 2014
CS264: Homework #4 Due by midnight on Wednesday, October 22, 2014 Instructions: (1) Form a group of 1-3 students. You should turn in only one write-up for your entire group. (2) Turn in your solutions
More informationTheory of Integers. CS389L: Automated Logical Reasoning. Lecture 13: The Omega Test. Overview of Techniques. Geometric Description
Theory of ntegers This lecture: Decision procedure for qff theory of integers CS389L: Automated Logical Reasoning Lecture 13: The Omega Test şıl Dillig As in previous two lectures, we ll consider T Z formulas
More informationPACKING DIGRAPHS WITH DIRECTED CLOSED TRAILS
PACKING DIGRAPHS WITH DIRECTED CLOSED TRAILS PAUL BALISTER Abstract It has been shown [Balister, 2001] that if n is odd and m 1,, m t are integers with m i 3 and t i=1 m i = E(K n) then K n can be decomposed
More informationAlgorithm 23 works. Instead of a spanning tree, one can use routing.
Chapter 5 Shared Objects 5.1 Introduction Assume that there is a common resource (e.g. a common variable or data structure), which different nodes in a network need to access from time to time. If the
More informationApproximation Algorithms for Item Pricing
Approximation Algorithms for Item Pricing Maria-Florina Balcan July 2005 CMU-CS-05-176 Avrim Blum School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 School of Computer Science,
More informationarxiv: v2 [math.co] 13 Aug 2013
Orthogonality and minimality in the homology of locally finite graphs Reinhard Diestel Julian Pott arxiv:1307.0728v2 [math.co] 13 Aug 2013 August 14, 2013 Abstract Given a finite set E, a subset D E (viewed
More informationAdvanced Algorithms. On-line Algorithms
Advanced Algorithms On-line Algorithms 1 Introduction Online Algorithms are algorithms that need to make decisions without full knowledge of the input. They have full knowledge of the past but no (or partial)
More informationTheorem 2.9: nearest addition algorithm
There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used
More informationThe k-server problem June 27, 2005
Sanders/van Stee: Approximations- und Online-Algorithmen 1 The k-server problem June 27, 2005 Problem definition Examples An offline algorithm A lower bound and the k-server conjecture The greedy algorithm
More informationTwo Kinds of Golden Triangles, Generalized to Match Continued Fractions
Journal for Geometry and Graphics Volume (2007), No. 2, 65 7. Two Kinds of Golden Triangles, Generalized to Match Continued Fractions Clark Kimerling Department of Mathematics, University of Evansville
More informationModule 5 Graph Algorithms
Module 5 Graph lgorithms Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 97 E-mail: natarajan.meghanathan@jsums.edu 5. Graph Traversal lgorithms Depth First
More informationLectures 8/9. 1 Overview. 2 Prelude:Routing on the Grid. 3 A couple of networks.
U.C. Berkeley CS273: Parallel and Distributed Theory Lectures 8/9 Professor Satish Rao September 23,2010 Lecturer: Satish Rao Last revised October 23, 2010 Lectures 8/9 1 Overview We will give a couple
More information/06/$20.00 c 2006 IEEE I. INTRODUCTION
Scalale Router Memory Architecture Based on Interleaved DRAM Feng Wang and Mounir Hamdi Computer Science Department of The Hong Kong University of Science and Technology {fwang, hamdi}@cs.ust.hk Astract
More informationOptimization I : Brute force and Greedy strategy
Chapter 3 Optimization I : Brute force and Greedy strategy A generic definition of an optimization problem involves a set of constraints that defines a subset in some underlying space (like the Euclidean
More information1 Unweighted Set Cover
Comp 60: Advanced Algorithms Tufts University, Spring 018 Prof. Lenore Cowen Scribe: Yuelin Liu Lecture 7: Approximation Algorithms: Set Cover and Max Cut 1 Unweighted Set Cover 1.1 Formulations There
More informationMa/CS 6b Class 2: Matchings
Ma/CS 6b Class 2: Matchings By Adam Sheffer Send anonymous suggestions and complaints from here. Email: adamcandobetter@gmail.com Password: anonymous2 There aren t enough crocodiles in the presentations
More informationPCP and Hardness of Approximation
PCP and Hardness of Approximation January 30, 2009 Our goal herein is to define and prove basic concepts regarding hardness of approximation. We will state but obviously not prove a PCP theorem as a starting
More informationUniversity of Toronto Department of Mathematics
University of Toronto Department of Mathematics MAT332H1F, Graph Theory Midterm, October 21, 2014 Instructor: Kasra Rafi First Last Student Number Instructions: No aids allowed. Write solutions on the
More informationPedestrian Detection Using Structured SVM
Pedestrian Detection Using Structured SVM Wonhui Kim Stanford University Department of Electrical Engineering wonhui@stanford.edu Seungmin Lee Stanford University Department of Electrical Engineering smlee729@stanford.edu.
More informationAnswers to specimen paper questions. Most of the answers below go into rather more detail than is really needed. Please let me know of any mistakes.
Answers to specimen paper questions Most of the answers below go into rather more detail than is really needed. Please let me know of any mistakes. Question 1. (a) The degree of a vertex x is the number
More informationMa/CS 6b Class 26: Art Galleries and Politicians
Ma/CS 6b Class 26: Art Galleries and Politicians By Adam Sheffer The Art Gallery Problem Problem. We wish to place security cameras at a gallery, such that they cover it completely. Every camera can cover
More informationLecture Overview. 2 Online Algorithms. 2.1 Ski rental problem (rent-or-buy) COMPSCI 532: Design and Analysis of Algorithms November 4, 2015
COMPSCI 532: Design and Analysis of Algorithms November 4, 215 Lecturer: Debmalya Panigrahi Lecture 19 Scribe: Allen Xiao 1 Overview In this lecture, we motivate online algorithms and introduce some of
More informationHeadset Research Report:
Headset Research Report: The Advantages of Moving to Wireless Research Suject: Brother International Technical Support Centers y Headset Research Report: The Advantages of Moving to Wireless Research Suject:
More informationCME 305: Discrete Mathematics and Algorithms Instructor: Reza Zadeh HW#3 Due at the beginning of class Thursday 03/02/17
CME 305: Discrete Mathematics and Algorithms Instructor: Reza Zadeh (rezab@stanford.edu) HW#3 Due at the beginning of class Thursday 03/02/17 1. Consider a model of a nonbipartite undirected graph in which
More informationLecture 1: An Introduction to Online Algorithms
Algoritmos e Incerteza (PUC-Rio INF979, 017.1) Lecture 1: An Introduction to Online Algorithms Mar 1, 017 Lecturer: Marco Molinaro Scribe: Joao Pedro T. Brandao Online algorithms differ from traditional
More informationBinary Decision Diagrams (BDDs) Pingqiang Zhou ShanghaiTech University
Binary Decision Diagrams (BDDs) Pingqiang Zhou ShanghaiTech University Computational Boolean Algera Representations Applying unate recursive paradigm (URP) in solving tautology is a great warm up example.
More information2010 SMT Power Round
Definitions 2010 SMT Power Round A graph is a collection of points (vertices) connected by line segments (edges). In this test, all graphs will be simple any two vertices will be connected by at most one
More informationMATH30300: Group Theory Homework 5: Solutions
MATH33: Group Theory Homework 5: Solutions 1 Express each of the following permutations as a product of disjoint cycles: (a) The permutation σ S 8 given y σ(1) 5, σ(2) 3, σ(3) 7, σ(4) 1 σ(5) 8, σ(6) 2,
More informationDiscrete Mathematics and Probability Theory Fall 2013 Midterm #2
CS 70 Discrete Mathematics and Probability Theory Fall 013 Midterm # 1. (30 points) Short Answer. No justification necessary. Please write only the answer in the space provided after each question. Please
More informationFall 09, Homework 5
5-38 Fall 09, Homework 5 Due: Wednesday, November 8th, beginning of the class You can work in a group of up to two people. This group does not need to be the same group as for the other homeworks. You
More informationTree Based Symmetric Key Broadcast Encryption
Tree Based Symmetric Key Broadcast Encryption Sanjay Bhattacherjee and Palash Sarkar Applied Statistics Unit Indian Statistical Institute 203, B.T.Road, Kolkata, India - 700108. {sanjay r,palash}@isical.ac.in
More informationExact Algorithms Lecture 7: FPT Hardness and the ETH
Exact Algorithms Lecture 7: FPT Hardness and the ETH February 12, 2016 Lecturer: Michael Lampis 1 Reminder: FPT algorithms Definition 1. A parameterized problem is a function from (χ, k) {0, 1} N to {0,
More informationCS261: Problem Set #2
CS261: Problem Set #2 Due by 11:59 PM on Tuesday, February 9, 2016 Instructions: (1) Form a group of 1-3 students. You should turn in only one write-up for your entire group. (2) Submission instructions:
More informationGraphs connected with block ciphers
Graphs connected with block ciphers OTOKAR GROŠEK Slovak University of Technology Department of Applied Informatics Ilkovičova 3 812 19 Bratislava SLOVAKIA PAVOL ZAJAC Slovak University of Technology Department
More informationLecture 19. Lecturer: Aleksander Mądry Scribes: Chidambaram Annamalai and Carsten Moldenhauer
CS-621 Theory Gems November 21, 2012 Lecture 19 Lecturer: Aleksander Mądry Scribes: Chidambaram Annamalai and Carsten Moldenhauer 1 Introduction We continue our exploration of streaming algorithms. First,
More informationCS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5
CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5 This fifth problem set explores the regular languages, their properties, and their limits. This will be your first foray into computability theory,
More informationBatch Coloring of Graphs
Batch Coloring of Graphs Joan Boyar 1, Leah Epstein 2, Lene M. Favrholdt 1, Kim S. Larsen 1, and Asaf Levin 3 1 Dept. of Mathematics and Computer Science, University of Southern Denmark, Odense, Denmark,
More information1 Algorithm and Proof for Minimum Vertex Coloring
Solutions to Homework 7, CS 173A (Fall 2018) Homework 7 asked you to show that the construction problems Maximum Independent Set, Minimum Vertex Coloring, and Maximum Clique could all be solved in polynomial
More informationFinnish National High School Mathematics Competition
Finnish National High School Mathematics Competition Final Rounds 997 008 The Finnish National High School Mathematics Competition is organized by MAOL, the The Finnish Association of Teachers of Mathematics,
More informationApproximation Algorithms: The Primal-Dual Method. My T. Thai
Approximation Algorithms: The Primal-Dual Method My T. Thai 1 Overview of the Primal-Dual Method Consider the following primal program, called P: min st n c j x j j=1 n a ij x j b i j=1 x j 0 Then the
More informationELEMENTARY NUMBER THEORY AND METHODS OF PROOF
CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF Copyright Cengage Learning. All rights reserved. SECTION 4.2 Direct Proof and Counterexample II: Rational Numbers Copyright Cengage Learning. All
More information15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015
15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015 While we have good algorithms for many optimization problems, the previous lecture showed that many
More informationMaximal Independent Set
Chapter 0 Maximal Independent Set In this chapter we present a highlight of this course, a fast maximal independent set (MIS) algorithm. The algorithm is the first randomized algorithm that we study in
More informationHW Graph Theory SOLUTIONS (hbovik)
Diestel 1.3: Let G be a graph containing a cycle C, and assume that G contains a path P of length at least k between two vertices of C. Show that G contains a cycle of length at least k. If C has length
More informationCOMP3121/3821/9101/ s1 Assignment 1
Sample solutions to assignment 1 1. (a) Describe an O(n log n) algorithm (in the sense of the worst case performance) that, given an array S of n integers and another integer x, determines whether or not
More informationPrelim 1. CS 2110, 14 March 2017, 7:30 PM Total Question Name Short answer. OO Recursion Loop invariants Max Score Grader
Prelim 1 CS 2110, 14 March 2017, 7:30 PM 1 2 3 4 5 Total Question Name Short answer OO Recursion Loop invariants Max 1 36 33 15 15 100 Score Grader The exam is closed ook and closed notes. Do not egin
More information1 Linear programming relaxation
Cornell University, Fall 2010 CS 6820: Algorithms Lecture notes: Primal-dual min-cost bipartite matching August 27 30 1 Linear programming relaxation Recall that in the bipartite minimum-cost perfect matching
More informationCHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism
CHAPTER 2 Graphs 1. Introduction to Graphs and Graph Isomorphism 1.1. The Graph Menagerie. Definition 1.1.1. A simple graph G = (V, E) consists of a set V of vertices and a set E of edges, represented
More informationDirect Variations DIRECT AND INVERSE VARIATIONS 19. Name
DIRECT AND INVERSE VARIATIONS 19 Direct Variations Name Of the many relationships that two variables can have, one category is called a direct variation. Use the description and example of direct variation
More informationarxiv: v2 [cs.ds] 9 Apr 2009
Pairing Heaps with Costless Meld arxiv:09034130v2 [csds] 9 Apr 2009 Amr Elmasry Max-Planck Institut für Informatik Saarbrücken, Germany elmasry@mpi-infmpgde Abstract Improving the structure and analysis
More informationARC 088/ABC 083. A: Libra. DEGwer 2017/12/23. #include <s t d i o. h> i n t main ( )
ARC 088/ABC 083 DEGwer 2017/12/23 A: Libra A, B, C, D A + B C + D #include i n t main ( ) i n t a, b, c, d ; s c a n f ( %d%d%d%d, &a, &b, &c, &d ) ; i f ( a + b > c + d ) p r i n t f (
More information