# Solutions to Homework 6

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Solutions to Homework 6 Debasish Das EECS Department, Northwestern University 1 Problem 5.24 We want to find light spanning trees with certain special properties. Given is one example of light spanning tree. Input: Undirected graph G = (V,E); edge weights w e ; subset of vertices U V Output: The lightest spanning tree in which the nodes of U are leaves (there might be other leaves in this tree as well) Consider the minimum spanning tree T = (V,Ê) of G and the leaves of the tree T as L(T). Three possible situations are feasible U L(T ) U = U 1 U 2 where U1 L(T ) U 2 V L(T ) Note that when U satisfies Equation 1, the algorithm we are seeking is same as Kruskal s algorithm. Define a graph G=(V U,(u, v) : u, v V U (u, v) E}). Lemma 1 If there is no minimum spanning tree of the graph G, then lightest spanning tree with U vertices as leaves is not feasible Proof: Consider that no spanning tree for the graph G exists. Without any loss of generality assume that there are two trees in the spanning tree forest for the graph G. The lightest spanning tree of G must be a tree. Therefore some node u U must connect the two tress in the spanning tree forest of the graph G. But then u is no longer a leaf node which is a contradiction. Property 1 Minimum spanning tree obtained on the graph G is the lightest spanning tree if we greedily select and add edges such that all vertices U are leaves Proof: The minimum spanning tree T is well defined on the graph G. Consider each node u U. We greedily select an edge (u, v) : v T and add the edge (u, v) to T. Note that the edge (u, v) we greedily chose, v T. If v / T then v U. But we cannot choose such an edge because to form a spanning tree either of u or v must be connected to T but connecting one of them (suppose u) to T will no longer keep u as leaf. Cost of the new tree is cost( T ) + w (u,v). Since cost( T ) is optimal and we cannot select any edge other than (u, v) (because of the constraint on U vertices as leaves), cost of the new tree is lightest (cannot be decreased any further). Based on Lemma 1 and Property 1 we present the following algorithm procedure lightest-spanning-tree(g,w,u) Input: Graph G = (V,E); edges weights w e ; U V Output: Lightest spanning tree if exists Construct graph G = (Ṽ, Ẽ): 1

2 Ṽ = V U Ẽ = (u, v) : u, v V U (u, v) E} Apply Kruskal to get MST( G) = T : if T does not exist: lightest spanning tree infeasibile Construct edge set Ē: (u, v) Ē : u U v / U for each u U: makeset(u) sort the edges Ē by w e for all edges u,v E, in increasing order of weight: if find(u) find(v): add edge u,v to T union(u,v) return T Complexity analysis: Other than construction of edge set Ē, rest of the complexity analysis is analogous to Kruskal s algorithm which runs in O( E log V ) time. We construct a set U. For each edge e = (u, v) if find(u) find(v) then we keep that edge in Ē. Therefore this takes O( E log U ) time. Hence total complexity of the algorithm is still bounded by O( E log V ). 2 Problem 5.32 A server has n customers waiting to be served. For each customer i the service time required is t i. The cost function for this problem is given by n T = (time spent waiting by customer i) (1) i=1 Let the time spent waiting by customer i be w i. Then cost T = n i=1 (w i). w i can be defined recursively as w i = w i 1 + t i 1. Following the recurrence i 1 w i = w 1 + t j (2) Without any loss of generality weight time of customer 1 can be considered 0. Therefore w i = i 1 j=1 t j. The total cost can be summarized as n i 1 T = t j (3) Equation 3 can be rewritten as T = j=1 i=2 j=1 n f i t i (4) i=1 where f i denotes number of times (frequency) t i appears in cost function T. If we look at Equation 3 t i has a frequency of (n-i). Frequency of t 1 is n 1. Lemma 2 To minimize the cost we choose t 1 as the minimum service time. Proof: Assume that t 1 is the minimum service time. For some other t i, t i > t 1. Our claim is that choosing t i in place of t 1 can only increase the cost function. Note that only two terms of cost function will change. Previously cost T old = (n 1)t 1 + (n i)t i. With the proposed change new cost T new = (n 1)t i + (n i)t 1. But T new > T old and so t 1 must be minimum service time. Now as we can see at each step i if we choose t i to be the i-th minimum service time our problem reduces to subproblems of smaller size. Based on our discussion the greedy algorithm is as follows 2

