my presentation minimum spanning tree

33
MINIMUM SPANNING A Networking Model Report for DPA 702 QUANTITATIVE METHODS OF RESEARCH By: ALONA M. SALVA Cebu Technological University

Upload: lon-salva

Post on 15-May-2015

6.464 views

Category:

Business


0 download

DESCRIPTION

Networking models for quantitative methods of research

TRANSCRIPT

Page 1: My presentation minimum spanning tree

MINIMUM SPANNINGA Networking Model Report for

DPA 702 QUANTITATIVE METHODS OF

RESEARCHBy:

ALONA M. SALVACebu Technological University

Page 2: My presentation minimum spanning tree

Topics

Definitions & Networking Basics

MST AlgorithmsKruskalReverse DeletePrim

Brief HistoryImportance

Page 3: My presentation minimum spanning tree

Definitions & Networking Basics

Network models are created from two major building blocks: arcs (sometimes called edges), which are

connecting lines, and nodes, which are the connecting points

for the arcs. A graph is a structure that is built by

interconnecting nodes and arcs. A directed graph (often called a digraph)

is a graph in which the arcs have specified directions, as shown by arrowheads.

Finally, a network is a graph (or more commonly a digraph) in which the arcs have an associated flow.

Practical Optimization: A Gentle Introduction, John W. Chinneck, 2010http://www.sce.carleton.ca/faculty/chinneck/po.html

Page 4: My presentation minimum spanning tree

Practical Optimization: A Gentle Introduction, John W. Chinneck, 2010

Networking Basics

http://www.sce.carleton.ca/faculty/chinneck/po.html

A network is an arrangement of paths connected at various points, through which items move.

Introduction to Management Science, 9th ed, Bernard W. Taylor III, 2006

Page 5: My presentation minimum spanning tree

Definitions & Networking BasicsSome further definitions associated with graphs and networks:

chain: a sequence of arcs connecting two nodes i and j. For example, in Figure 8.1(a), we might connect nodes A and E via the chains ABCE or ADCE.

path: a sequence of directed arcs connecting two nodes. In this case, you must respect the arc directions. For example, in Figure 8.1(b), a path from A to E might be ABDE, but the chain ABCE is not a path because it traverses arc BC in the wrong direction.

cycle: a chain that connects a node to itself without any retracing.

Practical Optimization: A Gentle Introduction, John W. Chinneck, 2010http://www.sce.carleton.ca/faculty/chinneck/po.html

Page 6: My presentation minimum spanning tree

Definitions & Networking Basicsconnected graph (or connected network):

has just one part. In other words you can reach any node in the graph or network via a chain from any other node.

Practical Optimization: A Gentle Introduction, John W. Chinneck, 2010http://www.sce.carleton.ca/faculty/chinneck/po.html

Page 7: My presentation minimum spanning tree

Practical Optimization: A Gentle Introduction, John W. Chinneck, 2010http://www.sce.carleton.ca/faculty/chinneck/po.html

tree: a connected graph having no cycles. Some examples are shown in Figure 8.2(a).

Page 8: My presentation minimum spanning tree

Definitions

spanning tree: normally a tree selected from among the arcs in a graph or network so that all of the nodes in the tree are connected.

Practical Optimization: A Gentle Introduction, John W. Chinneck, 2010http://www.sce.carleton.ca/faculty/chinneck/po.html

Page 9: My presentation minimum spanning tree

Definitionsflow capacity: an upper (and sometimes

lower) limit on the amount of flow in an arc in a network. For example, the maximum flow rate of water in a pipe, or the maximum simultaneous number of calls on a telephone connection.

source (or source node): a node which introduces flow into a network. This happens at the boundary between the network under study and the external world.

sink (or sink node): a node which removes flow from a network. This happens at the boundary between the network under study and the external world.

Practical Optimization: A Gentle Introduction, John W. Chinneck, 2010http://www.sce.carleton.ca/faculty/chinneck/po.html

Page 10: My presentation minimum spanning tree

The Minimum Spanning Tree Problem

Given a graph in which the arcs are labeled with the distances between the nodes that they connect, find a spanning tree which has the minimum total length.

NO CYCLES ALLOWED!!ALGORITHMS – a problem solving

procedure following a set of rulesCycle- the nodes are connected by

more than one edge.

Practical Optimization: A Gentle Introduction, John W. Chinneck, 2010http://www.sce.carleton.ca/faculty/chinneck/po.html

Page 11: My presentation minimum spanning tree

Steps of the minimal spanning tree solution method:

1. Select any starting node (conventionally, node 1 is selected).

2. Select the node closest to the starting node to join the spanning tree.

3. Select the closest node not presently in the spanning tree.

4. Repeat step 3 until all nodes have joined the spanning tree.Introduction to Management Science, 9th ed, Bernard W. Taylor III, 2006

