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 8 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

25 REPLIES 25
gawa
16 - Nebula
16 - Nebula

I don't think my WF is not so optimized that I admit there is a room for improvement, but I'm satisfied with Macro-less solution at the end.

Spoiler
gawa_0-1765173565328.png

For Part2, all of connection ID are memorized as string by using the Multi-row formula tool, and check first record that contains all of junction boxes.
Even using my powerful computer, it takes 2 minutes. I wanna see other solution for learning wise algorithm.
While total 499,500 connections are there, target result is hit at very early examination, that is 4,765th. My WF should have some waste calculation, though I don't figure out how to get rid of them yet.

Hub119
12 - Quasar
12 - Quasar

I did my very best to try and make this problem WAY more complicated than it needed to be for both Parts 1 and 2...

Spoiler
Turns out my original simple part 2 was just due to dumb luck working with my input... so went back and built a proper (but longer to run) solution:
AoC 2025 D8 Pic.pngAoC 2025 D8 Macro Pic.png

 

DaisukeTsuchiya
14 - Magnetar
14 - Magnetar

Day 8 was a problem I really enjoyed.

Spoiler
  • For P1, I generated all possible pairs, calculated their distances, and then took the 1,000 shortest pairs. I used the Make Group Tool to group them into circuits.
  • For P2, I needed to find how many pairs it would take to form a single group. I first used trial and error to narrow down the range to 4,600-4,700 connections. After that, I used a Batch Macro to identify the exact number of pairs needed.
  • Since I ran the workflow on this narrowed range, the processing time was 4 seconds.

    スクリーンショット 2025-12-08 154024.jpgスクリーンショット 2025-12-08 154048.jpg

 

CoG
14 - Magnetar

Wow! Seeing non-macro solutions is incredible! I built a macro today to solve via Binary Search algorithm!

 

Spoiler
Part 1 is very easily solved with the Make Groups Tool!
Screenshot.png

For Part 2, I built a binary search algorithm macro. For speed I solved with manual binary search. Screenshot Macro.png

Happy Solving!

Raj
16 - Nebula

solved p1

Tokimatsu
12 - Quasar

It's been resolved, but I expect a smarter solution for the Day 8.

Spoiler

In part 2, I thought that by evaluating at the midpoint and discarding the branch with no solution, we could explore half the cases at a time and likely find the answer in far fewer than 50 loops. I also confirmed that processing all combinations in the grouping tool took only seconds.

After that, it took time to implement the desired logic and correctly set the completion condition for the iterration macro.

I briefly considered whether manually narrowing down the likely solution range and then checking that range might be faster. However, since it seemed possible to manage without building a highly data-dependent workflow, I decided against that approach.


スクリーンショット 2025-12-08 162707.png

スクリーンショット 2025-12-08 162717.png




Raj
16 - Nebula

Solved without macro

Goddenra
8 - Asteroid

Well, it's solved. Not pretty. Impressed by the non-macro solutions!

DanFlint
8 - Asteroid

Back on track today

Spoiler
Thanks goodness the "Make Groups" tools exists!
Spoiler
DanFlint_0-1765189935037.png
DanFlint_1-1765189957533.png


Basically ran the same logic through an iterative macro.
I dropped the coordinates early in part 1, so rather than change part 1 I just join them back on to my phase 2 macro outputs.
I could probably have made the iterative macro run less iterations, but this works.

Labels
Top Solution Authors