3 procedure optimal-ordering(n,t) Input: Number of customers N;Set of service time t i : i (1,..., N) T Output: Optimal ordering of processing customers Sort the set T: increasing order of t i return T 3 Problem 6.3 Yuckdonald s is considering opening a series of restaurant along QVH. n possible locations are along a straight line and the distances of these locations from the start of QVH are in miles and in increasing order m 1, m 2,..., m n. The constraints are as follows: 1. At each location, Yuckdonald may open one restaurant and expected profit from opening a restaurant at location i is given as p i 2. Any two restaurants should be at least k miles apart, where k is a positive integer We use a dynamic programming formulation to solve this problem. We define P [i] as follows Definition 1 P [i] is defined as the maximum expected profit at location i Based on the constraints we have, we come up with the following recursive definition of P [i] maxj<i P [j] + α(m P [i] = max i, m j ) p i } The function α is defined as follows p i α(m i, m j ) = 0 if mi m j < k 1 if m i m j k Maximum expected profit of location i comes from the maximum of expected profits of location j and whether we can open a location at location i. The profit from opening a restaurant at location i is p i. Note that P[j] shows the maximum expected profit at location j. There may or may not be a restaurant at location j. Those cases when there is no restaurant at location j will be considered by case k where k < j. It is also likely that profit at location i, p i is higher than the P [j] + α(m i, m j ) p i. In those cases we need to do a comparison with p i as well. Based on the recursion the algorithm writes itself procedure expected-profit(n,p) Input: N locations; P[1,..,N] where P[i] denotes profit at location i Output: Maximum expected profit P max Declare an array of maximum Expected profit Profit[1..N]: Profit[i] denotes maximum expected profit at location i for i = 1 to N: Profit[i] = 0 for i = 2 to N for j = 1 to i-1 temp = Profit[j] + α(m i, m j ) P[i] if temp > Profit[i]: temp = Profit[i] if Profit[i] < P[i]: Profit[i] = P[i] Complexity analysis : There are two for loops which gives a O(n 2 ) complexity to this algorithm. 3

4 4 Problem 6.7 A subsequence is palindromic if it is the same whether read left to right or right to left. We have to devise an algorithm that takes a sequence x[1,...,n] and returns the length of the longest palindromic subsequence. We give the following definition of a palindrome Definition 2 Sequence x is called a palindrome if we form a sequence x by reversing the sequence x then x = x This definition allows us to formulate an optimal substructure for the problem. If we look at the sub-string x[i,..,j] of the string x, then we can find a palindrome of length at least 2 if x[i] = x[j]. If they are not same then we seek the maximum length palindrome in subsequences x[i+1,...,j] and x[i,...,j-1]. Also every character x[i] is a palindrome in itself of length 1. Therefore base cases are given by x[i,i] = 1. Let us define the maximum length palindrome for the substing x[i,...,j] as L(i,j) L(i + 1, j 1) + 2 if x[i] = x[j] L(i, j) = maxl(i + 1, j), L(i, j 1)} otherwise L(i, i) = 1 i (1,..., n) Based on the recursive definition we present the following algorithm procedure palindromic-subsequence(x[1,...,n]) Input: Sequence x[1,...,n] Output: Length of the longest palindromic subsequence Declare a 2 dimensional array L: L[i,j] stores the length of longest palindromic subsequence in x[i,...,j] for i = 1 to n: L[i,i] = 1 (Each character is a palindrome of length 1) for i = 1 to n: for s = 1 to n-i: j = s+i L[s,j] = compute-cost(l,x,s,j) L[j,s] = compute-cost(l,x,j,s) return L[1,n] The procedure compute-cost is an implementation of recursive formulation shown above. include details not mentioned in the recursive formulation Note that we procedure compute-cost(l,x,i,j) Input: Array L from procedure palindromic-subsequence; Sequence x[1,...,n] i and j are indices Output: Cost of L[i,j] if i = j: return L[i,j] else if x[i] = x[j]: if i+1 < j-1: return L[i+1,j-1] + 2 else: return 2 else: return max(l[i+1,j],l[i,j-1]) Complexity analysis: First for loop takes O(n) time while the second for loop takes O(n i) which is also O(n). Therefore the total running time of the algorithm is given by O(n 2 ). 4

