Discussion thread for day 23 of the Advent of Code - https://adventofcode.com/2024/day/23
Another easy problem! This AoC has been an excellent one. Elegant problems with just the right amount of challenge:
It took me a little while to understand the problem statement.
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.
Solved!
Viz
Day 23. More in spoiler
My solution.
Part 2 takes 8.2 sec.
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.
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....
I created WF that I don't wanna explain about it to others😂
Network Analysis tools helps us to understand the data structure.