Scheduling and Digraphs

Similar documents
The Critical-Path Algorithm

Minimal Spanning Trees

The Pairwise-Comparison Method

Total Orders. Lecture 41 Section 8.5. Robb T. Koether. Hampden-Sydney College. Mon, Apr 8, 2013

The Traveling Salesman Problem Brute Force Method

The Decreasing-Time Algorithm

Rotations and Translations

Solving Recursive Sequences by Iteration

Scope and Parameter Passing

Stack Applications. Lecture 27 Sections Robb T. Koether. Hampden-Sydney College. Wed, Mar 29, 2017

LR Parsing - Conflicts

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 27, 2013

Sampling Distribution Examples Sections 15.4, 15.5

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 26, 2014

Magnification and Minification

The Traveling Salesman Problem Nearest-Neighbor Algorithm

The Plurality-with-Elimination Method

Webpage Navigation. Lecture 27. Robb T. Koether. Hampden-Sydney College. Mon, Apr 2, 2018

while Loops Lecture 13 Sections Robb T. Koether Wed, Sep 26, 2018 Hampden-Sydney College

Stack Applications. Lecture 25 Sections Robb T. Koether. Hampden-Sydney College. Mon, Mar 30, 2015

Density Curves Sections

XPath Lecture 34. Robb T. Koether. Hampden-Sydney College. Wed, Apr 11, 2012

Recognition of Tokens

The Class Construct Part 1

Recursive Descent Parsers

Scope and Parameter Passing

Boxplots. Lecture 17 Section Robb T. Koether. Hampden-Sydney College. Wed, Feb 10, 2010

Shading Triangles. Lecture 37. Robb T. Koether. Hampden-Sydney College. Mon, Nov 30, 2015

Boolean Expressions. Lecture 31 Sections 6.6, 6.7. Robb T. Koether. Hampden-Sydney College. Wed, Apr 8, 2015

Street-Routing Problems

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Mon, Jan 20, 2014

Integer Overflow. Lecture 8 Section 2.5. Robb T. Koether. Hampden-Sydney College. Mon, Jan 27, 2014

Recursion. Lecture 26 Sections , Robb T. Koether. Hampden-Sydney College. Mon, Apr 6, 2015

Ambient and Diffuse Light

XPath. Lecture 36. Robb T. Koether. Wed, Apr 16, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XPath Wed, Apr 16, / 28

The Coefficient of Determination

Operators. Lecture 12 Section Robb T. Koether. Hampden-Sydney College. Fri, Feb 9, 2018

Programming Languages

Mipmaps. Lecture 35. Robb T. Koether. Hampden-Sydney College. Wed, Nov 18, 2015

Nondeterministic Programming in C++

Function Usage. Lecture 15 Sections 6.3, 6.4. Robb T. Koether. Hampden-Sydney College. Mon, Oct 1, 2018

The Graphics Pipeline

Displaying Distributions - Quantitative Variables

Inheritance: The Fundamental Functions

Recursion. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 17, 2018

The Graphics Pipeline

Friends and Unary Operators

The string Class. Lecture 21 Sections 2.9, 3.9, Robb T. Koether. Wed, Oct 17, Hampden-Sydney College

The x86 Instruction Set

MySQL Creating a Database Lecture 3

DTDs and XML Attributes

The CYK Parsing Algorithm

Binary Tree Applications

PHP Queries and HTML Forms Lecture 23

Functional Dependencies and Normal Forms

Linked Lists. Lecture 16 Sections Robb T. Koether. Hampden-Sydney College. Wed, Feb 22, 2017

Functional Dependencies and Normal Forms

The Normal Distribution

Implementing Linked Lists

Building the Abstract Syntax Trees

XML Attributes. Lecture 33. Robb T. Koether. Hampden-Sydney College. Wed, Apr 25, 2018

Regular Expressions. Lecture 10 Sections Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2016

The Traveling Salesman Problem Cheapest-Link Algorithm

Recursive Linked Lists

Pointers. Lecture 1 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 14, 2015

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Fri, Jan 18, 2013

Basic PHP. Lecture 19. Robb T. Koether. Hampden-Sydney College. Mon, Feb 26, 2108

XQuery FLOWR Expressions Lecture 35

Stacks and their Applications

Pointer Arithmetic. Lecture 4 Chapter 10. Robb T. Koether. Hampden-Sydney College. Wed, Jan 25, 2017

The Class Construct Part 2

List Iterator Implementation

Function Definition Syntax Tree

The Projection Matrix

Aggregation. Lecture 7 Section Robb T. Koether. Hampden-Sydney College. Wed, Jan 29, 2014