5 5 Problem 6.12 A convex polygon P on n vertices in the plane (specified by their x and y coordinates). A triangulation of P is a collection of n-3 diagonals of P such that no towo diagonals intersect. Cost of a triangulation is given by the sum of lengths of diagonals in it. In this problem we are deriving an algorithm for finding a triangulation of minimum cost. We label the vertices of P by 1,...,n starting from an arbitrary vertex and walking clockwise. For 1 i < j n, we denote a subproblem A(i,j) which computes the minimum cost triangulation of the polygon spanned by vertices i,i+1,...,j. Formulating the subproblem this way we are enumerating all the possible diagonals such that the diagonals do not cross each other. Since we are only considering in clockwise directions, diagonals generated by the subproblems can not cross each other. Recursive definition of A[i,j] is as follows A[i, j] = min i k j A[i, k] + A[k, j] + d i,k + d k,j } (5) Base cases are given by A[i,i] = 0. This is because a diagonal can not be formed due to the same vertex. Next equation for d takes care of the fact that a diagonal can be evaluated only if the order of the vertices differ by 2. (xi x d i,j = j ) 2 + (y i y j ) 2 if j i 2 0 otherwise Based on the recursive definition and base cases, we present the algorithm as follows procedure min-cost-triangulation(p 1,...,p n ) Input: n vertices p 1,...,p n of a convex polygon P: Vertices are ordered in clockwise direction Output: Minimum cost triangulation of P Declare a 2 dimensional array A: A[i,j] stores minimum cost triangulation of polygon spanned by vertices i,i + 1,...,j for i = 1 to n: A[i,i] = 0 for s = 1 to n-1: for i = 1 to n-s: j = i + s: A[i,j] = min i k j A[i,k] + A[k,j] + d i,k + d k,j } return A[1,n] Complexity Analysis: Complexity analysis of the algorithm is analogous to chain matrix multiplication problem presented on page 171 of textbook. Computation of each A[i,j] takes O(j-i) time which is O(n). There are two outer loops which takes O(n 2 ). The algorithm runs in O(n 3 ) time. 6 Problem 6.17 Given an unlimited supply of coins of denomination x 1, x 2,...,x n, we wish to make change for a value v. We are seeking an O(nv) dynamic-programming for the following problem Input: x 1,...,x n ;v Question: Is it possible to make change for v using coins of denominations x 1,..., x n We define D(v) as a predicate which evaluates to true if it is make change for v using available denominations x 1, x 2,...,x n. If it is possible to make change for v using given denominations x 1, x 2,...,x n, then it is possible to make change for v x i using the same denominations with one coin of x i being chosen. But since we don t know which i will finally give us true value (which indicates change of v is possible) we will do a logical or over all i. Recursive definition of D(v) is written as follows D(v) = 1 i n D(v xi ) if x i v f alse otherwise 5

6 Based on Equation 6 the algorithm is straigtforward procedure make-change(x 1,..., x n,v ) Input: Denominations of available coins x 1,...,x n, Value V for which we are seeking denominations Output: true if making change with available denomination is feasible false otherwise Declare an array D of size V + 1 D[0] = true for i = 1 to V D[i] = false for v = 1 to V : for j = 1 to n: if x j v: D[v] = D[v] D[v x j ] else: D[v] = false return D[V ] Complexity Analysis: There are two for loops in the algorithm where one loop runs V times while the other loops run n times. Therefore the complexity of the algorithm is O( n V ). 6

### Dynamic Programming. Applies when the following Principle of Optimality

Dynamic Programming Applies when the following Principle of Optimality holds: In an optimal sequence of decisions or choices, each subsequence must be optimal. Translation: There s a recursive solution.

### Approximation Algorithms

Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms

### Analysis of Algorithms I: Optimal Binary Search Trees

Analysis of Algorithms I: Optimal Binary Search Trees Xi Chen Columbia University Given a set of n keys K = {k 1,..., k n } in sorted order: k 1 < k 2 < < k n we wish to build an optimal binary search

### Single machine parallel batch scheduling with unbounded capacity

Workshop on Combinatorics and Graph Theory 21th, April, 2006 Nankai University Single machine parallel batch scheduling with unbounded capacity Yuan Jinjiang Department of mathematics, Zhengzhou University

### Matrix-Chain Multiplication

Matrix-Chain Multiplication Let A be an n by m matrix, let B be an m by p matrix, then C = AB is an n by p matrix. C = AB can be computed in O(nmp) time, using traditional matrix multiplication. Suppose

### Why? A central concept in Computer Science. Algorithms are ubiquitous.

Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

### Social Media Mining. Graph Essentials

Graph Essentials Graph Basics Measures Graph and Essentials Metrics 2 2 Nodes and Edges A network is a graph nodes, actors, or vertices (plural of vertex) Connections, edges or ties Edge Node Measures

### Approximation Algorithms. Scheduling. Approximation algorithms. Scheduling jobs on a single machine

Approximation algorithms Approximation Algorithms Fast. Cheap. Reliable. Choose two. NP-hard problems: choose 2 of optimal polynomial time all instances Approximation algorithms. Trade-off between time

