Download presentation
Presentation is loading. Please wait.
Published bySimon Cox Modified over 6 years ago
1
Redraw these graphs so that none of the line intersect except at the vertices
B C D E F G H
2
Planar Graphs Planar graph – any graph that can be redrawn so that none of the edges intersect except at the vertices. Any edge or vertex may be moved to create this new graph. No edges or vertices may be deleted or added to the graph. Every planar graph has a chromatic number that is less than or equal to four.
3
Bipartite Graph Bipartite – a graph whose vertices can be divided into two distinct sets so that each edge of the graph has one vertex in each set A D B E C
4
Complete Bipartite Graphs
Complete bipartite – a bipartite graph is complete if it can be separated into two distinct sets, every edges has one vertex in each set and all possible edges from one set to the other are drawn. W Q A B X Z C Y M This is a K graph This is a K graph 2,1 3,3
5
Drawing a graph as a bipartite graph
Draw these graphs as a bipartite graphs, if possible. B W X E C A F Y D V I Z G H
6
Complement Complement – the complement to a graph has all the same vertices as the original graph but is made up of all the edges NOT in the original. If the original graph is G, then the complement is denoted by G then this is the graph G If this is graph G The combination of a graph and its complement form what kind of graph?
7
Traveling Salesperson Problem (TSP)
These problems are a way to show, with a graph, the different Hamiltonian circuit that could be used on a map. The map may take into consideration distance, time, or cost when finding the “best” Hamiltonian circuit available. For each problem, you make a weighted tree to show each of the circuits and their weights.
8
Copy the following graph.
B C D 154 234 312 872 298 179 Now, make a weighted tree graph to represent all the circuits possible in this graph, starting at point B.
9
B A C D 154 312 234
10
Nearest-neighbor Method
As we add more and more vertices this method of making a weighted tree becomes more difficult because of the number of different circuits available. “Even with the help of a computer that can do computations at a rate of 1 billions per second, it would take more than 19 million years for the computer to find the weights of every circuit for a graph with 25 vertices.” Obviously, we do not have the time to work such problems and need a shorter way to find a comparable answer.
11
We will start at point B just as we did for the last problem.
C D 154 234 312 872 298 179 We will start at point B just as we did for the last problem. From B travel to the point that is nearest to point B. In this case it is point A.
12
Make the tree showing all the possible circuits and find the shortest circuit using the nearest-neighbors method. 18 A B C D 23 22 17 12 11
13
Finding the Shortest Route
When finding the shortest route it is not necessary to touch all of the point in the graph. It is like going on vacation to the beach, you just want to get there as fast as you can, you do not have to visit every city in-between here and your destination. F B Find the shortest route from A to G 3 8 4 7 G 7 A D 6 5 5 6 C E
14
Directional graphs Use the following table to create a directional graph and find the shortest route from A to G. To A B C D E F G A B C From D E F G
15
Trees Trees are used throughout the book to graph problems. We will use them in Chapter 6 with Probability and Chapter 7 with Game Theory as well as the remaining 3 sections of this chapter. Many computers use them in search and sorting algorithms. A tree is defined as a connected graph with no cycles. Remember: a connected graph mean there is at least one path between each pair of vertices A cycle in a graph is any path that begins and ends at the same vertex. A leaf is vertex with degree 1 A root is the term from the vertex at the beginning of a directed tree, where all edges are going away from that vertex
16
Not a tree, WHY? TREE Not a tree, WHY?
17
P. 240 example #14 Q J A 2 10 K 3 9 4 8 5 7 6 The numbers on the outside give you the vertices for your tree. The number on the inside give you where to draw the edges (which vertices are adjacent to each other).
18
Minimum Spanning Trees
B C D E F G H J K L M N Use a Breath-First search to create a minimum spanning tree. Begin the tree a point D.
19
A B (1) C D (0) E F G H J K L M N Begin by putting a zero over the point to begin at (point D) Shade in each edge that is connected to point D and place a one above each of the point adjacent to point D
20
Make a spanning tree starting at point C
J C B D E H G F
21
Minimum Spanning Tree 4 5 8 6 9 7 11 List all of the edges smallest to largest. 7 6
22
9 5 4 7 11 8 6 6 4 9 9 7 List all of the edges smallest to largest. 4
23
Find the minimum spanning tree and its weight.
B D 9 A 16 C 15 11 15 8 7 J E F 15 8 H 15 17 G
24
Evaluating an Expression Tree
Each vertex will either have a number or an operation on it. The edges will connect the numbers and the operation to be performed on those numbers. The numbers will always be to the right and left sides and the operation will be in the middle. Start at the bottom left side of the expression tree and perform the operation on the numbers. Work your way up the left side until you get the top and then do the same for the right side. There should always be two numbers on the outside and an operation in the middle, until you have only one number left
26
Reverse Polish Notation
This is a way to solve mathematical expressions quickly without having to worry about orders of operations. All numbers are single digits and positive UNLESS they are in parentheses. 1.) Look through the list and find the first mathematical symbol. 2.) Underline that symbol and the two numbers immediately before it. 3.) Perform the operation on the underlined numbers in the order they appear in the expression. 4.) The answer from step #3 and all other numbers and symbols are written in the same order. 5.) Repeat steps until only one number is left.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.