Precedence Constrained Scheduling Abhiram Ranade Dept. of CSE IIT Bombay.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Algorithm Design Methods Spring 2007 CSE, POSTECH.
Covers, Dominations, Independent Sets and Matchings AmirHossein Bayegan Amirkabir University of Technology.
Single Source Shortest Paths
ECE 667 Synthesis and Verification of Digital Circuits
§3 Shortest Path Algorithms Given a digraph G = ( V, E ), and a cost function c( e ) for e  E( G ). The length of a path P from source to destination.
Approximation Algorithms Chapter 14: Rounding Applied to Set Cover.
Greedy Algorithms Greed is good. (Some of the time)
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 14: March 3, 2004 Scheduling Heuristics and Approximation.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Approximation Algorithms Chapter 5: k-center. Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm.
Parallel Scheduling of Complex DAGs under Uncertainty Grzegorz Malewicz.
Precedence Constrained Scheduling Abhiram Ranade Dept. of CSE IIT Bombay.
The number of edge-disjoint transitive triples in a tournament.
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
P-Center & The Power of Graphs A part of the facility location problem set By Kiril Yershov and Alla Segal For Geometric Optimizations course Fall 2010.
1 Data Structures DFS, Topological Sort Dana Shapira.
A general approximation technique for constrained forest problems Michael X. Goemans & David P. Williamson Presented by: Yonatan Elhanani & Yuval Cohen.
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …
2-Layer Crossing Minimisation Johan van Rooij. Overview Problem definitions NP-Hardness proof Heuristics & Performance Practical Computation One layer:
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Priority Models Sashka Davis University of California, San Diego June 1, 2003.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
APPROXIMATION ALGORITHMS VERTEX COVER – MAX CUT PROBLEMS
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 12: February 13, 2002 Scheduling Heuristics and Approximation.
Dijkstra’s Algorithm. Announcements Assignment #2 Due Tonight Exams Graded Assignment #3 Posted.
1 Combinatorial Algorithms Parametric Pruning. 2 Metric k-center Given a complete undirected graph G = (V, E) with nonnegative edge costs satisfying the.
CSC 413/513: Intro to Algorithms NP Completeness.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
CSE 331: Review. Main Steps in Algorithm Design Problem Statement Algorithm Real world problem Problem Definition Precise mathematical def “Implementation”
CSE 2331 / 5331 Topic 12: Shortest Path Basics Dijkstra Algorithm Relaxation Bellman-Ford Alg.
6. Application mapping 6.1 Problem definition
Lecture 11 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
Jan Topological Order and SCC Edge classification Topological order Recognition of strongly connected components.
Lecture.6. Table of Contents Lp –rounding Dual Fitting LP-Duality.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
CSEP 521 Applied Algorithms Richard Anderson Winter 2013 Lecture 3.
1 Chapter 22: Elementary Graph Algorithms III. 2 About this lecture Topological Sort.
 2004 SDU 1 Lecture5-Strongly Connected Components.
November 22, Algorithms and Data Structures Lecture XII Simonas Šaltenis Nykredit Center for Database Research Aalborg University
Graph Algorithms – 2. graphs Parenthesis Theorem Theorem 22.7 For all u, v, exactly one of the following holds: 1. d[u] < f [u] < d[v] < f [v] or.
Introduction to Algorithms
More NP-Complete and NP-hard Problems
Proof technique (pigeonhole principle)
Graph Algorithms BFS, DFS, Dijkstra’s.
Lecture 23 CSE 331 Oct 26, 2016.
Computability and Complexity
Lecture 10 Algorithm Analysis
Lecture 24 CSE 331 Oct 29, 2012.
Richard Anderson Lecture 6 Greedy Algorithms
Richard Anderson Autumn 2016 Lecture 7
Lecture 22 CSE 331 Oct 15, 2014.
Richard Anderson Lecture 7 Greedy Algorithms
EE5900 Advanced Embedded System For Smart Infrastructure
Lecture 23 CSE 331 Oct 24, 2011.
CSE 417: Algorithms and Computational Complexity
Richard Anderson Winter 2019 Lecture 7
Richard Anderson Autumn 2015 Lecture 7
Instructor: Aaron Roth
Richard Anderson Autumn 2019 Lecture 7
Lecture 24 CSE 331 Oct 29, 2018.
Presentation transcript:

Precedence Constrained Scheduling Abhiram Ranade Dept. of CSE IIT Bombay

Input Directed Acyclic Graph G, #processors p A B C D E F G H, 3 Vertex = unit time task edge (u,v) : Time(u) < Time(v)

Output: Schedule Time Processor 1 A D E G Processor 2 B F H Processor 3 C Schedule Length, to be minimized

Applications Project management. Vertex = lay foundation, build walls. Edges: what happens first to what happens later. Processors : Number of workmen. MS Project, others. Our problem: Simplified version. Other applications: Parallel computing.

Summary of results Polytime algorithm when p=2. [Fuiji.. 69] NP-hard for variable p. [LenKan 78] NP-hardness not known for fixed p > 2. Polytime algorithm for trees. [Hu 61]

Summary of results - 2 Any greedy algorithm gives 2 - 1/p approximation. i.e. Schedule of length at most (2 - 1/p) times Optimal length. [Coffman-Graham 72, Lam-Sethi 77] give 2 - 2/p approximation algorithm. [Gangal-Ranade 08] give 2 – 7/(3p+1) approximation for p > 3. [Svensson 10] Better than 2-ε unlikely.

Outline Elementary Lower Bound ideas Elementary algorithm and analysis Deadline Constraints [GarJoh 76]  More complex problem, but generates new ideas.  2 processor optimality, also without deadlines  Essentially gives 2 - 2/p approximation Ideas behind 2 - 7/(3p+1) approximation algorithm

Elementary Lower Bounds To prove optimality of any algorithm, need to show why it cannot be improved, i.e. lower bound on schedule length. OPT  H = Length of longest path in G. OPT  [ N / p ], N = #nodes [ x ] = ceiling(x), smallest integer  x. Example: H = 3, [N/p] =[8/3] = 3

Input Directed Acyclic Graph G, #processors p A B C D E F G H, 3 Vertex = unit time task edge (u,v) : Time(u) < Time(v)

Generic Algorithm 1. Pick any “ready” vertex. 2. Schedule it at earliest possible time. 3. Repeat until done. ready = no predecessors yet unscheduled. earliest possible = after predecessors.

Proof of 2 approximation Full (time) slot: All processors busy Number of “full” slots  N/p Number of partial slots  H. Why?  Partial slot: Some processor did not get work.  All maximally long paths must shrink.  This can happen only H times. Time  N/P + H  OPT + OPT = 2 OPT Improve to 2 - 1/p.

Deadline Constraints [GarJoh 76] Additional Input: D(v) : time by which v must be processed. Need a schedule with p processors in which precedence constraints and deadlines are respected.

Deadline Propagation v has N(d) descendants with deadline  d  v must itself finish by d - [N(d)/p]. new deadline: d(v) = min( D(v), min d d -[N(d)/p] ) In what order to calculate? (u,v) edge  d(u) < d(v) GJ Algo: priority = deadline. Optimal for p=2!

Example AB E D C d(A) = 4 - [7/5] = 2 d(B) = min(4-[8/5], 2-[1/5]) = 1 d(C) = …. = 3 d(D) = = 2 d(E) =... = 0

GJ Deadline Properties Deadline < 1 : schedule not possible. Optimal Schedule length  Max deadline - Min deadline + 1. Opt for example  = 5 Load bound : [N/p] = [17/5] = 4 Longest path: H = 4 Is this the best lower bound?

Partial Slot Bound Max Deadline – Min Deadline + 1 >= H Time t..... P1 u v P2 - u is ancestor of v, so d(u) < d(v)

