Janne Mattila

From programmer to programmer -- Programming just for the fun of it

My Advent of Code 2024 visualizations

Posted on: December 27, 2024

This year I wanted to continue the tradition from last year and share my visualizations for Advent of Code 2024.

Day 6

Traditional map visualization:

Day 14

Day 14 was fun since I first didn’t quite understand how to find the Easter egg. Therefore, I started creating the visualization just to find out that by accident I managed to see flash of this Christmas tree when my animation was running:

Here is the full animation:

Day 15

Warehouse robot pushing boxes around:

Day 23

Immediately, when I saw this puzzle, I thought that I have to use graphs to understand it better. So, I created a few illustrations using Mermaid and GraphvizOnline from the example dataset:

This illustration helped me to to understand that I’m looking for largest full mesh in the network:

Much easier to implement when you have clear picture what to do!

Day 24

It was clear from the start that part 2 is not going to be solvable for me without graph illustrations.

I started with just overview diagram (it really is humongous!):

Adding colors made it slightly more easier to study:

Here is GraphViz version of the graph:

Snippet from the above mermaid diagram:

stateDiagram-v2
    classDef red fill:#f00,color:white,font-weight:bold,stroke-width:2px,stroke:yellow
    classDef green fill:#0f0,color:white,font-weight:bold,stroke-width:2px,stroke:yellow
    classDef white fill:#fff,color:black,font-weight:bold,stroke-width:2px,stroke:yellow
    classDef blue fill:#00f,color:white,font-weight:bold,stroke-width:2px,stroke:yellow
    class smr green
    class z03 blue
    class qhs green
    class tvv green
    class cph white
    class gws white
    class hgj white
    class nnt white
    class npf white
    class z13 white
    class z19 white
    class z33 white

    y41 --> smr
    x41 --> smr
    bsj --> z03
    hgq --> z03

But none of my visualizations were even close to the ones created by the community members:

[2024 Day 24 (Part 2)] Some improvement in my visualization

[2024 Day24 (Part 2)] Visualisation before and after swaps

[2024 Day 24] Narrowing Down The Culprits

They also contain some incredible solutions like this as an example.

I ended up by running the calculation and always stop to first bit that did not produce the correct value. I then studied the graph and tried to find correct wires to swap. Here is the first fix to correct the z09 value:

Here is the second fix to correct value in z13:

Third fix for z19:

And last fix for z33:

Community visualizations

There are lively discussions in the community around the solutions. People help each other out and explain their solutions so that others can benefit from them.

https://www.reddit.com/r/adventofcode

As every year, many people have built amazing visualizations around these puzzles.

I picked a few examples:

[2024 Day 16] Optimal Path Finding

500 ⭐ in less than a second

[2024 Day 25] [Python] Terminal Visualization!

In closing

Again, I want to give a big shout out to Eric Wastl for creating 10th Advent of Code event:

Every year it manages to surprise me how well arranged event it is and how amazing puzzles you get to solve during December.

Already waiting for next year. See you there!