Graph Editor
Spanning Trees • Matching • Trails

Kruskal & Prim MST, Bipartite & Eulerian Path Visualizer

Paste any weighted or unweighted graph and inspect Minimum Spanning Tree edge selection (Kruskal DSU vs Prim Priority Queue), Bipartite 2-coloring, Kuhn Maximum Bipartite Matching, and Hierholzer Eulerian Trails interactively.

Algorithm Summary

Algorithm Complexity Visual Tracer Highlight
Kruskal's MST O(E log E) Inspects sorted edges in weight order, showing accepted tree edges vs skipped DSU cycle edges
Prim's MST O((V + E) log V) Expands the frontier from a root vertex across minimum cut edges
Bipartite Check O(V + E) 2-colors vertices into Set A and Set B, flagging odd-cycle conflict edges cleanly
Kuhn's Matching O(V · E) Finds augmenting paths between bipartite partitions to maximize matched pairs
Hierholzer Eulerian Trail O(V + E) Traces edge-by-edge Eulerian paths or closed circuits

Sample Weighted MST Input

1 2 4
1 3 2
2 3 1
2 4 5
3 5 7
4 5 3
4 6 6
5 6 2

Frequently Asked Questions

What is the difference between Kruskal and Prim MST?

Kruskal sorts all edges and merges disjoint components with Union-Find; Prim grows one tree outward using the minimum cut edge from a root vertex.

How can I arrange a bipartite graph cleanly?

Use the top toolbar Layout selector and choose Bipartite to split vertices into two aligned columns automatically.

What happens if a graph is disconnected during Kruskal MST?

Kruskal finds the Minimum Spanning Forest across all connected components cleanly.