Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit – graph theory. Concept Characteristics What is a Graph……Really?

Similar presentations


Presentation on theme: "Unit – graph theory. Concept Characteristics What is a Graph……Really?"— Presentation transcript:

1 Unit – graph theory

2 Concept Characteristics What is a Graph……Really?

3 Graph Theory Learning Objectives— Part 1 You will understand how to model a project using graphs. You will be able to identify how many edges and vertices a graph has. You will be able to find the “critical path” of a project graph from start to finish and find Earliest Start Times for each task. You will be able to determine how much time it will take for a project to be complete.

4 Graphs:Vertices and Edges How many Edges does this graph have? How many vertices does this graph have? The vertices are “tasks” and the “ “edges” show the time the task takes.

5 Brushing your teeth If the “project” is brushing your teeth, what are the “tasks” that occur from start to finish? Tasks? Let’s make sure they are in order. Let’s draw a directed graph of these tasks…..

6 Imagine Name the things you do each morning before you get to school. Lets make a list The things you do to before you get to school are TASKS, and the preparation/tasks you do before arriving at school “are” the PROJECT. Is there a way to show your “project” using a graph? Is this graph linear?

7 Let’s take our list of things (tasks) you do before you arrive at school. Are there things that have to happen before other things? What if you can’t do task B before task A is complete? What would you have to do to show this in a graph? What if tasks A and B can be done simultaneously? What if you add tasks C & D that must be done after A is complete? What if you add task E that is dependent on task B & D?

8 Directed Graph A directed graph is a graphic way using vertices and edges to show the “path” or “paths” of a project leading from task to task. A “directed graph” from start to finish can be thought of as a “time line” from beginning to end…..

9 Example of a directed graph What can you guess from the graph below?

10 Project:Mowing the lawn WARM-UP:PUT THESE TASKS IN ORDER AND IDENTIFY ANY OF THE TASKS THAT CAN TAKE PLACE SIMULTANEOUSLY. TASKSTIME A.Picking up/ Clearing the lawn15 minutes B.Mowing the lawn45 minutes C.Gassing up the mower5 minutes D.Start mower3 minutes E.Getting mower out5 minutes F.Cleaning the mower off10 minutes G.Checking oil5 minutes H.Putting the mower away5 minutes

11 Graphing the Project Where do we start? What has to be done first? Can more than one thing be done first? What task(s) come next? From where? Next? Where to we end?

12 Practical Example of a project The Central High yearbook staff has only 16 days left before the deadline for completing their yearbook. They are running behind schedule and still have several tasks left to finish. The remaining tasks and time that it takes to complete each task are listed in the following table.

13 Yearbook Tasks Is it possible to complete the project if the tasks have to be done in order? TaskTime (in days) Start0 ABuy Film1 BLoad Camera1 CTake Club Photos3 DTake Sports Photos2 ETake Teacher Photos1 FDevelop Film2 GDesign the Layout5 HPrint and Mail Pages3

14 Yearbook Tasks What if some of the jobs can be done simultaneously? Draw a graph using arrows as edges representing a task being done and vertices as tasks. TaskTime (in days)Prerequisite Task Start0None ABuy Film1None BLoad Camera1A CTake Club Photos3B DTake Sports Photos2C ETake Teacher Photos 1B FDevelop Film2D, E GDesign the Layout5D, E HPrint and Mail Pages 3G, F

15 Graph the Tasks

16 You Practice TASKTIMEPREREQUISITES Start0--- A5NONE B6A C4A D4B E8B, C F4C G10D, E, F FINISH

17 One More TASKTIMEPREREQUISITES START0---- A4NONE B3A C1A D6A E2B F3C, D G3E H1E, F FINISH

18 Critical Path Critical path is defined as the shortest path that will take you to the completion of a project AND ensure that ALL tasks are completed as well. There’s an entire profession devoted to this called Project Management….

19 Critical Path Identify the Earliest Start Time for each task! Begin at the start Label each vertex with the smallest possible time needed for that task to begin based on the prerequisites. The critical path is actually the LONGEST path…..Why??????

20 Warm-up – Graph the Project Management Chart TASKTIMEPREREQUISITE START0---- A5NONE B8A, D C9B, I D7NONE E8B F12I G4C, E, F H9NONE I5D, H FINISH

21 Make a Chart of Tasks, Times and Prerequisites--- Homework Back

22 Make a Chart of Tasks, Times and Prerequisites TaskTimePrerequisites

