Download presentation

Presentation is loading. Please wait.

Published byJosiah Rencher Modified over 3 years ago

1
Discrete Maths Chapter 3: Minimum Connector Problems Lesson 1: Prim’s and Kruskal

2
Can we remember those trees…

3
A tree is a connected graph of some vertices which contains no cycles

5
A spanning tree is a connected graph of all vertices which contains no cycles

6
The minimum spanning tree is the spanning tree with the least weight Length of this tree is 19

7
The minimum spanning tree is the spanning tree with the least weight Can you find the least weight?

8
The minimum spanning tree is the spanning tree with the least weight The least weight is 15

9
The minimum spanning tree is the spanning tree with the least weight The least weight is 15

10
Notes A tree (a connected graph with no cycles) which connects all the nodes together is called a Spanning Tree For any connected graph with n nodes, each spanning tree will have n - 1 arcs The Minimum Spanning Tree is the one with the Minimum weight

11
More Notes Prim’s Algorithm is a quick way of finding the Minimum Spanning Tree (or minimum connector) This algorithm is said to be “greedy” since it picks the immediate best option available without taking into account the long-term consequences of the choices made. Kruskal’s Algorithm may also be used to find a minimum spanning tree, but this considers the weights themselves rather than the connecting points

12
Prim’s Algorithm Step 1: Select any node to be the first node of T. Step 2: Consider the arcs which connect nodes in T to nodes outside T. Pick the one with minimum weight. Add this arc and the extra node to T. (If there are two or more arcs of minimum weight, choose any one of them.) Step 3: Repeat Step 2 until T contains every node of the graph. Aim: To find a minimum spanning tree T

13
Kruskal’s Algorithm Step 1: Choose the arc of least weight. Step 2: Choose from those arcs remaining the arc of least weight which does not form a cycle with already chosen arcs. (If there are several such arcs, choose one arbitrarily.) Step 3: Repeat Step 2 until n – 1 arcs have been chosen. Aim: To find a minimum spanning tree for a connected graph with n nodes:

14
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

15
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

16
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

17
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

18
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

19
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

20
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

21
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

22
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

23
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

24
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

25
Cardiff Sheffield Nottingham Oxford Southampton Bristol Shrewsbury Liverpool Aberystwyth B/ham Manchester 50 40 30 80 70 80 50 90 50 110 70 120 110 70 100

Similar presentations

OK

Graph Algorithms Mathematical Structures for Computer Science Chapter 6 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesGraph Algorithms.

Graph Algorithms Mathematical Structures for Computer Science Chapter 6 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesGraph Algorithms.

© 2018 SlidePlayer.com Inc.

All rights reserved.

To ensure the functioning of the site, we use **cookies**. We share information about your activities on the site with our partners and Google partners: social networks and companies engaged in advertising and web analytics. For more information, see the Privacy Policy and Google Privacy & Terms.
Your consent to our cookies if you continue to use this website.

Ads by Google

Ppt on unity in diversity shoes Ppt on motion force and pressure for class 9 Ppt on chapter life processes for class 10th Ppt on intellectual property act Ppt on team building process Ppt on life history of bill gates Ppt on english grammar tenses Ppt on current indian economy 2012 Ppt on pre-ignition piston Download ppt on mind controlled robotic arms for humans