Discussion thread for day 10 of the Advent of Code - https://adventofcode.com/2025/day/10
I managed to solve it, but I'll think of another method later.
This works, but is in no way optimised.
I'll have to come back to part 2 later
I think I'm probably reorganising the data too many times, but this gets a correct (but slow) answer.
Interested to see the first non-optimization solve what is really a classic linear programming problem.
I did something even worse than that because work reasons prohibit me from having predictive tools, so I built something to set up the optimization problem in Alteryx and then dumped to another LP tool.
For those of you joining for the first time this year, we usually get about one of these a year where the problem is not well suited for Base A and we learn by trying to hack rather than by doing things the "right" way. Be not discouraged and note that the posts before this one are some of the folks who are best at this hitting that same wall.
Day 10 presented quite a challenging problem.
For Part 1, I struggled considerably with how to structure the data, but ultimately, I converted it to a vertical format for processing. I suspect it might be possible to solve it more elegantly using tools like Regex.
Part 2 was tackled using an Optimization Tool, which took about 10 minutes to run. I couldn't come up with a solution without relying on the Optimization Tool, so I'm keen to learn from others' workflows to discover alternative approaches.
<P1 Macro>
<P2 Macro>
Same issue as everyone else with Part 2. Works fine for the test data, tried optimising a few ways but grinding slowly. Looking at the numbers I think there's a chance it'd run overnight.
Edit: Reader, it did not 😂
Part 1 Macro:
A bit of a blunt force approach. Set the light to on or off for all button combinations and repeat until one matches for that puzzle. Main issue here was figuring out what data I needed for the iteration.
Part 2 macro:
Initial build stopped after about 4 iterations due to liberal use of generating rows and summarising. Good lesson learned there. Solution works fine for the test data, does progress at a snails pace through the real data so am tempted to leave it running overnight, although I'll be interested to see if someone comes up with any clever solutions which don't use the magic optimisation box 😁
I need to upgrade my Alteryx to 2024 or later as FindNth formula would have made my formulas a whole lot easier and I could just check the strings against each other rather than having to split into multiple columns. Still quicker than splitting into rows and summarising though.
Spent a while working with @Goddenra 's Part 2 macro from the post below.
I believe it is a valid solution, if we ignore execution time.
I was able to get the macro about 50% faster (attached.) Which sounds like a lot but wow is that not anywhere close to enough. It can solve easy to medium individual machines but trying to do big ones, much less all of them at once, is a path to out of memory.
Reasonably confident that if there is an answer down this path it comes from some novel way to prune branches rather than just testing each one faster.
For Random extra fun I can't package (zip) the workflow. Throws an error about the Macro being created in a newer version and unlike when I'm opening it to work I can't just click through.
Since @AkimasaKajitani @DaisukeTsuchiya and @Hub119 said it is acceptable to use Optimizaton tool, I will listen.
Day 10 'complete'. Wow, just... wow. This was an insane problem! My Alteryx skills were stretched to the absolute maximum on this one.
Part 1 and 2 Flows
Part 1 Macro
Inner:
Part 2 Macro:
My Reflection:
