Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2024 Day 23 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 23 of the Advent of Code - https://adventofcode.com/2024/day/23

10 REPLIES 10
CoG
14 - Magnetar

Another easy problem! This AoC has been an excellent one. Elegant problems with just the right amount of challenge:

 

Spoiler
Part 1 can be accomplished with two joins, checking for cycles (A -> B -> C -> A). All such cycles represent a triplet of interconnected computers (Note: In order for this to work, you must first Union a mirror, aka swapping mapping columns, of the input to account for non-directed connections). After that, just clean things up to identify all unique combinations that have a computer labeled "t..." and you're golden!
Main.png

For Part 2, we already have a head start since we just calculated all groups of size 3, and an iterative macro comes in handy to build from there by Joining to input data, checking if any values are connected to all values in pre-established group, adding to the group if true, and then repeating the process:
Find Groups.png

 

ScottLewis
11 - Bolide

Some days, you want to look for an elegant, iterative solution.

Some days, you want to watch the world burn.

 

Presented, a Macro-free version of this solution, which doubles as a sort of digital art.

Not even putting it in a spoiler. You want to do that, you follow your dreams.

 

Day23Scott.PNG

DaisukeTsuchiya
14 - Magnetar

It took me a little while to understand the problem statement.

Spoiler

For P1, I used a purely brute force approach. First, all possible three PC combinations were created, then searched for the ones that satisfied the conditions.

For P2, I added one computer at a time to the sets of three identified in P1. However, as the number of loops increased, the amount of data exploded. To address this, grouping were implemented 

During this process, combinations like A, B, C, F, D, E and A, B, C, E, F, D would appear, so I temporarily split them, sorted the elements, and standardized them to A, B, C, D, E, F for grouping. This helped prevent the number of records from growing uncontrollably.

スクリーンショット 2024-12-23 191458.pngスクリーンショット 2024-12-23 191532.png

AkimasaKajitani
17 - Castor
17 - Castor

Solved!

 

Viz

Spoiler
a62f16b4-9c3b-4a1f-9be8-fc3d892b2a90.png

 

Spoiler
Part 1 is very simple. Simply repeat the join twice to create a list of all patterns.
AoC_2024_23_05.png
And then, if the column "name" and "3" have the same value, they are interconnected. All you need to do is include the first letter 't' and eliminate the duplicates.

AoC_2024_23_06.png

Part 2 starts with the three interconnection lists created in Part 1. Add one node that seems to be connectable to this list and check whether it can be interconnected with the PC in the interconnection list. If it can be connected, add it as the new interconnection list. This is repeated until the longest list is reached where no more can be added. The number of iterations was about 10.

Part2 macro
AoC_2024_23_04.png

 

Goddenra
8 - Asteroid

Part 1: Oh, who needs a macro.

Part 2: Oh, great. Probably should have!

Not sure if a spoiler, but at least in my case using the output of Part 1 meant Part 2 failed. I had to run from the start.

mmontgomery
11 - Bolide
11 - Bolide

Day 23. More in spoiler

Spoiler
P1: Thought make group would help but it didn't. Just picked two use cases and followed it all the way through. Not the most elegant solution but works
P2: I think I got lucky cause I just built out the grid from P1 like the example, sorted by most children under parent and got the answer quick without a macro
Day23_P2.pngDay23_P1.png
ntakeda
12 - Quasar

My solution.

Part 2 takes 8.2 sec.

Spoiler
2024-12-24_09h04_27.png2024-12-24_09h04_36.png

2024-12-23_18h21_03.png

  

I found a network name that can be connected to all of the current networks as shown in the image.
This was found by number of joins = number of iterations.

In the first iteration, the AB-CD network can be joined by XX, which has connections to both AB and CD.
In the second iteration, the network must have connections to AB, CD, and XX.
Repeat this process.


Since Input has left and right sides (xx-yy), i also created a reversed record (xx-yy and yy-xx).
Since there are more records, we sorted them each time to limit the number of unique records.

The start of my workflow is started with all records, so I think this could be executed more faster if I could start with the proper starting method. However, I don't know exactly how to implement this.

 

PangHC
12 - Quasar

my part2 is faster than part1. 🤣
re-create macro for all combination generator. but it super slows in 13 from 14 and 3 from 52....

 

Spoiler
part1:
1. join once to get 1,2,3
2. remove not "t"
3. sort and remove duplicate combination
4. verified the each 2 pairs.
5. if all matched mean it valid combination

part2:
it assumes answer are 13. because each LAN are link with other 13 exactly, same to sample also link 4 LAN exactly
i sense it may the answer, 

so just create a macro to remove one of it rotate-ly and validate each set of 13 (13 + its own - 1). if all combination matched, then it is the answer.

 

 

 

gawa
16 - Nebula
16 - Nebula

I created WF that I don't wanna explain about it to others😂

Network Analysis tools helps us to understand the data structure. 

Spoiler
image.png
Labels
Top Solution Authors