Chapter 9: Graphs Scheduling Networks Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms Graph Algorithms
Advertisements

CS 253: Algorithms Chapter 22 Graphs Credit: Dr. George Bebis.
Analysis of Algorithms CS 477/677
Chapter 9: Graphs Topological Sort
Chapter 9: Graphs Shortest Paths
D1: Critical Events And Critical Paths. D1: Critical Events And Paths A critical path is the list of activities on an activity network that, if they are.
CSC 2300 Data Structures & Algorithms April 13, 2007 Chapter 9. Graph Algorithms.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 22.
Lecture 17 Path Algebra Matrix multiplication of adjacency matrices of directed graphs give important information about the graphs. Manipulating these.
CSE 2331/5331 Topic 11: Basic Graph Alg. Representations Undirected graph Directed graph Topological sort.
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Breadth-First and Depth-First Search
Chapter 8, Part I Graph Algorithms.
Graphs Chapter 30 Carrano, Data Structures and Abstractions with Java, Second Edition, (c) 2007 Pearson Education, Inc. All rights reserved X.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 CHAPTER 4 - PART 2 GRAPHS 1.
Module 5 – Networks and Decision Mathematics Chapter 24 – Directed Graphs.
ITEC200 – Week 12 Graphs. 2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study.
1 Representing Graphs. 2 Adjacency Matrix Suppose we have a graph G with n nodes. The adjacency matrix is the n x n matrix A=[a ij ] with: a ij = 1 if.
Graphs Chapter 30 Slides by Steve Armstrong LeTourneau University Longview, TX  2007,  Prentice Hall.
Chapter 9: Graphs Summary Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
Chapter 7: Sorting Algorithms Heap Sort Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Chapter 2: Algorithm Analysis Application of Big-Oh to program analysis Running Time Calculations Lydia Sinapova, Simpson College Mark Allen Weiss: Data.
Applications of Depth-First Search
Chapter 4: Trees AVL Trees Lydia Sinapova, Simpson College Mark Allen Weiss: Data Structures and Algorithm Analysis in Java.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
Graphs & Graph Algorithms Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Chapter 4: Trees Binary Search Trees
Graphs Chapter 28 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
CS/ENGRD 2110 Object-Oriented Programming and Data Structures Fall 2014 Doug James Lecture 17: Graphs.
Chapter 6: Priority Queues
Chapter 9: Graphs Basic Concepts
Chapter 9: Graphs Spanning Trees Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
CS2420: Lecture 36 Vladimir Kulyukin Computer Science Department Utah State University.
Computer Science 112 Fundamentals of Programming II Graph Algorithms.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
1 Chapter 9 Graph Algorithms Real-life graph problems Algorithms for some graph problems Choice of data structures for graph problems.
Chapter 2 Graph Algorithms.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
Irwin/McGraw-Hill © The McGraw-Hill Companies, Inc., 1999 PROJECT MANAGEMENT 18-1 Project Management.
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
Pipelining and Retiming
Graphs. Graphs Similar to the graphs you’ve known since the 5 th grade: line graphs, bar graphs, etc., but more general. Those mathematical graphs are.
Graphs Chapter Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First.
Topic 12 Graphs 1. Graphs Definition: Two types:
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
Graphs Chapter 28 © 2015 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures and Abstractions with Java, 4e Frank Carrano.
15B Critical path analysis. In a critical path analysis, edges represent activities. Nodes (vertices) represent the end of one activity and the start.
Graphs and Paths Data Structures & Problem Solving Using JAVA Second Edition Mark Allen Weiss Chapter 14 © 2002 Addison Wesley.
Main Index Contents 11 Main Index Contents Graph Categories Graph Categories Example of Digraph Example of Digraph Connectedness of Digraph Connectedness.
Chapter 7: Sorting Algorithms Insertion Sort Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Topological Sort. Sorting technique over DAGs (Directed Acyclic Graphs) It creates a linear sequence (ordering) for the nodes such that: –If u has an.
IE 366 Chapter 6, Section 10 Project Planning and Scheduling.
Chapter 3. Decompositions of Graphs
Topological Sort.
Topological Sort.
"Learning how to learn is life's most important skill. " - Tony Buzan
PERT - The Program Evaluation and Review Technique
CS223 Advanced Data Structures and Algorithms
Lecture 4 Graph Search.
Chapter 9: Graphs Basic Concepts
Activity Networks
Activity Networks
Chapter 9: Graphs Basic Concepts
Chapter 9: Graphs Shortest Paths
Chapter 9: Graphs Spanning Trees
Presentation transcript:

Chapter 9: Graphs Scheduling Networks Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College

2 Scheduling Networks  Definitions  Purpose of the Model  Algorithm  Critical Activities  Complexity  Example

3 Definitions A project can be described by its activities, their duration and the prerequisites of each activity Activity: a task, characterized by: duration prerequisites – other tasks that have to be completed in order to start the current task Event: a point in time, characterized by the completion of one or several activities

4 The Model Directed simple acyclic graph Nodes: events Source: starting event Sink: terminating event Edges: activities Each edge is labeled by a pair (name of the task, duration), duration  0 Simple graph means: each pair of nodes connected by at most one edge

5 Purpose of the Model  Find the earliest occurrence time (EOT) of an event  Find the earliest completion time (ECT) of an activity  Find the slack of an activity: how much the activity can be delayed without delaying the project  Find the critical activities: must be completed on time in order not to delay the project

6 EOT and ECT Earliest occurrence time of an event EOT(source) = 0 EOT( j ) = max ( ECTs of all activities preceding the event) Earliest completion time of an activity ECT( j, k ) = EOT( j ) + duration( j, k)

7 Algorithm to Compute EOT and ECT 1. Sort the nodes topologically 2. For each event j : initialize EOT(j) = 0 3. For each event i in topological order For each event j adjacent from i : ECT(i,j) = EOT(i) + duration (i,j) EOT(j) = max(EOT(j), ECT(i,j))

8 Algorithm to find the slack of activities Compute latest occurrence time LOT(j), slack(i, j) 1. InitializeLOT(sink) = EOT(sink) 2. For each non-sink event i in the reverse topological order: LOT(i) = min(LOT( j ) – duration( i, j)) 3. For each activity (i,j) slack( i, j ) = LOT( j ) – ECT( i, j)

9 Critical Activities, Complexity Critical activities: slack(j) = 0 Critical path in the project: all edges are activities with slack = 0 The critical path is found using breadth-first (or depth-first) search on the edges Complexity: O(V + E) with adjacency lists, O(V 2 ) with adjacency matrix

10 Example d / 2 a / 2 f / b / 1 e / 10 g / 9 c / 11 h / 4 Topological sort: 1, 4, 2, 3, 5, 6 Critical Path: 1, 4, 2, 5, 6