© Nuffield Foundation 2011 Nuffield Free-Standing Mathematics Activity Cable TV.

Slides:



Advertisements
Similar presentations
Decision Maths Networks Kruskals Algorithm Wiltshire Networks A Network is a weighted graph, which just means there is a number associated with each.
Advertisements

Lecture 15. Graph Algorithms
Decision Maths Dijkstra’s Algorithm.
Networks Prim’s Algorithm
Discrete Math for Computer Science. Mathematical Model Real-world Problem Computerized Solution Abstract Model Transformed Model picture of the real worldpicture.
Discrete Maths Chapter 3: Minimum Connector Problems Lesson 1: Prim’s and Kruskal.
MINIMAL CONNECTOR PROBLEMS Problem: A cable TV company is installing a system of cables to connect all the towns in a region. The numbers in the network.
The Minimum Connector Problem: Finding the shortest way to link all the vertices in a graph. Method: Find a minimum spanning tree An example would be joining.
Prim’s Algorithm from a matrix A cable TV company is installing a system of cables to connect all the towns in the region. The numbers in the network are.
Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network using the lowest possible.
7.3 Kruskal’s Algorithm. Kruskal’s Algorithm was developed by JOSEPH KRUSKAL.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
Minimum-Cost Spanning Tree weighted connected undirected graph spanning tree cost of spanning tree is sum of edge costs find spanning tree that has minimum.
3/29/05Tucker, Sec Applied Combinatorics, 4th Ed. Alan Tucker Section 4.2 Minimal Spanning Trees Prepared by Amanda Dargie and Michele Fretta.
Algorithms on graphs In Decision Mathematics, a graph consists of points (called vertices or nodes) which are connected by lines (edges or arcs). Eg in.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Minimum Spanning Trees What is a MST (Minimum Spanning Tree) and how to find it with Prim’s algorithm and Kruskal’s algorithm.
Minimum Spanning Tree Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
WEIGHTED GRAPHS. Weighted Graphs zGraph G = (V,E) such that there are weights/costs associated with each edge Õw((a,b)): cost of edge (a,b) Õrepresentation:
Minimum spanning trees Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network.
Module 5 – Networks and Decision Mathematics Chapter 23 – Undirected Graphs.
The travelling Salesman problem involves visiting every town (node) on a graph and returning to the start in the shortest distance. The slides will show.
Dear teacher, We wanted to apologize for the technical issues that EDpuzzle has experienced today. We have teachers in our team and understand how frustrating.
Minimum spanning trees Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network.
Spanning Trees CSIT 402 Data Structures II 1. 2 Two Algorithms Prim: (build tree incrementally) – Pick lower cost edge connected to known (incomplete)
Minimum Spanning Trees CS 146 Prof. Sin-Min Lee Regina Wang.
TSP – Upper Bounds and Lower Bounds Initial problem : Upper Bound A salesman based in Stockton needs to visit shops based in Darlington, Billingham, Middlesbrough,
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
© Nuffield Foundation 2012 Nuffield Free-Standing Mathematics Activity Networks © Rudolf Stricker.
Trees Dr. Yasir Ali. A graph is called a tree if, and only if, it is circuit-free and connected. A graph is called a forest if, and only if, it is circuit-free.
CSC2100B Tutorial 10 Graph Jianye Hao.
CSCI2100 Data Structures Tutorial 12
Minimum Spanning tree Prim’s algorithm 1.Select any vertex 2.Select the shortest edge connected to that vertex 3.Select the shortest edge which connects.
Prims Algorithm for finding a minimum spanning tree
Lecture 19 Minimal Spanning Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Graph Revisited Fei Chen CSCI2100B Data Structures Tutorial 12 1.
AS Decision Maths Tips for each Topic. Kruskal and Prim What examiner’s are looking for A table of values in the order that they are added and the total.
MATRIX FORM OF PRIM’S ALGORITHM. This network may be described using a Distance Matrix.
Minimum Spanning Trees
Nuffield Free-Standing Mathematics Activity
Minimum Spanning Tree Chapter 13.6.
Kruskal’s Algorithm Elaicca Ronna Ordoña. A cable company want to connect five villages to their network which currently extends to the market town of.
Graph Algorithm.
Minimum-Cost Spanning Tree
Spanning Trees.
Minimum Spanning Tree.
Minimum Spanning Trees
Minimum Spanning Tree.
CSE 373 Data Structures and Algorithms
Shortest Path.
Minimum-Cost Spanning Tree
Warm Up – Friday.
Minimum-Cost Spanning Tree
What’s this?. What’s this? Which is more effective? Why?
Example A cable company want to connect five villages to their network which currently extends to the market town of Avonford. What is the minimum.
Minimum spanning trees
Minimum spanning trees
CSCI2100 Data Structures Tutorial
Minimum spanning trees
Networks Kruskal’s Algorithm
Minimum Spanning tree Select any vertex
CSE 373: Data Structures and Algorithms
Kruskal’s Idea Adding one edge at a time Non-decreasing order No cycle
CSC 380: Design and Analysis of Algorithms
Networks Prim’s Algorithm
Minimum spanning trees
Minimum Spanning Trees (MSTs)
Prim’s algorithm for minimum spanning trees
Spanning Tree.
Minimum-Cost Spanning Tree
Presentation transcript:

© Nuffield Foundation 2011 Nuffield Free-Standing Mathematics Activity Cable TV

Ramsey Laxey Bride Ballaugh Kirk Michael Peel St Johns Douglas Castletown Port Erin The Isle of Man A Cable TV company wants to connect all the towns shown on the map. Cable TV The company wants to use the minimum length of cable. This is called a minimum connector problem This activity is about solving minimum connector problems

To solve the problem you need to find a spanning tree of minimum length. A spanning tree is a tree that connects all the vertices together. A minimum spanning tree is a spanning tree of minimum length. Think about How many edges will there be in a minimum spanning tree that connects n vertices?

Kruskals Algorithm Step 1List the edges in order of increasing length. Step 2 Start with the shortest edge. Step 3 From the remaining edges, select the shortest edge which does not form a cycle. (If there are 2 shortest edges choose either.) Step 4 Repeat Step 3 until all the vertices are connected.

Peel to St Johns2.7 Edges in order of increasing length: Ballaugh to Kirk Michael2.8 Bride to Ramsey4.6 Castletown to Port Erin4.7 Ballaugh to Ramsey6.5 Kirk Michael to Peel6.8 Douglas to Laxey7.7 Kirk Michael to St Johns7.4 Douglas to St Johns 8.2 Ballaugh to Bride Castletown to St Johns 9.3 Laxey to Ramsey Castletown to Douglas10.2 Peel to Port Erin13.9 Douglas to Ramsey15.4

Ramsey Laxey Bride Ballaugh Kirk Michael Douglas Castletown Port Erin The Isle of Man 4.7 Peel St Johns Total length = 53.3 miles Peel to St Johns 2.7 Ball to K Michael 2.8 Bride to Ramsey 4.6 Castletown to Port Erin 4.7 Ballaugh to Ramsey 6.5 Kirk Michael to Peel 6.8 Douglas to Laxey 7.7 Douglas to St Johns 8.2 Castletown to St Johns 9.3

Prims Algorithm The method can be carried out using an adjacency matrix. Step 1 Starting from any vertex, join it to the nearest adjacent vertex. Step 2 Join the next nearest vertex to those already included, provided this does not form a cycle. Step 3 Repeat Step 2 until all the vertices are included.

Writing the network as an adjacency network: B1B1 B1B1 B2B2 C D K L P1P1 P2P2 R S B2B2 CDKLP1P1 P2P2 RS

Starting from any vertex – say B 1 : B1B1 B1B1 B2B2 C D K L P1P1 P2P2 R S B2B2 CDKLP1P1 P2P2 RS

Prims Algorithm results in the same minimum spanning tree, but the order the edges are added to the tree is different Ballaugh to Kirk Michael2.8 Ballaugh to Ramsey6.5 Ramsey to Bride4.6 Kirk Michael to Peel6.8 Peel to St Johns2.7 St Johns to Douglas8.2 Douglas to Laxey7.7 St Johns to Castletown9.3 Castletown to Port Erin4.7

Ramsey Laxey Bride Ballaugh Kirk Michael Douglas Castletown Port Erin The Isle of Man 4.7 Peel St Johns Total length = = 53.3 miles Think about Can you explain how the matrix method works? Which method do you prefer? Why? What else would need to be considered in the real situation?

© Nuffield Foundation 2011 Cable TV Reflect on your work What are the advantages or disadvantages of Kruskals and Prims algorithms? What other sorts of things might need to be considered in a real situation? How many edges will there be in the minimum spanning tree of a network with n vertices?