





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Detailed traces of execution for prim's and dijkstra's algorithms on different graphs. It includes the node and edge lists, min heap or sorted edge list, and sets as edges accepted. The algorithms are used to find the minimum spanning tree and single-source shortest path spanning tree respectively.
Typology: Study notes
1 / 9
This page cannot be seen from the preview
Don't miss anything!
A B C^ D E F G
Note: This graph has a shape somewhat similar to the one for assignment 9, but the different edges and different edge weights will make Prim’s Algorithm behave very differently on this graph than it does on the homework assignment. Node and Edge List:
B off: AC(2) | AG(5) — then enter BC(6), BE(1), BF(5)
E off: AC(2) | BF(5) BC(6) | AG(5) — then enter EF(3)
C off: EF(3) | BF(5) BC(6) | AG(5) — then enter CD(1), CF(2)
D off: CF(2) | EF(3) BC(6) | AG(5) BF(5) — then enter DF(2), DG(1)
G off: DF(2) | EF(3) CF(2) | AG(5) BF(5) BC(6) — then enter GF(1)
A B C^ D E F G
A B C^ D E F G
Note: This graph has a shape somewhat similar to the one for assignment 9, but the different edges and different edge weights will make Dijkstra’s Algorithm behave very differently on this graph than it does on the homework assignment. Node and Edge List:
B off: AC(2) | AG(5) — then toss BC(6>2), enter BE(1), BF(5)
C off: BE(2) | AG(5) BF(6) — then enter cD(3), cF(4<6)
E off: CD(3) | CF(4) BF(6) | AG(5) — then toss eF(5>4)
D off: CF(4) | AG(5) BF(6) — then add dG(4<5)
F off: DG(4) | AG(5) BF(6) — then toss fG(5=5)
1 1 2 1 2 1 A B C D E F G
Prim's Minimum Spanning Tree Algorithm
Node A, edges to: G(6) F(2) B(1) Node B, edges to: E(4) D(2) C(1) A(1) Node C, edges to: E(4) B(1) Node D, edges to: F(1) E(2) B(2) Node E, edges to: L(4) G(1) F(2) D(2) C(4) B(4) Node F, edges to: L(2) E(2) D(1) A(2) Node G, edges to: L(5) J(1) H(3) E(1) A(6) Node H, edges to: I(2) G(3) Node I, edges to: K(1) H(2) Node J, edges to: M(2) L(3) K(1) G(1) Node K, edges to: J(1) I(1) Node L, edges to: M(1) J(3) G(5) F(2) E(4) Node M, edges to: L(1) J(2)
Nodes processed from A to M || Nodes processed from M to A Lists as shown | Lists Flipped || Lists as shown | Lists Flipped A->B (1) | A->B (1) || M->L (1) | M->L (1) B->C (1) | B->C (1) || M->J (2) | M->J (2) B->D (2) | B->D (2) || J->K (1) | J->G (1) D->F (1) | D->F (1) || J->G (1) | J->K (1) D->E (2) | D->E (2) || K->I (1) | G->E (1) E->G (1) | E->G (1) || G->E (1) | K->I (1) G->J (1) | G->J (1) || I->H (2) | E->D (2) J->K (1) | J->K (1) || L->F (2) | D->F (1) K->I (1) | K->I (1) || F->D (1) | D->B (2) F->L (2) | J->M (2) || F->A (2) | B->A (1) L->M (1) | M->L (1) || A->B (1) | B->C (1) I->H (2) | I->H (2) || B->C (1) | I->H (2)
CScD-320, Algorithms Kruskal’s Algorithm — Detailed Traces of Execution A B C D 3 1 1 1 2
Node A, edges to: B(3) C(1) Node B, edges to: A(3) C(1) D(1) Node C, edges to: A(1) B(1) D(2) Node D, edges to: B(1) C(2)
Sets as Edges Accepted:
A B C^ D E F G
Node A, edges to: B(1) C(2) G(5) Node B, edges to: A(1) C(6) E(1) F(5) Node C, edges to: A(2) B(6) D(1) F(2) Node D, edges to: C(1) F(2) G(1) Node E, edges to: B(1) F(3) Node F, edges to: B(5) C(2) D(2) E(3) G(1) Node G, edges to: A(5) D(1) F(1)
Sets as Edges Accepted:
Node and Edge List:
Sorted Edge List: