Planning and Scheduling Chapter 3 Jennifer Holland February 2, 2010.

Slides:



Advertisements
Similar presentations
Math for Liberal Studies. There is a list of numbers called weights These numbers represent objects that need to be packed into bins with a particular.
Advertisements

1 Chapter 8 Approximation Algorithms (Part II). 2 Outline Scheduling Independent tasks Bin packing.
Algorithm Design Methods (I) Fall 2003 CSE, POSTECH.
Algorithm Design Methods Spring 2007 CSE, POSTECH.
Single Source Shortest Paths
 Review: The Greedy Method
§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.
Chapter 3: Planning and Scheduling Lesson Plan
Greed is good. (Some of the time)
CSC 2300 Data Structures & Algorithms April 13, 2007 Chapter 9. Graph Algorithms.
Chapter 8: Scheduling “Science is organized knowledge. Wisdom is organized life.” -Immanuel Kant.
Critical Paths and Critical Paths Algorithm Notes 8 – Sections 8.5 & 8.6.
8.1 Advanced Operating Systems Defeating The Thrashing The RAM is limited. Sometimes, too many processes need large memory allocations and the sum of these.
SCHEDULING Critical Activities are: B, F, I, M, Q.
Scheduling Two people are camping out and wish to cook a simple supper consisting of soup and hamburgers. In order to prepare the supper, several tasks.
Module 5 – Networks and Decision Mathematics Chapter 24 – Directed Graphs.
Memory Management Chapter 4. Memory hierarchy Programmers want a lot of fast, non- volatile memory But, here is what we have:
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
D1: Bin Packing Algorithms. D1: Bin-Packing Algorithms Bin-packing algorithms can be used to find ways to complete a number of tasks in given time slots,
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
Chapter 2: Business Efficiency Lesson Plan Business Efficiency  Visiting Vertices-Graph Theory Problem Hamiltonian Circuits  Vacation Planning Problem.
A processor is a person, machine, computer, or robot etc., which works on a task. To solve a scheduling problem typically the tasks are scheduled to minimize.
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
IT 60101: Lecture #201 Foundation of Computing Systems Lecture 20 Classic Optimization Problems.
Critical Path Analysis
Spring 2015 Mathematics in Management Science Bin Packing The Problem The Algorithms.
Graph Theory Hamilton Paths and Hamilton Circuits.
Spring 2015 Mathematics in Management Science Machine Scheduling Problem Statement of MSP Assumptions & Goals Priority Lists List Processing Algorithm.
© 2010 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. Case Studies: Bin Packing.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 8 The Mathematics of Scheduling 8.1The Basic Elements of Scheduling.
Spring 2015 Mathematics in Management Science Critical Path Scheduling Critical Paths & Times Backflow Algorithm Critical Times PL Critical Path Algorithm.
Outline Introduction Minimizing the makespan Minimizing total flowtime
1 Algorithms & Data Structures for Games Lecture 2A Minor Games Programming.
Priority Queues Two kinds of priority queues: Min priority queue. Max priority queue. Nov 4,
Parallel Machine Scheduling
CIRCUITS, PATHS, AND SCHEDULES Euler and Königsberg.
Algorithm Design Methods 황승원 Fall 2011 CSE, POSTECH.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 8 The Mathematics of Scheduling 8.1The Basic Elements of Scheduling.
I can describe the differences between Hamilton and Euler circuits and find efficient Hamilton circuits in graphs. Hamilton Circuits I can compare and.
Planning and Scheduling.  A job can be made up of a number of smaller tasks that can be completed by a number of different “processors.”  The processors.
Critical Paths and Scheduling Tasks Circuits, Paths, and Schedules.
Unit 3 Scheduling and Planning. Literacy Practice Please read PG Stop at ASSUMPTIONS AND GOALS on page 68.
Bin Packing. 2 Background: Suppose you plan to build a wall system for your books, records, and stereo set in your dorm room. The wall system requires.
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Unit 2 Hamiltonian Circuits. Hamiltonian Circuit: A tour that starts at a vertex of a graph and visits each vertex once and only once, returning to where.
1 Ch18. The Greedy Methods. 2 BIRD’S-EYE VIEW Enter the world of algorithm-design methods In the remainder of this book, we study the methods for the.
BIN SORTING Problem Pack the following items in bins of size Firstly, find the lower bound by summing the numbers to be packed.
Chapter 3: Planning and Scheduling. Planning and Scheduling - Topics Resolving Conflict via Coloring Bin Packing Scheduling Tasks Critical-Path Schedules.
Greedy Algorithms.
Bin Packing First fit decreasing algorithm
Algorithm Design Methods
Chapter 2: Business Efficiency Lesson Plan
Heuristics Definition – a heuristic is an inexact algorithm that is based on intuitive and plausible arguments which are “likely” to lead to reasonable.
Scheduling Theory By Sarah Walker 12/4/2018.
Exam 2 LZW not on syllabus. 73% / 75%.
Bin Packing First fit decreasing algorithm
Bin packing – First fit algorithm
Advanced Analysis of Algorithms
Matthew Renner, Trish Beeksma, Patch Kenny
Bin Packing First fit decreasing algorithm
Planning and Scheduling
Bin Packing First fit decreasing algorithm
Planning and Scheduling
Algorithm Design Methods
List Processing (SOL: DM.10)
Algorithm Design Methods
Chapter 3: Planning and Scheduling Lesson Plan
Algorithm Design Methods
Presentation transcript:

Planning and Scheduling Chapter 3 Jennifer Holland February 2, 2010

Scheduling Tasks Processors – Anything that can perform a task – Humans, robots, or machines Machine-Scheduling Problem – Deciding how to assign task to various processors – Want to achieve earliest completion as possible Tasks must then be prioritized Rules must be in place in cases of “ties” in importance

Examples of Prioritizing Visiting an emergency room – Man with a broke leg – Child who will not open one of his eyes – Woman with severe pains in her abdomen – Child with a fever

Assumptions and Goals 1.Once a task has begun, the processor will continue with the task until has been complete. 2.If there is an idle processor and a task to be completed, the processor will immediately begin work on the task. 3.Ordering of tasks must as be taken into consideration. 4.In addition to the order of tasks must be done, there is also a priority list which is independent of the first list.

Building a House Priority List – Prep site for digging – Dig for foundation – Lay Foundation Order-requirement digraph T7T7 T2T2 T3T3 T4T4 T6T6 T5T5 T8T8 T1T1

List-Processing Algorithm Part I and Ready Task A task is ready if all its predecessors (from digraph) have been completed at that time. At a given time, assign to the lowest-numbered free processor the first task on the priority list that is ready at that time and hasn’t already been assigned to another processor Part II Priority list is scanned from left to right. If no task can be assigned at that time, one or more processors will remain idle until there is a task ready.

Using List-Processing Algorithm Order-requirement digraph T7T7 T2T2 T3T3 T4T4 T6T6 T5T5 T8T8 T1T1 T8T8 T2T2 T5T5 T6T6 T4T4 T7T7 T1T1 T3T3 Priority List: T 8, T 7, T 6, T 5, T 4, T 3, T 2, T Machine 1 Machine 2 Note: Different Priority Lists will produce different schedules with different end times. Idle time

When is a Schedule Optimal? An optimal schedule will have the least amount of idle time. The shortest completion time is made up of the path with the longest distance through the order-requirement digraph; T 1, T 2, T 3, T 4 with a length of 27 This distance must be at least as large as the total task times divided by the number of processors—47/2 = 23.5 (actually 24 because the tasks are integer times so the solution must also be integer T7T7 T2T2 T3T3 T4T4 T6T6 T5T5 T8T8 T1T1 6

Critical-Path Schedules Before the priority list was given. Now the question is whether or not there is a systematic way of choosing a priority list which will yield an optimal solution

How to Obtain Priority List L 1.Find a task that heads a critical (longest) path in the order- requirement digraph. If there is a tie, choose the task with the lower number. 2.Place the task found in step 1 next on the list L. (The first time through the process this task will head the list.) 3.Remove the task found in step 1 and the edges attached to it from the current order-requirement digraph, obtaining a new (modified) order-requirement digraph. 4.If there are no vertices left in the new order-requirement digraph, the procedure is complete; if there are vertices left, go back to step 1. This procedure will terminate when all the tasks in the original order- requirement digraph have been placed on the list L.

Priority List L T1T1 Machine 2 T5T5 T6T6 T8T8 T4T4 T9T9 T7T7 T T2T2 T3T3 T7T7 T6T6 T4T4 T5T5 T8T8 T9T9 T 10 T 1 T 2 T 3 and T 1 T 4 T 3 are both critical paths of length 64. Machine 1 T1T1 T2T2 T3T3 T1T1 T3T3 T 10 T7T7 T9T9 T8T8 T6T6 T5T5 T4T4 T2T2

Bin Packing Anytime you want to arrange objects of various shape or size, bin-packing heuristics can be applied. Next-Fit (NF)  place the weights into the first bin until the next weight will not fit, then move on to next bin. First-Fit (FF)  put the next weight into the first bin already opened that has room for this weight. If no such bin exists, start a new bin. Worst-Fit (WF)  If we are keeping track of how much room remains in open bins, we can put the next item to be packed into the bin that currently has the most room available. Note: All these methods can be carried out quickly but cannot be guaranteed to produce optimal results.

More Bin Packing Decreasing-Time Heuristics These are used to address the issue of larger weight items showing up later on in the packing list. First step is to sort the items to be packed in order of decreasing size—assuming that all items are known in advance. Next-Fit Decreasing (NFD) First-Fit Decreasing (FFD) Worst-Fit Decreasing (WFD)

Class Exercises Next-Fit (NF)  place the weights into the first bin until the next weight will not fit, then move on to next bin. For these exercises, our bins will be able to hold 10 pounds (length of 10) 6, 6, 5, 5, 5, 4, 4, 4, 4, 2, 2, 2, 2, 3, 3, 7, 7, 5, 5, 8, 8, 4, 4, 5 Worst-Fit (WF)  If we are keeping track of how much room remains in open bins, we can put the next item to be packed into the bin that currently has the most room available. 6, 6, 5, 5, 5, 4, 4, 4, 4, 2, 2, 2, 2, 3, 3, 7, 7, 5, 5, 8, 8, 4, 4, 5 First-Fit Decreasing (FFD)  put the next weight into the first bin already opened that has room for this weight. If no such bin exists, start a new bin. Our list of 6, 6, 5, 5, 5, 4, 4, 4, 4, 2, 2, 2, 2, 3, 3, 7, 7, 5, 5, 8, 8, 4, 4, 5 becomes: 8, 8, 7, 7, 6, 6, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 3, 3, 2, 2, 2, 2 Homework problems: 6a-c; 49