Skip to content

Latest commit

 

History

History
92 lines (82 loc) · 5.61 KB

README.md

File metadata and controls

92 lines (82 loc) · 5.61 KB
Advent of Code

These are my solutions to the annual Advent of Code challenge.

Goals

  • No AI. Every line in this repository was written by hand. It's not that I'm against using AI for software development (in fact, I use it heavily for my work), but in my opinion, Advent of Code is about solving problems, and it's no fun if you let some machine solve those problems for you.
  • Implement everything in Rust. Because I love it!
  • Find generalized solutions that work with every input.
  • Avoid 3rd party dependencies (if possible and reasonable). Exceptions are rustc-hash (because it's just too fast), rayon for parallelization (only in rare cases!), and any crate necessary to do occasional terminal visualizations.
  • Try to optimize performance (to the best of my knowledge, if it doesn't conflict with the other goals, and if it doesn't obscure the solution too much).
  • Find clever solutions to complex problems that others might not have found. Some highlights I'm particularly proud of:
    • Day 10 of 2025: While most people approached this problem using a solver (such as S3 or good_lp), I found a solution that works completely without a 3rd party dependency. I implemented a DFS in which I use heuristics to prune as many branches as possible. This is definitely not the fastest approach possible, but it gets the job done in reasonable time and is certainly quite unique. See my Reddit comment for more information.
    • Day 25 of 2023: Using Brandes' algorithm to quickly calculate the betweenness centrality of graph nodes.
    • Day 21 of 2023: Applying bit operations to simulate the cellular automaton, which allowed me to implement a fast and generalized solution that should work on any input (unlike most other approaches).
    • Day 25 of 2018: Combining DBSCAN with a spatial index based on Morton indices. Very fast and scalable!
    • Day 25 of 2017: Fast Turing machine simulation using memoized macro transitions over fixed-size blocks inspired by tape compression and the linear speedup theorem.

Terminal visualizations

I've created terminal visualizations of some puzzles for fun:


2025 - Day 12:
Christmas Tree Farm

2025 - Day 4:
Printing Department

2024 - Day 15:
Warehouse Woes

2019 - Day 13:
Care Package

2018 - Day 18:
Settlers of The North Pole

2018 - Day 17:
Reservoir Research

2018 - Day 15:
Beverage Bandits

2017 - Day 22:
Sporifica Virus

2016 - Day 22:
Grid Computing

2016 - Day 8:
Two-Factor Authentication

2015 - Day 18:
Like a GIF For Your Yard

If you want to visualize your own input with my code, just change into the solution's directory (e.g. cd 2025/day12) and run the following command:

cargo run --release --features=visualize

License

The solutions are released under the MIT license. See the LICENSE file for more information.