Excursions in Modern Mathematics Sixth Edition

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

1 A B C
Scenario: EOT/EOT-R/COT Resident admitted March 10th Admitted for PT and OT following knee replacement for patient with CHF, COPD, shortness of breath.
Angstrom Care 培苗社 Quadratic Equation II
AP STUDY SESSION 2.
1
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Processes and Operating Systems
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
David Burdett May 11, 2004 Package Binding for WS CDL.
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
Process a Customer Chapter 2. Process a Customer 2-2 Objectives Understand what defines a Customer Learn how to check for an existing Customer Learn how.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
Custom Services and Training Provider Details Chapter 4.
CALENDAR.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt RhymesMapsMathInsects.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Break Time Remaining 10:00.
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
PP Test Review Sections 6-1 to 6-6
1 The Blue Café by Chris Rea My world is miles of endless roads.
Outline Minimum Spanning Tree Maximal Flow Algorithm LP formulation 1.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
Developing the Project Plan
Developing a Project Plan
CS 6143 COMPUTER ARCHITECTURE II SPRING 2014 ACM Principles and Practice of Parallel Programming, PPoPP, 2006 Panel Presentations Parallel Processing is.
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
Graphs, representation, isomorphism, connectivity
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
: 3 00.
5 minutes.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Analyzing Genes and Genomes
Prof.ir. Klaas H.J. Robers, 14 July Graduation: a process organised by YOU.
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Essential Cell Biology
Converting a Fraction to %
Clock will move after 1 minute
PSSA Preparation.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
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.
The Mathematics of Scheduling Chapter 8. How long does it take to build a house? It depends on Size of the house Type of construction Number of workers.
Excursions in Modern Mathematics Sixth Edition
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 8 The Mathematics of Scheduling 8.1The Basic Elements of Scheduling.
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 Machine Scheduling Problem Statement of MSP Assumptions & Goals Priority Lists List Processing Algorithm.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 8 The Mathematics of Scheduling 8.1The Basic Elements of Scheduling.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 8 The Mathematics of Scheduling 8.1The Basic Elements of Scheduling.
8 The Mathematics of Scheduling
Excursions in Modern Mathematics Sixth Edition
Scheduling Theory By Sarah Walker 12/4/2018.
Presentation transcript:

Excursions in Modern Mathematics Sixth Edition Peter Tannenbaum

Chapter 8 The Mathematics of Scheduling Directed Graphs and Critical Paths

The Mathematics of Scheduling 8.1 The Basic Elements of Scheduling

The Mathematics of Scheduling The Basic Elements of Scheduling The Processors. - Every job requires workers. - Processors describe “Workers” - P1, P2, P3, …PN to denote the processors themselves.

The Mathematics of Scheduling The Basic Elements of Scheduling The Tasks. - Individual pieces of work - We will use capital letters A, B, C…, to represent the tasks.

The Mathematics of Scheduling The Basic Elements of Scheduling The Tasks (continued). At a particular moment in time a task can be in one of four possible states: Completed In execution Ready Ineligible

The Mathematics of Scheduling The Basic Elements of Scheduling The processing times. - The notation X(5) tells us that the task called X has a processing time of 5 units (be it minutes, hours, days, or any other unit of time).

The Mathematics of Scheduling The Basic Elements of Scheduling The Precedence of Relations. - Formal restrictions on the order in which tasks must be executed.

The Mathematics of Scheduling A precedence relation can be conveniently abbreviated by writing XY or described graphically in (a).

The Mathematics of Scheduling When a pair of tasks X and Y have no precedence requirements between them, we say that the tasks are independent. Graphically, we can tell if there are no arrow connecting them (b).

The Mathematics of Scheduling Two final comments about precedence relations are in order. First, precedence relations are transitive: If XY and YZ , then it must be true that XZ as shown in (c).

The Mathematics of Scheduling The second observation is that we cannot have a set of precedence relations that form a cycle as shown in (d). Clearly, this is logically impossible!

The Mathematics of Scheduling Repairing a Wreck Imagine you just wrecked your car. The garage is operated by two processors, P1 and P2. The repairs can be broken into four different tasks: exterior body work (4 hours) engine repairs (5 hours) painting and exterior finish work (7 hours) repair transmission (3 hours). The only precedence relation A C .

