Networks Kruskal’s Algorithm

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

Decision Maths Dijkstra’s Algorithm.
Networks Prim’s Algorithm
Minimum Spanning Tree Sarah Brubaker Tuesday 4/22/8.
Discrete Maths Chapter 3: Minimum Connector Problems Lesson 1: Prim’s and Kruskal.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
3.3 Spanning Trees Tucker, Applied Combinatorics, Section 3.3, by Patti Bodkin and Tamsen Hunter.
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.
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:
Chapter 7 Network Flow Models.
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 What is a MST (Minimum Spanning Tree) and how to find it with Prim’s algorithm and Kruskal’s algorithm.
Midwestern State University Minimum Spanning Trees Definition of MST Generic MST algorithm Kruskal's algorithm Prim's algorithm 1.
Copyright © Cengage Learning. All rights reserved.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Minimum spanning trees Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network.
Networks.
Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University.
Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University.
Spring 2015 Mathematics in Management Science Network Problems Networks & Trees Minimum Networks Spanning Trees Minimum Spanning Trees.
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.
Minimum spanning trees Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network.
Minimum Spanning Trees Prof. Sin-Min Lee Dept. of Computer Science, San Jose State University.
Prim's Algorithm This algorithm starts with one node. It then, one by one, adds a node that is unconnected to the new graph to the new graph, each time.
Spanning Trees. A spanning tree for a connected, undirected graph G is a graph S consisting of the nodes of G together with enough edges of G such that:
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.
Chapter 9 Finding the Optimum 9.1 Finding the Best Tree.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
Graphs. Introduction Graphs are a collection of vertices and edges Graphs are a collection of vertices and edges The solid circles are the vertices A,
Graphs 1 Neil Ghani University of Strathclyde. Where are we …. We studied lists: * Searching and sorting a list Then we studied trees: * Efficient search.
Minimum Spanning Trees
COMP108 Algorithmic Foundations Greedy methods
May 12th – Minimum Spanning Trees
Minimum Spanning Tree Chapter 13.6.
Spanning Trees.
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.
Chapter 2: Business Efficiency Lesson Plan
CSCE350 Algorithms and Data Structure
Spanning Trees.
Minimum Spanning Trees
Visualizing Prim’s MST Algorithm Used to Trace the Algorithm in Class
Minimum Spanning Tree.
Graphs & Graph Algorithms 2
Graphs Chapter 13.
CSE373: Data Structures & Algorithms Lecture 12: Minimum Spanning Trees Catie Baker Spring 2015.
CSE373: Data Structures & Algorithms Lecture 20: Minimum Spanning Trees Linda Shapiro Spring 2016.
Decision Maths Dijkstra’s Algorithm.
Graphs Chapter 11 Objectives Upon completion you will be able to:
Minimum Spanning Trees
Spanning Trees.
4-4 Graph Theory Trees.
Louisiana Travels.
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
CSE332: Data Abstractions Lecture 18: Minimum Spanning Trees
AB AC AD AE AF 5 ways If you used AB, then, there would be 4 remaining ODD vertices (C, D, E and F) CD CE CF 3 ways If you used CD, then, there.
Minimum spanning trees
Minimum spanning trees
CSE 373: Data Structures and Algorithms
Networks Prim’s Algorithm
Graphs.
Minimum spanning trees
Minimum Spanning Trees (MSTs)
Kruskal’s Algorithm AQR.
CSE 373: Data Structures and Algorithms
7 The Mathematics of Networks
Presentation transcript:

Networks Kruskal’s Algorithm Decision Maths Networks Kruskal’s Algorithm

Networks A Network is a weighted graph, which just means there is a number associated with each edge. The numbers can represent distances, costs, times in real world applications. Obvious examples include maps and similar geographical networks.

Networks

Minimum Connector Problem Basically you need to travel to every node using the least total length. Consider 4 houses in a Network shown in the diagram below. The weight on each arc represents the distance between each house. An Electricity company wants to supply every house by using as little cable as possible. Clearly the shortest possible route is to go from A to B to C and then to D. So 4 + 3 + 3 = 10, there is no shorter way of supplying every house.

Algorithms The previous example was a simple one and the solution was very easy to spot. For more complicated examples you will need to use an algorithm. An Algorithm is simply a list of instructions that solve a particular problem. (You will cover Algorithms in more depth later on in the course)

Kruskal`s Algorithm There are 3 steps to follow in Kruskal`s Algorithm. Step 1 – Select the shortest arc in the network. Step 2 – Select the shortest arc from those which are remaining. Ensure that you do not create a cycle. If you do ignore and move on to the next shortest arc. Step 3 – If all the vertices are connected then stop. If not return to step 2.

Example Consider the Network below. It helps to rank the arcs in increasing order.

Applying the Algorithm 1 – Start by selecting the smallest arc, AB or DE, it makes no difference. Select AB.

Applying the Algorithm 2 – Now select the next smallest, which is DE.

Applying The Algorithm 3 – Next we can select CF or ` DF, again it makes no difference. Lets pick DF.

Applying the Algorithm. Next select CF.

Applying the Algorithm The next smallest length is EF. However there is already a route from E to F, so this arc is not required.

Applying the Algorithm Adding CD will again create a loop so the last arc to add is AF. All vertices are now joined so the problem is complete.

Question – Ex 3a pg 66 q1 Find the minimal spanning tree and associated shortest distance for the network below:

Solution – Ex 3a pg 66 q1

Solution – Ex 3a pg 66 q1

Solution – Ex 3a pg 66 q1

Solution – Ex 3a pg 66 q1

Solution – Ex 3a pg 66 q1

Solution – Ex 3a pg 66 q1

Solution – Ex 3a pg 66 q1

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4

Solution – Ex 3a pg 66 q4