Minimum Spanning Tree Calculator — Find the Cheapest Way to Connect a Graph
Our Minimum Spanning Tree Calculator finds the set of edges that connects every node in a weighted graph at the lowest possible total cost, using Kruskal's algorithm with union-find cycle detection, given your graph as a simple text edge list (e.g. A-B:4, B-C:2).
Quick Answer
Enter your weighted graph as an edge list to instantly find the minimum spanning tree — the cheapest set of edges connecting every node — via Kruskal's algorithm.
Enter weighted edges as NodeA-NodeB:weight, e.g. A-B:4, B-C:2.
How to Use the Minimum Spanning Tree Calculator — Kruskal's Algorithm Online
- 1
Enter your graph as a comma-separated edge list, e.g. A-B:4, B-C:2.
- 2
Click 'Calculate' to find the minimum spanning tree.
- 3
Review the selected edges and the total minimum weight.
Why Use Minimum Spanning Tree Calculator — Kruskal's Algorithm Online?
A minimum spanning tree connects every node in a graph using the fewest and cheapest possible edges, with no cycles — exactly the structure you'd want when designing a network (roads, pipelines, circuit wiring) that must reach every point at minimum total cost. Kruskal's algorithm finds it elegantly: sort all edges from cheapest to most expensive, and greedily add each edge that doesn't create a cycle, tracking connectivity efficiently with a union-find data structure. This greedy approach is provably optimal, and this calculator runs it directly on a graph you enter as a weighted edge list.
Frequently Asked Questions
Related Tools
Dijkstra's Shortest Path Calculator — Weighted Graphs Online
Find the shortest path and total distance between two nodes in a weighted graph using Dijkstra's algorithm. Free calculator with a simple edge-list input.
Adjacency Matrix Calculator — Build a Graph Matrix Online
Build and display the adjacency matrix of a graph from a simple edge-list input, along with its degree sequence. Free calculator, weighted or unweighted.
Graph Coloring Calculator — Welsh-Powell Algorithm Online
Color a graph's vertices so no two connected nodes share a color, using the greedy Welsh-Powell algorithm. Free calculator with a simple edge-list input.
Network Flow Calculator — Max Flow via Edmonds-Karp Online
Find the maximum flow from a source to a sink in a capacitated directed graph using the Edmonds-Karp algorithm. Free calculator with a simple edge-list input.