Minimum Spanning Trees Flashcards

prim, generic minimu spanning tree (9 cards)

1
Q

what type of problems use MST ?

A

problems with roads anc cities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is the psdoeocde code for genric mst ?

A

GENERIC-MST.G; w/
A= empty queue
while A does not form a spanning tree
find an edge (u,v) that is safe for A
A = A U {(u,v)}
return A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is a safe edge ?

A

The edge connects two disconnected components of the graph.

Adding the edge will not create a cycle in the partial spanning tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

pedoucode for Prim’s

A

Prim(g,s,w)
Initlaize-single-source
r.key=0;
Q=G.V
While Q=empty
u = ExtractMin(Q)
for all v E G.Adj[u]
if v.key > w(u,v) & v E Q
v.pi=u
v.key=w(u,v)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Key Pair, Root Queue, Extract, Visit, Update

A

“Key Pair”: Initialize each vertex’s key to ∞ and predecessor (π) to NIL.

“Root”: Set the starting vertex (r) key to 0.

“Queue”: Add all vertices to the priority queue (Q).

“Extract”: Extract the minimum key vertex u from the queue.

“Visit”: For each neighbor v of u, check the edge condition (w(u, v) < v:key).

“Update”: If the edge is better, update v’s key and predecessor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

do example of page 656

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is running time of prim’s ?

A

O(E log V)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

prove path relatzation propety ?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is the covergence property ?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly