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
patrick_digan
17 - Castor
17 - Castor
Spoiler
Make Group is such a useful tool for problems like this. For part 2 I relied on guess/check. 
image.png
martinson
11 - Bolide

I saved over my part 1 🎻

Spoiler
martinson_0-1765200082255.pngmartinson_1-1765200112259.png

 

 

Cheers,
martinson

LinkedIN

Bulien
AkimasaKajitani
17 - Castor
17 - Castor

I couldn't do it in real time today so I took my time.

 

My solution is macro solution. The difference between Part 1 and 2 is only ending condition. 

And for the first time, I used the concatenate distinct option in the Summarize tool.

 

Spoiler
It took 17 seconds for Part 1 and 1 minutes 54 seconds for P2.

P2 needed for 4939 iterations.

AoC_2025_08_10.png

Part 1 macro:
AoC_2025_08_7.png

Part 2 macro:

AoC_2025_08_8.png

 

mmontgomery
11 - Bolide
11 - Bolide

Day 8

Spoiler
Make Group Make Group Make Group!

This tool really helped, as it's fantastic at connecting elements in a chain.
P1: Calculate Straight Line Distance (SQRT (x-x1)^2+(y-y1)^2+(z-z1)^2) then sort by top 10 rows then have make group determine the pairs. Count em and sort by top 3
P2: Keep adding IDs, which are sorted from nearest to far, then determine how many keys from the make group match the list of all IDs. Keep going until all IDs appear in one group. I have filters to test for total groups, when we need 1 and to make sure each element is part of that group. Took me just under 5k iterationsDay8P2.jpgDay8.jpg
AkimasaKajitani
17 - Castor
17 - Castor

I create another solution inspired by @DaisukeTsuchiya . I created the workflow which will stop when the answer comes using Iterative macro.

 

Spoiler
AkimasaKajitani_0-1765203806461.png
AkimasaKajitani_1-1765203828130.png

 

 

Hub119
12 - Quasar
12 - Quasar

Went back and rebuilt my Part 2 solution implementing my version of the approach that @CoG took... SOOO much faster.

Spoiler
Updated SolveUpdated Solve
Spoiler
Binary Search MacroBinary Search Macro
ScottLewis
11 - Bolide

First one in a while where I have something exciting to talk about. No special insight on Part1 but if you're stuck on Part2 the spoiler below will drastically simplify the problem.

 

Part 1, Dual Macro solution, not that different from the others. Possible I need to lean about make group. I like to solve problems like this with nested iterative Macros where the inner one assembles a group and the outer one handles removing that group from the data. That way I get to use iteration.count to enumerate the sets in the out macro and the inner macro doesn't have to keep track of anything except "find every node connected to this one." Single Macro solution is faster, but I find the nested Macros easy to build, especially when I'm tired and this problem didn't seem complex enough to have a need for speed. 

 

Part 2 is the exciting part. 

 

Spoiler
The question "which pair of nodes connected the network" is equivalent to "which node appears last in the distance-sorted list of pairs" because that will always be the one that completes the network by bringing in the last node. If you include both sides of each pair (A->B and B->A) in your list and sort by distance then the answer is just the pair with the last unique node. Max of Min, which is a problem we're good at solving.
gawa
16 - Nebula
16 - Nebula

Revisited this puzzle after discussing with @Hub119 and @CoG on WhatsApp.

Implemented improvements: 

- Applied more rigorous logic to judge if forming single circuit, that doesn't rely on nature of luckiness in given data

- Cater for dynamic input(sample or my own) by using nested Macro(Iteration Macro inside Batch Macro) to rewrite the parameter for conditional expression via Control Parameter. 

- Stop iteration once the result is found 

Spoiler
image.png
Stosh
7 - Meteor

Day 8 is finally complete! Definitely leaned on the community for some much needed help, but I am really happy that I did, as I ended up learning so many new tricks (Explanation and shoutouts can be seen in my reflection)! We live to see another day, and I am excited to take on the 9th challenge.

 

My Solutions:

Spoiler
Part 1 and Part 2
Stosh_0-1765245716009.png

The macro used in Part 2

Stosh_1-1765245846918.png

My Reflection:

Spoiler
As I mentioned before, I was lifted up by the Alteryx AOC Community today, and I want to shout out some particularly helpful people as I go over my reflection of the challenges!

As I was making progress in Part 1 in the wee hours of the morning, I heard rumblings in the WhatsApp group that a certain lesser-known tool was critical to their solves. I was dying to know what it was, so I allowed myself to take a very quick peek at @gawa 's solution and that's when I saw it: The Make Group Tool. I am 100% certain that I have had to read some documentation on this tool at some point or another in order to pass a certification😂But this was my first time seeing it out in the wild, and it was so cool to watch it absolutely shred through Part 1. It literally does all the heavy lifting and just leaves me to line it up and take the product.

For Part 2, I decided to leave it to the evening, as I needed to get some sleep! As a result, I had some time to think about my approach at work. I knew I needed to iterate on the sorted list of match distances, starting from match 1001 and stopping when the Make Group tool returns one 1000 node group, but not much else. While I was thinking, I shared my idea with @Hub119 and @CoG , where I was then given the idea to try binary search, which was a total gamechanger! I have always admired the efficiency and elegance of a binary search, but never implemented the concept in anything I have built, so it was an absolute treat to be able to actually build out the logic for the first time. The macro takes in the full list of relationships, as well as a min and max relationship ID to consider. From there, it finds the midpoint relationship and performs a make group process on all relationships up to the midpoint as well as on all relationships up to the midpoint - 1. This is done because many subsets of the total list of relationships will result in a single 1000 node group coming out of a Make Group tool, but what we need is the VERY FIRST relationship in which this is the case. In order to truly find it, I am looking for when the relationships up to the midpoint result in a single 1000 node group and the relationships up to the midpoint - 1 do not. Once I find that, I simply output the midpoint. Otherwise I update the Min and Max and start again.

Overall, I am very happy with my solution, and I am even happier to be a part of the community! I have been learning so much through this entire process, and I think my experience today sums up the beauty of this challenge. Looking forward to Day 9!
PangHC
13 - Pulsar

waste too much time on misunderstand...
the method of calculate distance and i thought it skip the count of connection if there already in circuit. 

Spoiler
for part 2 is similar to gawa solutions (the first post).
First line that fit all connection. 
but it took 3~ mins. 
hence i change to use bitmask method (in string)
if significant reduce the time to 5 seconds. (huge time save due to the size of data 9.5GB -> 500 MB)

PangHC_1-1765257289148.png

start of bitmask is create in formula

padleft("0",[Max_recordID],"0")


the multi-row formula, wish it have function that replace specific character where it will simplify the formula. 

if isnull([row-1:bitmask]) then
  Left(
    Left([BitMask],[RecordID]-1)+"1"+Substring([BitMask],[recordid],1000),
    [Source_recordID]-1)
  +"1"+substring(
    Left([BitMask],[RecordID]-1)+"1"+Substring([BitMask],[recordid],1000),
  [source_recordID],1000)


else
    Left(
    Left([row-1:BitMask],[RecordID]-1)+"1"+Substring([row-1:BitMask],[recordid],1000),
    [Source_recordID]-1)
  +"1"+substring(
    Left([row-1:BitMask],[RecordID]-1)+"1"+Substring([row-1:BitMask],[recordid],1000),
  [source_recordID],1000)
  
endif

PangHC_0-1765257261847.png

 



Labels
Top Solution Authors