Decision 1 Unit 3 Flashcards
0
Q
How to find a minimum spanning tree with using Kruskal’s algorithm
A
- Write a list of all arcs and their weights starting with the smallest. Choose the smallest arc.
- Choose from the remaining arcs the arc of the least weight which will not form a cycle with already chosen arcs.
- Repeat until every node is used.
1
Q
How to find a minimum spanning tree using Prim’s algorithm
A
- Select any node to be the first node.
- Look at all connecting arcs and choose the one with the smallest number. Connect the nodes.
- Repeat, using the smallest numbered arc from any node, until every node is used.
2
Q
How to find a minimum spanning tree using Prim’s algorithm for a matrix
A
- Select any node
- Number the node’s column and delete/cross out that row.
- Circle the smallest number in any used column that isn’t crossed out.
- Repeat until ever column is used.