Minimum spanning network

Find a minimum-cost spanning tree, or a minimum spanning forest when the supplied undirected graph is disconnected.

The example value has been entered. Check it immediately or change the value.

Input is processed in the browser. Refreshing returns a sample value.

Result

Instructions and example

Kruskal: visit edges in ascending cost and select only edges joining different components.

The default 4-node graph selects edge rows 1,2,3 for total cost 6 and 1 connected component.

Use 2–50 nodes, at most 200 edges and integer costs 0–1,000,000. Self-loops are rejected; parallel edges are allowed. Physical network suitability is not assessed. Floating-point results display at most 12 significant digits.

Frequently asked questions

Does a disconnected graph fail?

The result is a minimum forest with a component count. More than 1 component means the full network is not connected.

Is a minimum spanning tree a shortest path?

No. It minimizes the total edges needed to connect all nodes, not the distance between a particular source and destination.

Calculation criteria and reference materials

Verification of calculation criteria: · Calculation·verification principles · Report errors