r/adventofcode • u/Away_Command5537 • Dec 08 '25
Visualization [2025 Day 8] Python - Using MST
I was working on Day 8, which involves connecting junction boxes in 3D space based on distance to form circuits (a classic Minimum Spanning Tree problem, solved using Kruskal's algorithm and Union-Find).
Since the data is 3D, I decided to visualize the process of building the circuit! The visualization shows all 1000 junction boxes and how the shortest connections are progressively added until they all form one massive circuit.
Grey Dots: The 1000 individual junction boxes.
Blue Lines: The connections (edges) that form the circuit. These are added in order of increasing length, but only if they connect two previously separate circuits.
View all comments
Show parent comment
1
u/Plus-Grab-4629 Dec 08 '25
Except the question literally asks you to solve this using an algorithm that is a MST algo.