Page 12: My presentation minimum spanning tree

Practical Optimization: A Gentle Introduction, John W. Chinneck, 2010http://www.sce.carleton.ca/faculty/chinneck/po.html

Page 13: My presentation minimum spanning tree

What is an MST Algorithm

An MST algorithm is a way to show the shortest distance

There are many different algorithms:KruskalReverse DeletePrim

Introduction to Management Science, 9th ed, Bernard W. Taylor III, 2006

Page 14: My presentation minimum spanning tree

KRUSKAL’S ALGORITHM

1. Pick out the smallest edges

2. Repeat Step 1 as long as the edges selected does not create a cycle

3. When all nodes have been connected, you are done

http://www.slideshare.net/zhaokatherine/minimum-spanning-tree

Page 15: My presentation minimum spanning tree

REVERSE-DELETE ALGORITHM

This is the opposite of Kruskal’s algorithm

1. Start with all edges2. Delete the longest edge3. Continue deleting longest

edges as long as all nodes are connected and no cycles are formed

http://www.slideshare.net/zhaokatherine/minimum-spanning-tree

Page 16: My presentation minimum spanning tree

PRIM’S ALGORITHM

1. Pick out a nod2. Pick out the shortest

edge that is connected to your tree so far, as long as it doesn’t create a cycle

3. Continue this until all nodes are covered

http://www.slideshare.net/zhaokatherine/minimum-spanning-tree

Page 17: My presentation minimum spanning tree

17

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

The execution of Kruskal's algorithm (Moderate part)

•The edges are considered by the algorithm in sorted order by weight.

•The edge under consideration at each step is shown with a red weight number.

Page 18: My presentation minimum spanning tree

18

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

Page 19: My presentation minimum spanning tree

19

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

Page 20: My presentation minimum spanning tree

20

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

Page 21: My presentation minimum spanning tree

21

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

Page 22: My presentation minimum spanning tree

22

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

Page 23: My presentation minimum spanning tree

23

Prim's algorithm(basic part)

MST_PRIM(G,w,r)1. A={}2. S:={r} (r is an arbitrary node in V)3. Q=V-{r}; 4. while Q is not empty do {5 take an edge (u, v) such that (1) u S and v

Q (v S ) and (u, v) is the shortest edge satisfying (1)

6 add (u, v) to A, add v to S and delete v from Q

}

Page 24: My presentation minimum spanning tree

24

Prim's algorithm

MST_PRIM(G,w,r)1 for each u in Q do2 key[u]:=∞3 parent[u]:=NIL4 key[r]:=0; parent[r]=NIL;5 QV[Q]6 while Q!={} do7 u:=EXTRACT_MIN(Q); if parent[u]Nil print

(u, parent[u])8 for each v in Adj[u] do9 if v in Q and w(u,v)<key[v]10 then parent[v]:=u11 key[v]:=w(u,v)

Page 25: My presentation minimum spanning tree

25

Grow the minimum spanning tree from the root vertex r.

Q is a priority queue, holding all vertices that are not in the tree now.

key[v] is the minimum weight of any edge connecting v to a vertex in the tree.

parent[v] names the parent of v in the tree.

When the algorithm terminates, Q is empty; the minimum spanning tree A for G is thus A={(v,parent[v]):v∈V-{r}}.

Running time: O(||E||lg |V|).

Page 26: My presentation minimum spanning tree

26

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

The execution of Prim's algorithm(moderate part)

the root vertex

Page 27: My presentation minimum spanning tree

27

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

Page 28: My presentation minimum spanning tree

28

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

Page 29: My presentation minimum spanning tree

29

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

Page 30: My presentation minimum spanning tree

30

a

b

h

c d

e

fg

i

4

8 7

9

10

144

2

2

6

1

7

11

8

Bottleneck spanning tree: A spanning tree of G whose largest edge weight is minimum over all spanning trees of G. The value of the bottleneck spanning tree is the weight of the maximum-weight edge in T.

Theorem: A minimum spanning tree is also a bottleneck spanning tree. (Challenge problem)

Page 31: My presentation minimum spanning tree

MST’s

Kruskal (1956) and Prim (1957)

MST’s makes our life easier and we save money by using short paths

MST’s was first seen in Poland, France, the Czech Republic Slovakia, and Czechoslovakia

Page 32: My presentation minimum spanning tree

IMPORTANCE OF MST’S

1. We need it in computer science because it prevent loops in a switched network with redundant paths

2. It is one of the oldest and most basic graphs in theoritical computer science

http://www.slideshare.net/zhaokatherine/minimum-spanning-tree

Page 33: My presentation minimum spanning tree

Why we like MST’s

1. MST’s are fun to work with

2. It helps us find the shortest route

“The shortest distance between two people is a

sMILE.”