Upload
brian-davidson
View
224
Download
0
Tags:
Embed Size (px)
Citation preview
DefinitionsDefinitions A graph consists of two types of elements, vertices and
edges. Every edge has two endpoints in the set of vertices, and connects or joins the two endpoints.
A cycle is edges connected that make a continuous circuit.
A graph consists of two types of elements, vertices and edges. Every edge has two endpoints in the set of vertices, and connects or joins the two endpoints.
A cycle is edges connected that make a continuous circuit.
Vertex
Edge
A vertex is simply drawn as point or dot. The vertex set of G is usually represented by V(G), or V when there is no danger of confusion. The order of a graph is the number of its vertices, for example, |V(G)|.
An edge is drawn as a line connecting two vertices, called end vertices. An edge with end vertices x and y is represented by xy. The edge set of G is usually written as E(G), or E when there is no possible confusion.
cycle
A bridge, or cut edge or isthmus, is an edge whose removal disconnects a graph, meaning there can only be one line connecting two vertices.
A tree is a connected graph that contains no cycles.
A bridge, or cut edge or isthmus, is an edge whose removal disconnects a graph, meaning there can only be one line connecting two vertices.
A tree is a connected graph that contains no cycles.
Bridge
tree
A weighted graph associates a label, a weight, with every edge found in the graph. Weights are usually listed as real numbers. The numbers are usually restricted to rational numbers or integers. Certain algorithms require further restrictions on weights.
Acyclic graph is a graph that contains no cycles.
A weighted graph associates a label, a weight, with every edge found in the graph. Weights are usually listed as real numbers. The numbers are usually restricted to rational numbers or integers. Certain algorithms require further restrictions on weights.
Acyclic graph is a graph that contains no cycles.
3
54
4
7
567
Weighted acyclic graph
The ProblemThe Problem
Our farm is installing a new irrigation system for a field. The well is located off the field and is the water source for the system. There is a need to find the amount of piping that will be used for the system. Each vertex represents a sprinkler head that provides water to the field. What is the minimum amount of piping that can be used for the field?
Our farm is installing a new irrigation system for a field. The well is located off the field and is the water source for the system. There is a need to find the amount of piping that will be used for the system. Each vertex represents a sprinkler head that provides water to the field. What is the minimum amount of piping that can be used for the field?
Total weight of the TreeTotal weight of the Tree
In order to find the total weight of the tree, add up the total of the weighted edges.
14+15+16+16+17+17+18+18+19+19+20+21+22+23+23+24+24+25+26+27+27+28+ 29+30=518
In order to find the total weight of the tree, add up the total of the weighted edges.
14+15+16+16+17+17+18+18+19+19+20+21+22+23+23+24+24+25+26+27+27+28+ 29+30=518
Minimal Spanning Tree Algorithm
Minimal Spanning Tree Algorithm
1. Each edge of the graph needs to be labeled, starting with the smallest amount weighted to the largest. (e1,e2,e3…en) weighted as:the weight of e1<e2<en
2. Start the graph sequence with e1.3. Continue with the next smallest
weighted edge, and continue until there is none left without making a circuit.
1. Each edge of the graph needs to be labeled, starting with the smallest amount weighted to the largest. (e1,e2,e3…en) weighted as:the weight of e1<e2<en
2. Start the graph sequence with e1.3. Continue with the next smallest
weighted edge, and continue until there is none left without making a circuit.
The Field (labeled weighted)
The Field (labeled weighted)
WELL
e5
e2
e8
e4e11e10e12
e14
e17
e1 e13 e18
e6
e19
e20
e24
e15
e22
e23 e21
e3e9e7
e16
The Field (removing unnecessary pipes)The Field (removing unnecessary pipes)
WELL
e5
e2
e8
e4e11e10e12
e14
e17
e1 e13 e18
e6
e15
e22
e21
e3e9e7
e16
The dotted lines are the lines that are unnecessary for the irrigation system, they are removed.
The Field as a Minimal Spanning Tree
The Field as a Minimal Spanning Tree
WELL
e5
e2
e8
e4e11e10e12
e14
e17
e1 e13 e18
e6
e15
e22
e21
e3e9e7
e16
Totaling the Minimal Spanning Tree
Totaling the Minimal Spanning Tree
14+15+16+16+17+17+18+18+19+19+20+21+22+23+23+24+24+25+27+28=406
The new total saves the farm 112 feet of piping, saving 21.62%
14+15+16+16+17+17+18+18+19+19+20+21+22+23+23+24+24+25+27+28=406
The new total saves the farm 112 feet of piping, saving 21.62%