Connected Network Reduction
This example visualizes a connected network of nodes and weighted edges, representing a graph loaded from a CSV file. It uses a force-directed layout with `d3.forceSimulation`, `d3.forceLink`, and `d3.forceManyBody` to position the nodes. When the user clicks and holds the mouse, the visualization highlights the minimum spanning tree (MST) of the graph, computed via Kruskal’s algorithm with a custom `DisjointSet` data structure. Edge thickness and color (black to red) encode weight, with the MST selectively dimming non-tree edges during interaction.
AI-generated descriptionKruskal's Algorithm may be used to find the minimum spanning tree of a given graph. Kruskal's algorithm relies on a disjoint-set data structure.
Click and hold to see the minimum spanning tree for original graph.
Thicker red lines have a higher weight associated with them than thinner black lines. The minimum spanning tree avoids including higher cost edges.
forked from <a href='http://bl.ocks.org/bmershon/'>bmershon</a>'s block: <a href='http://bl.ocks.org/bmershon/25a74f7b1c7cbd07e7456af1d2c07da1'>Minimum Spanning Tree</a>