Array Lists. Lecture 15. Robb T. Koether. Hampden-Sydney College. Mon, Feb 22, 2016

Cryptosystems. Lecture 34. Robb T. Koether. Hampden-Sydney College. Mon, Nov 24, 2014

Fundamental Data Types

Inheritance: The Fundamental Functions

Triggers. Lecture 14. Robb T. Koether. Hampden-Sydney College. Wed, Feb 14, 2018

Programming Languages

Introduction to Databases

Abstract Data Types. Lecture 23 Section 7.1. Robb T. Koether. Hampden-Sydney College. Wed, Oct 24, 2012

Introduction to Compiler Design

Form Validation. Lecture 25. Robb T. Koether. Hampden-Sydney College. Wed, Mar 23, 2018

Review. Lecture 39. Robb T. Koether. Mon, Dec 5, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) Review Mon, Dec 5, / 14

Introduction to Databases

Array Lists. Lecture 15. Robb T. Koether. Hampden-Sydney College. Fri, Feb 16, 2018

PHP Arrays. Lecture 18. Robb T. Koether. Hampden-Sydney College. Mon, Mar 4, 2013

AJAX. Lecture 26. Robb T. Koether. Fri, Mar 21, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) AJAX Fri, Mar 21, / 16

Specular Reflection. Lecture 19. Robb T. Koether. Hampden-Sydney College. Wed, Oct 4, 2017

Dynamic Allocation of Memory

List Iterators. Lecture 27 Section Robb T. Koether. Hampden-Sydney College. Wed, Apr 8, 2015

Insertions, Deletions, and Updates

jquery Lecture 34 Robb T. Koether Wed, Apr 10, 2013 Hampden-Sydney College Robb T. Koether (Hampden-Sydney College) jquery Wed, Apr 10, / 29

Abstract Syntax Trees Synthetic and Inherited Attributes

Binary Tree Implementation

LR Parsing - The Items

Binary Tree Implementation

The Constructors. Lecture 7 Sections Robb T. Koether. Hampden-Sydney College. Wed, Feb 1, 2017

Transcription:

Scheduling and Digraphs Lecture 35 Sections 8.1, 8.2 Robb T. Koether Hampden-Sydney College Mon, Nov 21, 2016 Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 1 / 25

1 Introduction 2 Definitions 3 Example 4 Digraphs 5 Project Digraphs 6 Priority Lists 7 Assignment Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 2 / 25

Outline 1 Introduction 2 Definitions 3 Example 4 Digraphs 5 Project Digraphs 6 Priority Lists 7 Assignment Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 3 / 25

Introduction To plan a meeting with several invited speakers involves a number of tasks: (A) Locate appropriate speakers. (B) Invite them to speak. (C) Send out announcements of the meeting. (D) Build a website to register attendees. (E) Plan a banquet menu. (F) Retain a caterer. (G) Determine the registration fee. (H) Reserve a room for the banquet. (I) Update website with info. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 4 / 25

Introduction Some of these tasks can be done simultaneously. Locate appropriate speakers. Plan a banquet menu. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 5 / 25

Introduction Some of these tasks can be done simultaneously. Locate appropriate speakers. Plan a banquet menu. Some must be done in sequence. Plan a banquet menu. Determine the registration fee. Build a website to register attendees. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 5 / 25

Introduction Some of these tasks can be done simultaneously. Locate appropriate speakers. Plan a banquet menu. Some must be done in sequence. Plan a banquet menu. Determine the registration fee. Build a website to register attendees. If we know how long each task will take and if we know the dependencies, then we can figure out how long the entire project will take. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 5 / 25

Outline 1 Introduction 2 Definitions 3 Example 4 Digraphs 5 Project Digraphs 6 Priority Lists 7 Assignment Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 6 / 25

Definitions Definition (Task) A task is a unit of work that cannot be broken down into smaller units. Definition (Processor) A processor is a person or a machine that carries out a task. Because a task cannot be broken down into parts, each task must be done by a single processor. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 7 / 25

Definitions Definition (Processing Times) The processing time of a task is the time necessary to complete the task. Definition (Precedence Relations) Given two tasks, a precedence relation states that one of them must be completed before the other one can be started. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 8 / 25

Outline 1 Introduction 2 Definitions 3 Example 4 Digraphs 5 Project Digraphs 6 Priority Lists 7 Assignment Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 9 / 25