23 Propulsion System of a Nuclear Submarine -- - Project Management Graph

24 Game Room Project--Partners Pretend you are planning to build a game room in your home. Sketch out what you want it to look like. List the tasks that need to be done to complete your project. Estimate the time it will take to do each task in your project. Determine if any task in your project is “dependent” on another part. From start to finish, draw a “directed graph” from start to finish…think of this as a “time line” from beginning to end….. Are there parts of your project that can be done simultaneously? If so, how do you show that graphically?

25 Let’s Find the Earliest Start Time

26 Graph and Find the Earliest start times for each task, Critical Path AND Minimum Time to completion for the project TaskTimePrerequisites Start0--- A13NONE B10NONE C4A D8B E6B F7C, D, E G5F H8F FINISH

27 Create the project chart and find the earlies start times and critical path

28 Warm-up Problem Create the Project Management Chart/Table. Find the Earliest Start Times for Each Task….. Calculate the minimum time needed to complete this project. What is the critical path?

29 Draw a Graph to Represent the Project Find the Critical Path AND Minimum Time TaskTimePerequisites Start0---- A2NONE B4 C3A, B D1 E5C, D F6 G7E, F

30 Partner Practice Create the Project Table. Find the Earliest Starting times for each task…

31 Game Room Project What Should Be Finished TODAY….By Thursday!! Sketch of your Game Room Finalize your Task List and Time Estimates Determine the prerequisite tasks for each task Create a Project Management Chart/Table with four columns Vertices Labels (alphabetical order) Task description Time for task Prerequisite(s)

32 Warm-Up

33 Review Problem TaskTimePrerequisites A5None B7A C3A D2B, C E8D Finish Draw the Graph based on the Chart Below….. Find the Earliest Start Times for Each Task….. Calculate the minimum time needed to complete this project. What is the critical path?

34 Worksheet #1

35 Worksheet #2

36 Worksheet #3

37 TASKTIMEPREREQUISITESE. S. T. START A B C D E F G H I J

38 Create the Project Management Chart/Table. Find the Earliest Start Times for Each Task….. Calculate the minimum time needed to complete this project. What is the critical path?

39 Warm-up Problem Create the Project Management Chart/Table. Find the Earliest Start Times for Each Task….. Calculate the minimum time needed to complete this project. What is the critical path?

40 Game Room Project What Should Be Finished TODAY…. Finalize your Task List and Time Estimates Determine the prerequisite tasks for each task Sketch of your Game Room Create a Project Management Chart/Table with four columns Vertices Labels (alphabetical order) Task description Time for task Prerequisite(s) Due in 30 minutes

41 WRITE DOWN THE WAYS THESE GRAPHS ARE SIMILAR WRITE DOWN THE WAYS THEY ARE DIFFERENT

42 Graph Theory Objectives—Part 2 Describe a graph as Complete or Not Complete and explain why or why not…. Find the “degree” or “valence” of a particular vertex in a graph…. What is a “loop”? What is a “multigraph”? Describe the relationship between objects or tasks based on a graph…. Connected vs Not Connected Adjacent vs Not Adjacent

43 So what is a graph really? A “Graph” is a set of points called vertices and their connecting lines called edges. We use graphs to model situations in which the vertices represent tasks or objects and the edges represent the relationship between the tasks or objects they connect. Other than the graphs we have been working with, what kind of graphs are you familiar with?

44 SORRY…..THERE ARE JUST SOME TERMS YOU NEED TO KNOW…….. Edge—a line segment/ray that connects tasks/objects and represents the relationship between the tasks/objects and (if applicable) the time required to do the preceding task. Vertex or Vertices—a vertex is a point on the graph where one or more edges converge and represents a task/object Connected Graph—a graph where there is a path between each pair of vertices Adjacent (Vertices)—two vertices that are connected by an edge Complete Graph—a graph in which every pair of vertices is adjacent

45 MORE TERMS…….. Degree (Valence) of a Vertex—the number of edges that have a specific vertex as an endpoint in a graph is known as the degree or valence of that vertex. When finding the degree of a vertex on which there is a loop, the loop is counted twice. Loop—is an edge that connects a vertex to itself Multigraph—if a graph contains a loop or multiple edges (more than one edge between two vertices), the graph is known as a multigraph.