### CSE 5311 Homework 3 Solution

CSE 5311 Homework 3 Solution Problem 15.1-1 Show that equation (15.4) follows from equation (15.3) and the initial condition T (0) = 1. We can verify that T (n) = n is a solution to the given recurrence

### 2.3 Scheduling jobs on identical parallel machines

2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed

### Scheduling Shop Scheduling. Tim Nieberg

Scheduling Shop Scheduling Tim Nieberg Shop models: General Introduction Remark: Consider non preemptive problems with regular objectives Notation Shop Problems: m machines, n jobs 1,..., n operations

### Applied Algorithm Design Lecture 5

Applied Algorithm Design Lecture 5 Pietro Michiardi Eurecom Pietro Michiardi (Eurecom) Applied Algorithm Design Lecture 5 1 / 86 Approximation Algorithms Pietro Michiardi (Eurecom) Applied Algorithm Design

### Network (Tree) Topology Inference Based on Prüfer Sequence

Network (Tree) Topology Inference Based on Prüfer Sequence C. Vanniarajan and Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology Madras Chennai 600036 vanniarajanc@hcl.in,

### Dynamic Programming. Lecture 11. 11.1 Overview. 11.2 Introduction

Lecture 11 Dynamic Programming 11.1 Overview Dynamic Programming is a powerful technique that allows one to solve many different types of problems in time O(n 2 ) or O(n 3 ) for which a naive approach

### Near Optimal Solutions

Near Optimal Solutions Many important optimization problems are lacking efficient solutions. NP-Complete problems unlikely to have polynomial time solutions. Good heuristics important for such problems.

### CMPS 102 Solutions to Homework 1

CMPS 0 Solutions to Homework Lindsay Brown, lbrown@soe.ucsc.edu September 9, 005 Problem..- p. 3 For inputs of size n insertion sort runs in 8n steps, while merge sort runs in 64n lg n steps. For which

### Homework Exam 1, Geometric Algorithms, 2016

Homework Exam 1, Geometric Algorithms, 2016 1. (3 points) Let P be a convex polyhedron in 3-dimensional space. The boundary of P is represented as a DCEL, storing the incidence relationships between the

### Discrete Optimization

Discrete Optimization [Chen, Batson, Dang: Applied integer Programming] Chapter 3 and 4.1-4.3 by Johan Högdahl and Victoria Svedberg Seminar 2, 2015-03-31 Todays presentation Chapter 3 Transforms using

### Divide-and-Conquer. Three main steps : 1. divide; 2. conquer; 3. merge.

Divide-and-Conquer Three main steps : 1. divide; 2. conquer; 3. merge. 1 Let I denote the (sub)problem instance and S be its solution. The divide-and-conquer strategy can be described as follows. Procedure

### IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics* Rakesh Nagi Department of Industrial Engineering University at Buffalo (SUNY) *Lecture notes from Network Flows by Ahuja, Magnanti

### GRAPH THEORY LECTURE 4: TREES

GRAPH THEORY LECTURE 4: TREES Abstract. 3.1 presents some standard characterizations and properties of trees. 3.2 presents several different types of trees. 3.7 develops a counting method based on a bijection

### Labeling outerplanar graphs with maximum degree three

Labeling outerplanar graphs with maximum degree three Xiangwen Li 1 and Sanming Zhou 2 1 Department of Mathematics Huazhong Normal University, Wuhan 430079, China 2 Department of Mathematics and Statistics

### Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

7 Catalan Numbers Thomas A. Dowling, Department of Mathematics, Ohio State Uni- Author: versity. Prerequisites: The prerequisites for this chapter are recursive definitions, basic counting principles,

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

### Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

### CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92.

Name: Email ID: CSE 326, Data Structures Section: Sample Final Exam Instructions: The exam is closed book, closed notes. Unless otherwise stated, N denotes the number of elements in the data structure

### LECTURE 4. Last time: Lecture outline

LECTURE 4 Last time: Types of convergence Weak Law of Large Numbers Strong Law of Large Numbers Asymptotic Equipartition Property Lecture outline Stochastic processes Markov chains Entropy rate Random

Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one

### CSC2420 Spring 2015: Lecture 3

CSC2420 Spring 2015: Lecture 3 Allan Borodin January 22, 2015 1 / 1 Announcements and todays agenda Assignment 1 due next Thursday. I may add one or two additional questions today or tomorrow. Todays agenda

### OPTIMAL DESIGN OF DISTRIBUTED SENSOR NETWORKS FOR FIELD RECONSTRUCTION

