ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2025 Day 10 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 10 of the Advent of Code - https://adventofcode.com/2025/day/10

18 REPLIES 18
Tokimatsu
12 - Quasar

I managed to solve it, but I'll think of another method later.

Spoiler
I'm using an optimization tool. I'll try to figure out how to solve it without this tool later.

スクリーンショット 2025-12-10 191250.png
スクリーンショット 2025-12-10 191352.png

スクリーンショット 2025-12-10 191404.png

DanFlint
8 - Asteroid

This works, but is in no way optimised. 

I'll have to come back to part 2 later

Spoiler
DanFlint_0-1765364524517.png


I think I'm probably reorganising the data too many times, but this gets a correct (but slow) answer.

Hub119
12 - Quasar
12 - Quasar

After not sleeping at all while working on an alternate Part 2 solve, posting this here in the meantime... will continue to delve into an alternate solve once I'm ever able to get some sleep...

Spoiler
AoC 2025 D10 Pic.png
Spoiler
P1 MacroP1 Macro
Spoiler
@AkimasaKajitani says this is allowed at least...
P2 Optimization MacroP2 Optimization Macro
ScottLewis
11 - Bolide

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.

DaisukeTsuchiya
14 - Magnetar
14 - Magnetar

Day 10 presented quite a challenging problem.

Spoiler

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.

スクリーンショット 2025-12-10 235551.jpg
<P1 Macro>
スクリーンショット 2025-12-10 235613.jpg
<P2 Macro>
スクリーンショット 2025-12-10 235647.jpg

 

Goddenra
8 - Asteroid

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 😂

Spoiler
Goddenra_0-1765383433838.png

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. 

Goddenra_1-1765383484398.png

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.

Goddenra_2-1765383542654.png

 

 

ScottLewis
11 - Bolide

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. 

Qiu
21 - Polaris
21 - Polaris

Since @AkimasaKajitani  @DaisukeTsuchiya and @Hub119 said it is acceptable to use Optimizaton tool, I will listen.

Spoiler
AoC 2025 Day 10.png
Stosh
7 - Meteor

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

Spoiler
Stosh_0-1765430783765.png

 

Part 1 Macro

Spoiler
Surprise! There are 2! Went for a nested macro.
Outer: 
Stosh_1-1765430893973.png

Inner:

Stosh_2-1765430953894.png

 

Part 2 Macro:

Spoiler
Stosh_3-1765431061588.png

 

 My Reflection:

Spoiler
This problem kicked my butt. Both parts were the hardest of their respective difficulty thus far, and it certainly showed in my solve time😂

I knew all along that this problem required some nested for-loop logic: One to handle the iterations of button presses for each machine and another to have it go one machine at a time. The outer macro simply sends one row of the machines into the inner macro per iteration. The inner macro begins with fully closed indicator cells and handles the on/off logic for each button press. Then, if no resulting indicator matches the final state, the current states are summarized to remove duplicates and appends to the buttons, and this handles every possibility. This wouldn't work if we needed to track the order of button presses, but all we care about is how many buttons are pressed, so we can gain some key efficiency that leads to a massive reduction in total records in the cases with more iterations than average. Once a current indicator state matches the final indicator, the macro completes. This runs pretty quickly (about 15 secs), which I am pleased with. 

Part 2 was like Part 1 with rabies. I did try to retrofit my above logic to solve this new problem, but the reality is many machines required hundreds of iterations at minimum and in the end we were looking at a flow that would perhaps take days to run. I looked around and saw people using the Optimization tool, so I decided to check it out. Admittedly, I was disappointed that I myself didn't realize that we were looking at a linear programming problem, as I remember covering them in college not too long ago (although none of my problems back then had 10+ variables😂) but once I realized that, it made me feel a lot more calm about the problem overall. I tried to configure the Optimization tool on my own using the documentation, but by god if that isn't a finnicky tool! I ended up downloading @Hub119 's workflow to get the hang of the naming conventions and data structure required for each input. That being said, our solutions are slightly different, as he handles all the data prep in the outer flow, whereas I do it within the macro itself. Honestly don't know why I made this decision, but I think it came down to me wanting my Part 2 outer workflow to be the same length as Part 1's to make for a nice screenshot😂 This one runs like a bear (25 minutes) but it gets me the answer, and at this point that's all I can ask for.

All in all, this was a crazy problem, and all I can say is I am just happy to see the gold star next to my name for this day. The upside now is that I do not have to wait at all for day 11 and can begin solving right away!
Labels
Top Solution Authors