The Mathematics of Scheduling Repairing a Wreck 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20   P1 P2

The Mathematics of Scheduling Repairing a Wreck (A) exterior body work (4 hours), (B) engine repairs (5 hours), (C) painting and exterior finish work (7 hours), and (D) repair transmission (3 hours). The only precedence relation A C .

The Mathematics of Scheduling Repairing a Wreck The schedule shown in (a) is very inefficient. All the short tasks are assigned one processor (P1) and all the long tasks to the other processor (P2).

The Mathematics of Scheduling Repairing a Wreck Under this schedule, the project finishing time (the duration of the project from the start of the first task to the completion of the last task) is 12 hours. We will use Fin to denote the finishing time, so we can write Fin = 12 hours.

The Mathematics of Scheduling Repairing a Wreck It looks better in schedule (b), but it violates the precedence relation A C (we cannot start task C until task A is completed).

The Mathematics of Scheduling Repairing a Wreck On the other hand, if we force P2 to be idle for one hour, waiting for the green light to start task C, we get a perfectly good schedule as shown in (c). Fin = 11 hours.

The Mathematics of Scheduling Repairing a Wreck Can we do better? No! The precedence relation A(4) C(7) implies that the 11 hours is a minimum barrier that we cannot break. Thus, the schedule in (c) is an optimal schedule and Fin = 11 hours is the optimal finishing time.

The Mathematics of Scheduling Repairing a Wreck From now on we will use Opt instead of Fin when we are referring to the optimal finishing time. Schedule (d) shows a different optimal schedule with finishing time Opt = 11 hours.

The Mathematics of Scheduling 8.2 Directed Graphs (DiGraphs)

The Mathematics of Scheduling A directed graph or digraph for short, is a graph in which the edges have a direction associated with them, typically indicated by an arrowhead. Digraphs are particularly useful when we want to describe asymmetric relationships (X related to Y does not imply that Y must be related to X).

The Mathematics of Scheduling The classic example of an asymmetric relationship is romantic love: Just because X is in love with Y, there is no guarantee that Y reciprocates that love. Given two individuals X and Y and some asymmetric relationship (say love), we have four possible scenarios:

The Mathematics of Scheduling Neither loves the other (a), X loves Y but Y does not love X (b), Y loves X but X does not love Y (c), and they love each other (d).

The Mathematics of Scheduling In a digraph, instead of talking about edges we talk about arcs. Every arc is defined by its starting and ending vertex. Thus, if we write XY, we are describing the arc in (b) as opposed to YX as shown in (c). A list of all the arcs is called the arc-set of a digraph A = {XY, YX}

The Mathematics of Scheduling Additional Terminology If XY is an arc in the digraph, we say that vertex X is incident to vertex Y, or equivalently, that Y is incident from X. The arc YZ is said to by adjacent to the arc XY if the starting point of YZ is the ending point of XY.

The Mathematics of Scheduling Additional Terminology Indegree and Outdegree. Outdegree of X is: the number of arcs that have X as their starting point (outgoing arcs). Indegree of X is: the number of arcs that have X as their ending point (incoming arcs).

Indegree and Outdegree

B C D E A E B C D A

The Mathematics of Scheduling 8.3 Scheduling with Priority Lists

The Mathematics of Scheduling A priority list is a list of all the tasks prioritized in the order we prefer to execute them. If task X comes before task Y in the priority list, then X gets priority over Y. This means that when it comes to a choice between the two, X is executed ahead of Y. However, if X is not yet ready for execution, we skip over it and move on to the first ready task after X in the priority list.

The Mathematics of Scheduling 8.4 The Decreasing-Time Algorithm

The Mathematics of Scheduling One first attempt to find a good priority list is to do the longer jobs first and leave the shorter jobs for last. A priority list where the tasks are listed in decreasing order of processing times is called a decreasing-time priority list, and the process of creating a schedule using a decreasing-time priority list is called decreasing-time algorithm.

The Mathematics of Scheduling To use the decreasing-time algorithm we first prioritize the 15 tasks in a decreasing-time priority list: AD(8), AP(7), IW(7), AW(6), FW(6), AF(5), IF(5), ID(5), IP(4), HU(4), PL(4), PU(3), PD(3), EU(2), IC (1)

The Mathematics of Scheduling Using the decreasing-time algorithm with N = 2 processors, we get the schedule shown above with project finishing time Fin = 42 hours.

The Mathematics of Scheduling 8.5 Critical Paths

The Mathematics of Scheduling Critical Paths and Critical Times For a given vertex X of a project digraph, the critical path for X is the path from X to END with longest processing time. (The processing time of a path is defined to be the sum of the processing times of all the vertices in the path.) When we add the processing times of all the tasks along the critical path for a vertex X, we get the critical time for X. (By definition, the critical time of END is 0.)

The Mathematics of Scheduling Critical Paths and Critical Times The path with longest processing time from START to END is called the critical path for the project, and the total processing time for this critical path is called the critical time for the project.

The Mathematics of Scheduling The Backflow Algorithm Step 1. Find the critical time for every vertex of the project digraph. This is done by starting at END and working backward toward START according to the following rule: critical time for X = processing time of X plus largest critical time among the vertices incident from X.

The Mathematics of Scheduling The Backflow Algorithm Step 2. Once we have the critical time for every vertex in the project digraph, critical paths are found by just following the path along largest critical times. In other words, the critical path for any vertex X (and that includes START) is obtained by starting at X and moving to the adjacent vertex with largest critical time, and from there to the adjacent vertex with largest critical time, and so on.

The Mathematics of Scheduling 8.6 The Critical- Path Algorithm

The Mathematics of Scheduling The concept of critical paths can be used to create very good schedules. The idea is to use critical times rather than processing times to prioritize the tasks. The priority list we obtain when we write the tasks in decreasing order of critical times (with ties broken randomly) is called the critical-time priority list, and the process of creating a schedule using the critical-time priority list is called the critical-path algorithm.

The Mathematics of Scheduling Critical-Path Algorithm Step 1 (Find critical times). Using the backflow algorithm, find the critical time for every task in the project. The critical times for each task are shown in red.

The Mathematics of Scheduling Critical-Path Algorithm Step 2 (Create priority list). Using the critical times obtained in Step 1, create the critical-time priority list. The critical-time priority list for the project is AP[34], AF[32], AW[28], IF[27], IW[22], AD[18], IP[15], PL[11], HU[11], ID[10], IC[7], FW[6], PU[5], PD[3], EU[2].

The Mathematics of Scheduling Critical-Path Algorithm Step 3 (Create schedule). Using the critical-time priority list obtained in Step 2, create the schedule. The timeline for the resulting schedule is given above. The project finishing time is Fin = 36 hours. This is a very good schedule, but it is not an optimal schedule.

The Mathematics of Scheduling Critical-Path Algorithm Step 3 (Continued). Using the critical-time priority list obtained in Step 2, create the schedule. The above figure shows the timeline for an optimal schedule with finishing time Opt = 35 hours. -Won’t always show the optimal.

The Mathematics of Scheduling 8.7 Scheduling with Independent Tasks

The Mathematics of Scheduling In this section, we will briefly discuss what happens to scheduling problems in the special case when there are no precedence relations to worry about. This situation arises whenever we are scheduling tasks that are all independent. There are no efficient optimal algorithms known for scheduling, even when the tasks are all independent.

The Mathematics of Scheduling In this case, we just assign the tasks to the processors as they become free in exactly the order given by the priority list. Second, without precedence relations, the critical-path time of a task equals its processing time. This means that the critical-time list and decreasing-time list are exactly the same list, and, therefore, the decreasing-time algorithm and the critical-path algorithm become one and the same.

The Mathematics of Scheduling The Relative Error If we know the optimal finishing time Opt, we can measure how “close” a particular schedule is being optimal using the concept of relative error. For a project with finishing time Fin, the relative error (denoted by ) is given by

The Mathematics of Scheduling Conclusion Precedence Relations Project Digraph Priority List Models Independent Tasks