46 So imagine you pick five students out of a crowd at a football game. Because you pick the five students randomly, it is possible there is no relationship between them at all. So the “graph” of the five and their relationships would just be five distinct points representing them as individuals. However, imagine if some of them are friends and you use “edges” to graph those relationships.

47 Degree of each vertex? Complete? Connected?

48 practice Problem Find the degree of each vertex. Is this a complete graph? Why or Why Not?

49 Practice Graphing Quinn bought six different types of fish. Some of the fish can live in the same aquarium, but others cannot. Guppies can live with Mollies, Swordtails can live with Guppies, Plecostomi can live with both Mollies and Guppies, Gold Rams can live with only Plecostomi, and Piranhas cannot live with any of the other fish. Draw a graph to illustrate this situation.

50 Warm-Up Exercise There are five permanent members of the United Nations Security Council: China, France, Russia, United Kingdom and the United States. There are also ten other members who are elected for two year terms: Angola, Egypt, Japan, Malaysia, New Zealand, Senegal, Spain, Ukraine, Uruguay and Venezuela. You are tasked with providing limousine transportation for one diplomat from each member from the UN building in New York City to a conference to discuss the “Syria situation” that is being held in Washington DC. Graph the scenario above based on the information in the next slide and use the graph to determine the minimum number of vehicles required to take all of the diplomats to the peace talks.

51 The US and United Kingdom diplomats have agreed they have no problem riding with any of the other members. Russia will only ride with Venezuela or Angola. China refuses to ride with Japan and Russia but will ride with any of the others. New Zealand will only ride with any of the African Group (Egypt, Senegal and Angola). France will ride with anybody. Uruguay is just happy to get a ride, but prefers to ride with it’s fellow Latin American member, Venezuela. Malaysia will only ride with China. Japan prefers to ride with anybody but China. Ukraine won’t ride with Russia or China, but prefers to ride with the US or United Kingdom. Egypt prefers to ride with the US or the United Kingdom but has agreed they would accept a ride with Japan and Spain. Spain has agreed they can ride with anybody.

52 Consider these graphs WHAT DO THEY REALLY TELL YOU?

53 Interpreting Sets that describe graphs Construct a graph representing the following sets of vertices and edges…. V = M, N, O, P, Q, R, S E = MN, SR, QS, SP, OP What is the valence of each vertex? Is your graph a “connected graph”? Why or why not? Is your graph a “complete graph”? Why or why not?

54 Set and Matrix Representation WE NEED A WAY TO DESCRIBE THE GRAPH ONE WAY IS BY NAMING THE VERTICES AND EDGES AS SETS Vertices = A, B, C, D, E Edges = AC, CB, CE, CD, BD, BE ANOTHER WAY IS WITH AN “Adjacency Matrix” – a matrix which uses a 1 to signify there is an edge between two vertices in a graph, and a 0 to indicate there is no edge.

55 Adjacency Matrix In an Adjacency Matrix, the rows and columns are labeled with the vertices of the graph…. A B C D E A00100A00100 B00111B00111 C11011C11011 D01100D01100 E01100E01100 ….and a 1 indicates there is an edge connecting the corresponding vertices…..what does a zero tell you???

56 Take a Look At These Two Graphs Create an Adjacency Matrix for These Graphs Then create a set representation of each graph

57 Warm-up Exercise How would this graph look using set representation? Create an adjacency matrix. Find the Degree of each Vertex

58 Practice going in the other direction Draw a graph represented by the following Adjacency Matrix ABCDE A00010 B00200C0 2011 D10101 E00112

59 Review Consider the graph below: How would you represent this graph using sets? How would you represent the graph using an adjacency matrix?

60 Game Room Project What Your FINAL Room Project Must Include…. Final Task List and Time Estimates and Prerequisites in a Project Management Chart Final Complete “in-color” scale drawing of your Room Project Management Graph Include Earliest Start Times Include a vertex for each task Include time for each task on edges Include Label for each vertex with a “key” to the labels Include the Critical Path for the Project Due at the end of the Period

61 REview B C H A I D J G F E What is the degree of each vertex? Is it a connected graph? Is the graph Complete?

62 REminder problem. Find the Earliest Start Times for Each Task….. Calculate the minimum time needed to complete this project. What is the critical path?

63 Accept the Challenge!!! Work in pairs to find a solution to the Konigsberg Challenge First group to find a solution and both members are able to explain the solution will receive five bonus points on the next quiz!!!

64 7 Bridges Problem https://www.youtube.com/watch?v=_OiZrmnni9Y