OPTIMAL DESIGN OF DISTRIBUTED SENSOR NETWORKS FOR FIELD RECONSTRUCTION Sérgio Pequito, Stephen Kruzick, Soummya Kar, José M. F. Moura, A. Pedro Aguiar Department of Electrical and Computer Engineering

### 8.1 Min Degree Spanning Tree

CS880: Approximations Algorithms Scribe: Siddharth Barman Lecturer: Shuchi Chawla Topic: Min Degree Spanning Tree Date: 02/15/07 In this lecture we give a local search based algorithm for the Min Degree

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

### Reminder: Complexity (1) Parallel Complexity Theory. Reminder: Complexity (2) Complexity-new

Reminder: Complexity (1) Parallel Complexity Theory Lecture 6 Number of steps or memory units required to compute some result In terms of input size Using a single processor O(1) says that regardless of

### Reminder: Complexity (1) Parallel Complexity Theory. Reminder: Complexity (2) Complexity-new GAP (2) Graph Accessibility Problem (GAP) (1)

Reminder: Complexity (1) Parallel Complexity Theory Lecture 6 Number of steps or memory units required to compute some result In terms of input size Using a single processor O(1) says that regardless of

### Graph Algorithms. Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar

Graph Algorithms Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar To accompany the text Introduction to Parallel Computing, Addison Wesley, 3. Topic Overview Definitions and Representation Minimum

### Lecture 7: Approximation via Randomized Rounding

Lecture 7: Approximation via Randomized Rounding Often LPs return a fractional solution where the solution x, which is supposed to be in {0, } n, is in [0, ] n instead. There is a generic way of obtaining

### each college c i C has a capacity q i - the maximum number of students it will admit

n colleges in a set C, m applicants in a set A, where m is much larger than n. each college c i C has a capacity q i - the maximum number of students it will admit each college c i has a strict order i

### SHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH

31 Kragujevac J. Math. 25 (2003) 31 49. SHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH Kinkar Ch. Das Department of Mathematics, Indian Institute of Technology, Kharagpur 721302, W.B.,

### Algorithm Design and Analysis

Algorithm Design and Analysis LECTURE 27 Approximation Algorithms Load Balancing Weighted Vertex Cover Reminder: Fill out SRTEs online Don t forget to click submit Sofya Raskhodnikova 12/6/2011 S. Raskhodnikova;

### CIS 700: algorithms for Big Data

CIS 700: algorithms for Big Data Lecture 6: Graph Sketching Slides at http://grigory.us/big-data-class.html Grigory Yaroslavtsev http://grigory.us Sketching Graphs? We know how to sketch vectors: v Mv

### Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm

### Euclidean Minimum Spanning Trees Based on Well Separated Pair Decompositions Chaojun Li. Advised by: Dave Mount. May 22, 2014

Euclidean Minimum Spanning Trees Based on Well Separated Pair Decompositions Chaojun Li Advised by: Dave Mount May 22, 2014 1 INTRODUCTION In this report we consider the implementation of an efficient

### Part 2: Community Detection

Chapter 8: Graph Data Part 2: Community Detection Based on Leskovec, Rajaraman, Ullman 2014: Mining of Massive Datasets Big Data Management and Analytics Outline Community Detection - Social networks -

### Minimum Makespan Scheduling

Minimum Makespan Scheduling Minimum makespan scheduling: Definition and variants Factor 2 algorithm for identical machines PTAS for identical machines Factor 2 algorithm for unrelated machines Martin Zachariasen,

### FIND ALL LONGER AND SHORTER BOUNDARY DURATION VECTORS UNDER PROJECT TIME AND BUDGET CONSTRAINTS

Journal of the Operations Research Society of Japan Vol. 45, No. 3, September 2002 2002 The Operations Research Society of Japan FIND ALL LONGER AND SHORTER BOUNDARY DURATION VECTORS UNDER PROJECT TIME

### Warshall s Algorithm: Transitive Closure