Example Assume the following processor times. (A) Locate appropriate speakers 3 days. (B) Invite them to speak (and get confirmation) 4 days. (C) Send out announcements of the meeting 1 day. (D) Build a website to register attendees 3 days. (E) Plan a banquet menu 1 day. (F) Retain a caterer 2 days. (G) Determine the registration fee 1 day. (H) Reserve a room for the banquet 1 day. (I) Update website with info 1 day. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 10 / 25

Example We have the following times and precedence relations. Task Time Precedent Tasks (A) Locate speakers 3 (B) Confirm speakers 4 A (C) Send announcements 1 B, D, E, G (D) Build website 3 (E) Plan menu 1 F (F) Retain caterer 2 (G) Registration fee 1 F (H) Banquet room 1 (I) Update website 1 B, D, E, G Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 11 / 25

Outline 1 Introduction 2 Definitions 3 Example 4 Digraphs 5 Project Digraphs 6 Priority Lists 7 Assignment Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 12 / 25

Definitions Definition (Digraph) A digraph is a directed graph. That is, each edge is given a direction, indicated by an arrowhead. A B E F C D Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 13 / 25

Example A B Start D F E C I End H G This digraph shows the precedence relations of our example. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 14 / 25

Example A B Start D F E C I End H G This digraph shows the precedence relations of our example. Note the two additional vertices Start and End. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 14 / 25

Outline 1 Introduction 2 Definitions 3 Example 4 Digraphs 5 Project Digraphs 6 Priority Lists 7 Assignment Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 15 / 25

Project Digraphs Definition (Project Digraph) A project digraph is a digraph that displays the precedence relations among the tasks of a project as well as the process times for each task, and START and END vertices. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 16 / 25

Example Example (Project Digraph) A(6) F(3) D(2) Start(0) B(5) G(3) End(0) C(7) E(5) H(4) The diagram shows the precedence relations. Some of the precedence relations are implied by the graph. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 17 / 25

Outline 1 Introduction 2 Definitions 3 Example 4 Digraphs 5 Project Digraphs 6 Priority Lists 7 Assignment Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 18 / 25

Priority Lists Definition (Priority List) A priority list is a list of the tasks of a project, listed in the order in which we prefer to execute them. Definition (Priority List Model) The priority list model uses a priority list to schedule the tasks. Whenever a processor is available, the model chooses the next task in the list that is ready to be processed. (To be ready, all precedent tasks must have been completed.) If there are M tasks, then there are M! possible priority lists. It is not practical to try them all. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 19 / 25

Example Example (Priority-List Scheduling) A(6) D(2) Start(0) B(5) End(0) C(7) E(5) Suppose the priority list is A, B, C, D, E and that there are only 2 processors. What is the resulting schedule? Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 20 / 25

Example Example (Priority-List Scheduling) A(6) D(2) Start(0) B(5) End(0) C(7) E(5) Processor 1 Processor 2 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 21 / 25

Example Example (Priority-List Scheduling) A(6) D(2) Start(0) B(5) End(0) C(7) E(5) Processor 1 Processor 2 A(6) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 21 / 25

Example Example (Priority-List Scheduling) A(6) D(2) Start(0) B(5) End(0) C(7) E(5) Processor 1 Processor 2 A(6) B(5) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 21 / 25

Example Example (Priority-List Scheduling) A(6) D(2) Start(0) B(5) End(0) C(7) E(5) Processor 1 Processor 2 A(6) B(5) C(7) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 21 / 25

Example Example (Priority-List Scheduling) A(6) D(2) Start(0) B(5) End(0) C(7) E(5) Processor 1 A(6) D(2) Processor 2 B(5) C(7) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 21 / 25

Example Example (Priority-List Scheduling) A(6) D(2) Start(0) B(5) End(0) C(7) E(5) Processor 1 A(6) D(2) Idle E(5) Processor 2 B(5) C(7) Idle 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 21 / 25

Example Example (Priority-List Scheduling) What if there had been 3 processors? What if the priority list had been A, C, D, E, B? What if the priority list had been E, D, C, B, A? Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 22 / 25

Another Example Example (Priority-List Scheduling) Task Precedent Tasks Time (A) Locate speakers 5 (B) Confirm speakers C, D 2 (C) Send announcements 4 (D) Build website 6 (E) Plan menu A, C, F 3 (F) Retain caterer A, B 1 (G) Registration fee F 4 Schedule the tasks with priority list A, B, C, D, E, F, G with 2 processors. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 23 / 25

Outline 1 Introduction 2 Definitions 3 Example 4 Digraphs 5 Project Digraphs 6 Priority Lists 7 Assignment Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 24 / 25

Assignment Assignment Chapter 8 Exercises 4, 12, 13, 14, 16, 19, 20. Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 25 / 25