65 Practice In the graph below, determine if there is an Euler Path or an Euler Circuit and, if there is, find the path or circuit…..

66 2 POINTS

67 3 POINTS

68 4 POINTS

69 5 pOINTS

70 BEGIN WHEREVER YOU WANT BUT DRAW ONLY ONE LINE THROUGH ALL OF THE DOORS AND YOU CAN ONLY GO THROUGH EACH OF THE DOORS ONCE!!!!!!

71 Euler Path and Circuit /video https://www.youtube.com/watch?v=5M-m62qTR-s https://www.youtube.com/watch?v=REfC1-igKHQ

72 Euler Paths and Circuits A PATH that uses each edge of a graph exactly once and ends at the starting vertex is call an Euler Circuit. An EULER CIRCUIT contains vertices that all have “even” degrees. If a connected graph has exactly two odd vertices (degree), it is possible to use each edge of the graph exactly once but to end at a vertex different from the starting vertex. Such a path is called an EULER PATH.

73 Euler paths and circuits An Euler path is a path that uses every edge of a graph exactly once. An Euler circuit is a circuit that uses every edge of a graph exactly once. An Euler path starts and ends at different vertices. An Euler circuit starts and ends at the same vertex

74 Is There a Euler Path or Circuit? If so, can you find it? Degree of each vertex? Set Representation? Adjacency Matrix?

75 Activity:Map your day at school Create a map using the relative locations of each room, entrance way, or exit you visit each day you are at school. Remember that vertices in a graph are used to represent people, places, events or things. The edges represent the path you walk between each room, entrance way, or exit. Also, create a vertex for each hallway turn you take on your path each day. Find the degree of each vertex. Is your graph connected? Is it complete? This is due at the end of the period.

76 Reminder: Euler Path and Circuit /video https://www.youtube.com/watch?v=5M-m62qTR-s https://www.youtube.com/watch?v=REfC1-igKHQ

77 Euler Paths and Circuits A PATH that uses each edge of a graph exactly once and ends at the starting vertex is call an Euler Circuit. An EULER CIRCUIT contains vertices that all have “even” degrees. If a connected graph has exactly two odd vertices (degree), it is possible to use each edge of the graph exactly once but to end at a vertex different from the starting vertex. Such a path is called an EULER PATH.

78 Euler paths and circuits An Euler path is a path that uses every edge of a graph exactly once. An Euler circuit is a circuit that uses every edge of a graph exactly once. An Euler path starts and ends at different vertices. An Euler circuit starts and ends at the same vertex

79 Graphs With Direction There are many situations in the real world that graphs have a “direction” versus a path that can go in either direction. Can you think of an example? These are known as Digraphs. The vertices in a digraph still have “degrees” but beyond that, they have “indegrees” and “outdegrees.” Can you guess what that means?

80 digraphs A directed graph (or digraph) is a graph, or set of vertices connected by edges, where the edges have a direction associated with them.graph A directed graph is called a simple graph if it has no multiple arrows (two or more edges that connect the same two vertices) and no loops (edges that connect vertices to themselves). A directed graph is called a multigraph or multidigraph if it may have multiple arrows (and sometimes loops).simple graphmultigraph

81 For Example, the Digraph Below Vertices?Ordered Edges? Indegrees? Outdegrees?

82 So how does a digraph affect the Adjacency Matrix? The adjacency Matrix for this digraph is: AA B C A0 0 0 B B1 0 1 C0 0 0 C

83 find the Adjacency Matrix

84 Practice on Your Own Take a minute to draw a graph with six vertices and eight edges so that the graph has an Euler Circuit.

85 Practice Activity Create the digraph described by this adjacency matrix… ABCDE A01010 B10101 C00010 D01100 E10010

86 Is There a Euler Path or Circuit? If so, can you find it? Degree of each vertex? Set Representation? Adjacency Matrix?

87 How About Now? In a digraph, there is an Euler circuit if the indegree and outdegree of each vertex are equal. There is an Euler Path if: the indegree = the outdegree in all vertices but two & at one of those two vertices, the indegree is one greater than the outdegree & at the other vertex, the outdegree is one greater than the indegree

88 Is there an Euler path or Circuit? REMEMBER TO CHECK IN-DEGREES AND OUT-DEGREES FIRST! A B C DE F G H J


Download ppt "Unit – graph theory. Concept Characteristics What is a Graph……Really?"

Similar presentations


Ads by Google