Load Bound Max deadline – Min deadline + 1 >= [N/p] Add a universal parent z d(z) <= Max deadline – [Number of descendants with deadline d/p] = Max – [N/p] Min deadline <= Max – [N/p]

Scheduling without deadlines Set d(terminal vertices) = k, some number. Propagate deadlines. m = least deadline. Schedule from time m using deadlines. Theorem: Algorithm is optimal for p=2.

2 Processor Optimality v : earliest scheduled vertex not meeting deadline w : latest scheduled vertex before v scheduled alone. Always exists? Nodes in region must be Descendants of w. Region has 2(t-t’)-1nodes with Deadline  t-1. d(w)  t-1 - (2(t-t’)-1)/2 = t’-1 Contradiction Time: t’ t Proc 1: w v Proc 2: - d(w)  t’, d(v)  t-1

Remarks Why does this not work for p > 2? Algorithm gives 2 - 2/p approximation for even p. More complex proof.

Improvements to GJ [GR 09] Node v has N(d,L) descendants at distance at least L+1 having deadline at least d Then d(v)  min d,L d - L - [N(d,L)/p]

Example AB E D C d(A) = 4 - [7/5] = 2 d(B) = min(4-[8/5], 2-[1/5]) = 1 d(C) = …. = 3 d(D) = = 2 d(E) =... = 0 d(E)  4 – 2 – [12/5] = -1 Max - min + 1 = 6. Optimal!

Algorithm Set d(terminal vertices) = 0 Propagate deadlines. New rule. For each v in non-decreasing deadline order:  (Rearrange ancestors of v if possible).  Schedule v in earliest possible slot, and smallest numbered processor.

Rearrange ancestors of v Suppose t = last slot with ancestors of v. Suppose vertices in slots t-1,t have same deadline. Suppose v has < p ancestors in t-1,t. Then move ancestors of v to slot t-1, move other vertices to slot t. If slot t is not full, v can be scheduled in t.

Analysis Outline Key part of proof: If algorithm constructs a long schedule, then deadline must drop a lot moving from last column to first. Max deadline - min deadline + 1  optimal schedule length. Optimal schedule must also be long, so good approximation factor.

How deadline varies in the schedule 123..p123..p Time> …. u v w Deadline can only increase in first row: D(u)  D(v) Deadline can only increase in any column: D(u)  D(w)

Partial slot rule 123..p123..p ….increasing time. u v w x y - Deadline must increase in first row after a partial slot: D(u) < D(v) … why was not v scheduled earlier?

1-slot rule 123..p123..p ….increasing time. u v - Let M denote the number of nodes scheduled after u. Then D(u)  D(v) - [M/p]

Intuition: Easy schedules Suppose all slots are partial: drop per slot. Thus total deadline drop = length of schedule. Optimal! Suppose all slots are either 1 slots or full slots. 1-slot rule gives optimality.

Intuition: Difficult Schedules Schedules with mixture of 2-slots and full slots. Extreme case 1: 2-slots at the beginning, full slots at the end. Extreme case 2: 2 slots and full slots alternate.

Extreme case 1: Time> P1 : a v v v v v v v v v w P2 : b v v v v v v v v v P3 : v v v v v P4 : v v v v v A,b must be ancestors of all to right. One of them say a, must be ancestor of mp/2 d(a)  d(w) - L - mp/2. Drop = #2slots + full slots/2

Extreme Case 2 Time: P1 : v v v v v v P2 : v v v v v v P3 : v v v P4 : v v v Use ancestor rearrangement to argue large drop.

Actual Analysis Keep track of how many 1-slots, 2-slots, full slots.. encountered. Relate numbers to deadline drop, schedule length. Solve for schedule length/deadline drop.

Remarks Analysis is complicated, but not much more than 2-2/p analysis of Lam-Sethi. Algorithm is simpler than Coffman- Graham. Technique will not work beyond 2 - 3/p. Even getting there is hard.