1 / 153

A Mathematical View of Our World

A Mathematical View of Our World. 1 st ed. Parks, Musser, Trimpe, Maurer, and Maurer. Chapter 7. Scheduling. Section 7.1 Basic Concepts of Scheduling. Goals Study project scheduling Study tasks Find finishing times Study weighted digraphs Study maximal paths Find critical times.

lang
Download Presentation

A Mathematical View of Our World

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Mathematical View of Our World 1st ed. Parks, Musser, Trimpe, Maurer, and Maurer

  2. Chapter 7 Scheduling

  3. Section 7.1Basic Concepts of Scheduling • Goals • Study project scheduling • Study tasks • Find finishing times • Study weighted digraphs • Study maximal paths • Find critical times

  4. 7.1 Initial Problem • A model railroad club is preparing for an open house. • Estimate the minimum preparation time required. • The solution will be given at the end of the section.

  5. Tasks • A project consists of 2 or more smaller activities called tasks. • A task cannot be broken into smaller jobs. • A task is done by 1 machine or 1 person. • The amount of time needed to complete a project depends on: • How many people or machines are available to do the work. • How the tasks are assigned.

  6. Example 1 • A group of college students are making lasagna. • Divide the project into tasks.

  7. Example 1, cont’d • Solution: A possible list of tasks is given.

  8. Tasks, cont’d • The people or machines performing the tasks are called processors. • The amount of time it takes to perform a task is called its completion time.

  9. Tasks, cont’d • If one task must be completed before another task can be started, we say the tasks have a precedence relation or order requirement between them. • Tasks that may be done in any order are called independent. • One way to represent a precedence relation between 2 tasks is to use points to denote the tasks and an arrow to indicate the relationship.

  10. Example 2 • The tasks of putting on socks and putting on shoes have a preference relation.

  11. Example 2, cont’d • The tasks of putting on a hat and putting on a coat do not have a preference relation. These are independent tasks.

  12. Question: Choose the list of tasks that has no preference relations. a. bake the pizza, grate some cheese, make pizza sauce b. fold some clothes, wash some clothes, hang clothes on the line to dry c. bake the cake, toss the green salad, set the table d. frost the cake, bake the cake, set the table

  13. Digraphs • A collection of points (tasks) and straight or curved arrows (precedence relations) connecting them is called a directed graph or digraph. • A point in a digraph is called a vertex. • An arrow in a digraph is called an arc.

  14. Example 3 • Use a digraph to represent the precedence relations for a man dressing to go for a run in the summer. • The tasks consist of putting on: • A Shirt • Shoes • Shorts • Socks

  15. Example 3, cont’d • Solution: Determine if there are any order requirements among the tasks. • Socks must be put on before shoes. • It is much easier to put on shorts before shoes. • The shirt can be put on at any point in the process.

  16. Example 3, cont’d • Solution, cont’d: A possible digraph is shown below.

  17. Digraphs, cont’d • A digraph that contains at least one precedence relation is called an order-requirement digraph. • A vertex in a digraph with no arcs attached to it is said to be isolated.

  18. Digraphs, cont’d • Example: • The digraph from the previous example problem is an order-requirement digraph. • Vertex “put on shirt” is isolated.

  19. Example 4 • Construct an order-requirement digraph for the tasks of: • Making blackberry jam • Making blackberry cobbler • Picking blackberries

  20. Example 4, cont’d • Solution: • The berries must be picked first. • The jam and cobbler can be made in any order.

  21. Example 5 • Construct an order-requirement digraph for the tasks of: • Putting on socks • Putting on a sweatshirt • Putting on snow pants • Putting on a hat • Putting on boots • Strapping on a snowboard

  22. Example 5, cont’d • Solution: • The socks probably go on before the pants. • The pants go on before the boots. • The boots go on before the snowboard. • The sweatshirt goes on before the coat. • The hat can be put on at any point.

  23. Example 5, cont’d • Solution, cont’d: The digraph is shown below.

  24. Paths • Any list of 2 or more vertices connected by arrows such that the list goes in the same direction as the arcs in the corresponding digraph is called a directed path. • Because we consider only directed paths, we simply call the list a path.

  25. Example 6 • Identify all possible paths in the order-requirement digraph representing a simple version of the project of replacing old brake shoes.

  26. Example 6, cont’d • Solution: There are 6 possible paths.

  27. Paths, cont’d • A path that cannot be extended by adding a vertex at either end is called a maximal path. • In the previous example, the maximal paths were:

  28. Sources and Sinks • A vertex in a digraph that is at the end of no arc is called a source. • A vertex in a digraph that is at the start of no arc is called a sink. • An isolated vertex is both a source and a sink. • A maximal path starts at a source and ends at a sink.

  29. Sources and Sinks, cont’d • In this digraph from the previous example, • Vertex T1 is a source. • Vertex T4 is a sink.

  30. Question: Identify all sources and sinks. a. Sources: put on socks; Sinks: put on hat b. Sources: put on hat, put on coat, strap on snowboard; Sinks: put on socks, put on sweatshirt c. Sources: put on hat; Sinks: put on socks d. Sources: put on socks, put on sweatshirt; Sinks: put on hat, put on coat, strap on snowboard

  31. Finding all Maximal Paths • To find all maximal paths in a digraph: • Locate all the sinks that are not isolated vertices. • Locate all the sources that are not isolated vertices.

  32. Finding Maximal Paths, cont’d • For each source, follow the arcs until you reach a sink. • If there is more than one arc at any vertex along the path formed in Step 3, start again at the same source and choose a different route.

  33. Question: Which path listed below is not a maximal path? a. put on hat b. put on pants, put on boots c. put on sweatshirt, put on coat d. put on socks, put on pants, put on boots, strap on snowboard

  34. Example 7 • Identify all maximal paths in the digraph.

  35. Example 7, cont’d • Solution: • There is only one sink: T6 • There is only one source: T1

  36. Example 7, cont’d • Solution, cont’d: • A maximal path from T1 to T6 is • Another maximal path from T1 to T6 is

  37. Example 8 • Identify all maximal paths in the digraph.

  38. Example 8, cont’d • Solution: • There is only one sink: T10

  39. Example 8, cont’d • Solution, cont’d: • There are 4 sources: T1, T4 , T6, and T8.

  40. Example 8, cont’d • Solution, cont’d: • There are 4 maximal paths:

  41. Weighted Digraphs • The completion time associated with a vertex (task) is the weight of the vertex. • A digraph with weights at each vertex is called a weighted digraph. • For example: This weighted digraph shows that it takes 20 seconds to put on sock and 25 seconds to put on shoes.

  42. Example 9 • Construct a weighted digraph.

  43. Example 9, cont’d • Solution:

  44. Project Finishing Time • The time from the beginning of a project until the end of the project is called the finishing time for the project. • The finishing time depends on: • The task completion times. • The number of processors available. • How the processors are scheduled. • Whether or not some tasks can be done at the same time.

  45. Example 10 • If only one processor works on the lasagna project, what is the finishing time?

  46. Example 10, cont’d • Solution: We assume the processor can only perform one task at a time. • Add up all the task completion times: 10 + 5 + 30 + 10 + 10 + 2 + 6 + 7 + 8 + 30 = 118 minutes. • It will take one processor almost 2 hours to finish the project.

  47. Weighted Digraphs, cont’d • The weight of a path in a weighted order-requirement digraph is the sum of the weights at the vertices on the path. • A critical path in an order-requirement digraph is a path having the largest possible weight. • The weight of a critical path is called the critical time for the project.

  48. Weighted Digraphs, cont’d • Any critical path must be a maximal path. • To find the critical paths: • Find all the maximal paths. • Select the maximal path(s) with the largest weight.

  49. Example 11 • Find a critical path in the lasagna project digraph.

  50. Example 11, cont’d • Solution: Previously we found 4 maximal paths.

More Related