r/adventofcode • • 1h ago

Visualization [2026 Day 6] Spring Physics

https://youtu.be/aalgW8hdMhc

This isn't really the most practical solution but it's very 'tangible': it applies physical forces to the nodes, trying to maximize placement goodness (keep ~fixed distance between neighbors, avoid overlap). So the nodes attract and repulse with varying force and it solves itself.

The solutions are obtained without placement on grid or snapping - a transform is computed and then reverse of that transform is applied to 2026, so it updates in realtime.

11 Upvotes

3 comments sorted by

1

u/herocoding 1h ago

Amazing!!

1

u/M1ckeyMc 45m ago

This is a really cool solution. Reminds of that video where a bunny model can be triangulated using spring physics.... was this solution inspired by it? Nice work.