CS 0 Theory of Algorithms / CS 68 Algorithms in Bioinformaticsi Dynamic Programming Part II. Warshall s Algorithm: Transitive Closure Computes the transitive closure of a relation (Alternatively: all paths

### CS2 Algorithms and Data Structures Note 11. Breadth-First Search and Shortest Paths

CS2 Algorithms and Data Structures Note 11 Breadth-First Search and Shortest Paths In this last lecture of the CS2 Algorithms and Data Structures thread we will consider the problem of computing distances

### Dynamic programming. Chapter 6. 6.1 Shortest paths in dags, revisited S C A B D E

Chapter 6 Dynamic programming In the preceding chapters we have seen some elegant design principles such as divide-andconquer, graph exploration, and greedy choice that yield definitive algorithms for

### 15-750 Graduate Algorithms Spring 2010

15-750 Graduate Algorithms Spring 2010 1 Cheap Cut (25 pts.) Suppose we are given a directed network G = (V, E) with a root node r and a set of terminal nodes T V. We would like to remove the fewest number

### 5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1 General Integer Linear Program: (ILP) min c T x Ax b x 0 integer Assumption: A, b integer The integrality condition

### Lattice Point Geometry: Pick s Theorem and Minkowski s Theorem. Senior Exercise in Mathematics. Jennifer Garbett Kenyon College

Lattice Point Geometry: Pick s Theorem and Minkowski s Theorem Senior Exercise in Mathematics Jennifer Garbett Kenyon College November 18, 010 Contents 1 Introduction 1 Primitive Lattice Triangles 5.1

### The Orthogonal Art Gallery Theorem with Constrained Guards

The Orthogonal Art Gallery Theorem with Constrained Guards T. S. Michael 1 Mathematics Department United States Naval Academy Annapolis, MD, U.S.A. Val Pinciu 2 Department of Mathematics Southern Connecticut

### Week 5 Integral Polyhedra

Week 5 Integral Polyhedra We have seen some examples 1 of linear programming formulation that are integral, meaning that every basic feasible solution is an integral vector. This week we develop a theory

### Approximation Algorithms: LP Relaxation, Rounding, and Randomized Rounding Techniques. My T. Thai

Approximation Algorithms: LP Relaxation, Rounding, and Randomized Rounding Techniques My T. Thai 1 Overview An overview of LP relaxation and rounding method is as follows: 1. Formulate an optimization

### Mathematical Induction. Lecture 10-11

Mathematical Induction Lecture 10-11 Menu Mathematical Induction Strong Induction Recursive Definitions Structural Induction Climbing an Infinite Ladder Suppose we have an infinite ladder: 1. We can reach

### 11. APPROXIMATION ALGORITHMS

11. APPROXIMATION ALGORITHMS load balancing center selection pricing method: vertex cover LP rounding: vertex cover generalized load balancing knapsack problem Lecture slides by Kevin Wayne Copyright 2005

### The Goldberg Rao Algorithm for the Maximum Flow Problem

The Goldberg Rao Algorithm for the Maximum Flow Problem COS 528 class notes October 18, 2006 Scribe: Dávid Papp Main idea: use of the blocking flow paradigm to achieve essentially O(min{m 2/3, n 1/2 }

### Stationary random graphs on Z with prescribed iid degrees and finite mean connections

Stationary random graphs on Z with prescribed iid degrees and finite mean connections Maria Deijfen Johan Jonasson February 2006 Abstract Let F be a probability distribution with support on the non-negative

### Data Structures and Algorithms Written Examination

Data Structures and Algorithms Written Examination 22 February 2013 FIRST NAME STUDENT NUMBER LAST NAME SIGNATURE Instructions for students: Write First Name, Last Name, Student Number and Signature where

### Parallel Random Access Machine (PRAM) PRAM Algorithms. Shared Memory Access Conflicts. A Basic PRAM Algorithm. Time Optimality.

Parallel Random Access Machine (PRAM) PRAM Algorithms Arvind Krishnamurthy Fall 2 Collection of numbered processors Accessing shared memory cells Each processor could have local memory (registers) Each

### DATA ANALYSIS II. Matrix Algorithms

DATA ANALYSIS II Matrix Algorithms Similarity Matrix Given a dataset D = {x i }, i=1,..,n consisting of n points in R d, let A denote the n n symmetric similarity matrix between the points, given as where

### On the k-path cover problem for cacti

On the k-path cover problem for cacti Zemin Jin and Xueliang Li Center for Combinatorics and LPMC Nankai University Tianjin 300071, P.R. China zeminjin@eyou.com, x.li@eyou.com Abstract In this paper we

### Graphs without proper subgraphs of minimum degree 3 and short cycles

Graphs without proper subgraphs of minimum degree 3 and short cycles Lothar Narins, Alexey Pokrovskiy, Tibor Szabó Department of Mathematics, Freie Universität, Berlin, Germany. August 22, 2014 Abstract

### Transportation Polytopes: a Twenty year Update

Transportation Polytopes: a Twenty year Update Jesús Antonio De Loera University of California, Davis Based on various papers joint with R. Hemmecke, E.Kim, F. Liu, U. Rothblum, F. Santos, S. Onn, R. Yoshida,

### Linear Programming. March 14, 2014

Linear Programming March 1, 01 Parts of this introduction to linear programming were adapted from Chapter 9 of Introduction to Algorithms, Second Edition, by Cormen, Leiserson, Rivest and Stein [1]. 1

### Lecture 18: Applications of Dynamic Programming Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY 11794 4400

Lecture 18: Applications of Dynamic Programming Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Problem of the Day

### 6.852: Distributed Algorithms Fall, 2009. Class 2

.8: Distributed Algorithms Fall, 009 Class Today s plan Leader election in a synchronous ring: Lower bound for comparison-based algorithms. Basic computation in general synchronous networks: Leader election

### Unit 4: Dynamic Programming

Unit 4: Dynamic Programming Course contents: Assembly-line scheduling Matrix-chain multiplication Longest common subsequence Optimal binary search trees Applications: Rod cutting, optimal polygon triangulation,

### Offline sorting buffers on Line

Offline sorting buffers on Line Rohit Khandekar 1 and Vinayaka Pandit 2 1 University of Waterloo, ON, Canada. email: rkhandekar@gmail.com 2 IBM India Research Lab, New Delhi. email: pvinayak@in.ibm.com

### RANDOMIZATION IN APPROXIMATION AND ONLINE ALGORITHMS. Manos Thanos Randomized Algorithms NTUA

RANDOMIZATION IN APPROXIMATION AND ONLINE ALGORITHMS 1 Manos Thanos Randomized Algorithms NTUA RANDOMIZED ROUNDING Linear Programming problems are problems for the optimization of a linear objective function,

### Introduction to Scheduling Theory

Introduction to Scheduling Theory Arnaud Legrand Laboratoire Informatique et Distribution IMAG CNRS, France arnaud.legrand@imag.fr November 8, 2004 1/ 26 Outline 1 Task graphs from outer space 2 Scheduling

### Finding and counting given length cycles

Finding and counting given length cycles Noga Alon Raphael Yuster Uri Zwick Abstract We present an assortment of methods for finding and counting simple cycles of a given length in directed and undirected

### The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge, cheapest first, we had to determine whether its two endpoints

### Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24

Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24 The final exam will cover seven topics. 1. greedy algorithms 2. divide-and-conquer algorithms

### SEQUENCES OF MAXIMAL DEGREE VERTICES IN GRAPHS. Nickolay Khadzhiivanov, Nedyalko Nenov

Serdica Math. J. 30 (2004), 95 102 SEQUENCES OF MAXIMAL DEGREE VERTICES IN GRAPHS Nickolay Khadzhiivanov, Nedyalko Nenov Communicated by V. Drensky Abstract. Let Γ(M) where M V (G) be the set of all vertices

### 8.1 Makespan Scheduling

600.469 / 600.669 Approximation Algorithms Lecturer: Michael Dinitz Topic: Dynamic Programing: Min-Makespan and Bin Packing Date: 2/19/15 Scribe: Gabriel Kaptchuk 8.1 Makespan Scheduling Consider an instance

### Induction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition

Induction Margaret M. Fleck 10 October 011 These notes cover mathematical induction and recursive definition 1 Introduction to induction At the start of the term, we saw the following formula for computing

### Divisor graphs have arbitrary order and size

Divisor graphs have arbitrary order and size arxiv:math/0606483v1 [math.co] 20 Jun 2006 Le Anh Vinh School of Mathematics University of New South Wales Sydney 2052 Australia Abstract A divisor graph G

### Lecture 3. Linear Programming. 3B1B Optimization Michaelmas 2015 A. Zisserman. Extreme solutions. Simplex method. Interior point method

Lecture 3 3B1B Optimization Michaelmas 2015 A. Zisserman Linear Programming Extreme solutions Simplex method Interior point method Integer programming and relaxation The Optimization Tree Linear Programming

### A Note on the Bertsimas & Sim Algorithm for Robust Combinatorial Optimization Problems

myjournal manuscript No. (will be inserted by the editor) A Note on the Bertsimas & Sim Algorithm for Robust Combinatorial Optimization Problems Eduardo Álvarez-Miranda Ivana Ljubić Paolo Toth Received:

### GENERATING LOW-DEGREE 2-SPANNERS

SIAM J. COMPUT. c 1998 Society for Industrial and Applied Mathematics Vol. 27, No. 5, pp. 1438 1456, October 1998 013 GENERATING LOW-DEGREE 2-SPANNERS GUY KORTSARZ AND DAVID PELEG Abstract. A k-spanner

### Data Structures in Java. Session 16 Instructor: Bert Huang

Data Structures in Java Session 16 Instructor: Bert Huang http://www.cs.columbia.edu/~bert/courses/3134 Announcements Homework 4 due next class Remaining grades: hw4, hw5, hw6 25% Final exam 30% Midterm

### A Branch and Bound Algorithm for Solving the Binary Bi-level Linear Programming Problem

A Branch and Bound Algorithm for Solving the Binary Bi-level Linear Programming Problem John Karlof and Peter Hocking Mathematics and Statistics Department University of North Carolina Wilmington Wilmington,

### JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS. Received December May 12, 2003; revised February 5, 2004

Scientiae Mathematicae Japonicae Online, Vol. 10, (2004), 431 437 431 JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS Ondřej Čepeka and Shao Chin Sung b Received December May 12, 2003; revised February

### Analysis of Algorithms, I

Analysis of Algorithms, I CSOR W4231.002 Eleni Drinea Computer Science Department Columbia University Thursday, February 26, 2015 Outline 1 Recap 2 Representing graphs 3 Breadth-first search (BFS) 4 Applications

### Answers to some of the exercises.

Answers to some of the exercises. Chapter 2. Ex.2.1 (a) There are several ways to do this. Here is one possibility. The idea is to apply the k-center algorithm first to D and then for each center in D

### Dynamic programming. Doctoral course Optimization on graphs - Lecture 4.1. Giovanni Righini. January 17 th, 2013

Dynamic programming Doctoral course Optimization on graphs - Lecture.1 Giovanni Righini January 1 th, 201 Implicit enumeration Combinatorial optimization problems are in general NP-hard and we usually

### Lecture 3: Linear Programming Relaxations and Rounding

Lecture 3: Linear Programming Relaxations and Rounding 1 Approximation Algorithms and Linear Relaxations For the time being, suppose we have a minimization problem. Many times, the problem at hand can

### Lecture 12: Chain Matrix Multiplication

Lecture 12: Chain Matrix Multiplication CLRS Section 15.2 Outline of this Lecture Recalling matrix multiplication. The chain matrix multiplication problem. A dynamic programming algorithm for chain matrix

### 24. The Branch and Bound Method

24. The Branch and Bound Method It has serious practical consequences if it is known that a combinatorial problem is NP-complete. Then one can conclude according to the present state of science that no

### ONLINE DEGREE-BOUNDED STEINER NETWORK DESIGN. Sina Dehghani Saeed Seddighin Ali Shafahi Fall 2015

ONLINE DEGREE-BOUNDED STEINER NETWORK DESIGN Sina Dehghani Saeed Seddighin Ali Shafahi Fall 2015 ONLINE STEINER FOREST PROBLEM An initially given graph G. s 1 s 2 A sequence of demands (s i, t i ) arriving

### Ph.D. Thesis. Judit Nagy-György. Supervisor: Péter Hajnal Associate Professor

Online algorithms for combinatorial problems Ph.D. Thesis by Judit Nagy-György Supervisor: Péter Hajnal Associate Professor Doctoral School in Mathematics and Computer Science University of Szeged Bolyai

### Sample Questions Csci 1112 A. Bellaachia

Sample Questions Csci 1112 A. Bellaachia Important Series : o S( N) 1 2 N N i N(1 N) / 2 i 1 o Sum of squares: N 2 N( N 1)(2N 1) N i for large N i 1 6 o Sum of exponents: N k 1 k N i for large N and k

### Approximating Minimum Bounded Degree Spanning Trees to within One of Optimal

Approximating Minimum Bounded Degree Spanning Trees to within One of Optimal ABSTACT Mohit Singh Tepper School of Business Carnegie Mellon University Pittsburgh, PA USA mohits@andrew.cmu.edu In the MINIMUM

### All-Pairs Shortest Paths with Matrix Multiplication

All-Pairs Shortest Paths with Matrix Multiplication Chandler Burfield March 15, 2013 Chandler Burfield APSP with Matrix Multiplication March 15, 2013 1 / 19 Outline 1 Seidel s algorithm 2 Faster Matrix

### Bicolored Shortest Paths in Graphs with Applications to Network Overlay Design

Bicolored Shortest Paths in Graphs with Applications to Network Overlay Design Hongsik Choi and Hyeong-Ah Choi Department of Electrical Engineering and Computer Science George Washington University Washington,

### Binary Search. Search for x in a sorted array A.

Divide and Conquer A general paradigm for algorithm design; inspired by emperors and colonizers. Three-step process: 1. Divide the problem into smaller problems. 2. Conquer by solving these problems. 3.