## Cheapest Link and Kruskal's Algorithms

The *Cheapest-Link* and *Kruskal's* are similar algoritms that perform dissimilar tasks on *weighted graphs*. A *weighted graph* is a graph whose edges have been assigned numbers - their weights. Any weighted graph, in particular, a subgraph of a weighted graph, is also assigned weight - the sum of weights of all its edges.

### The Cheapest-Link Algorithm

- On every step mark the cheapest unmarked edge.
- See that the marked edges
- do not form circuits, except when algorithm has stopped,
- do not converge three at a vertex.

- Repeat 1 and 2 while possible.

### Kruskal's Algorithm

- On every step mark the cheapest unmarked edge.
- See that the marked edges do not form circuits.
- Repeat 1 and 2 while possible.

The Cheapest-Link algorithm leads to a Hamilton circuit, if any exists.

Kruskal's algorithm always leads to a *minimum spanning tree* of the given graph. A graph is a *tree* if (1) it's connected and (2) it has no circuits. A spanning tree of a graph is any of its subgraphs that contains all its vertices and is also a tree. A minimum spanning tree has the least weight among all spanning trees of the given graph.

(In the examples below, always click on the cheapest remaining unmarked edge.)

What if applet does not run? |

What if applet does not run? |

|Activities| |Contact| |Front page| |Contents| |Games|

Copyright © 1996-2018 Alexander Bogomolny63027407 |