Discussion thread for day 24 of the Advent of Code - https://adventofcode.com/2024/day/24
Day 24. More in spoiler
I will only post PART 2.
The workflow for PART 1 was lost while I was working on PART 2...
My workflow does not automatically replace wires.
I have manually replaced them 4 times.
Part2.
As the problem statement says, this is a logic circuit (adder).
My graduate major was semiconductor devices, but it is difficult to understand how this works.
So, I used Alteryx and "Pen and Paper" to figure out how the circuit works.
Then we can see that the circuit looks like the macro image.
x00 XOR y00 -> z00
x00 AND y00 -> AA
x01 XOR y01 -> BB
AA XOR BB -> z01
AA AND BB -> CC
x01 and y01 -> DD
CC AND DD -> EE
It goes on like this...(It's hard to explain.)
I made this into a workflow and identified four places where the workflow stopped.
P2 was difficult.
For P1, all output parameter was set as the main flow within the iterative macro. In each loop, the unknown parameters were determined step by step.
P2 was particularly challenging. Following the advice of my colleague, @Tokimatsu , Network Visualization Tool was used to identify problematic patterns visually. Among the four swapped pairs, three were easy to find because the output to z was not from XOR. For the last pair, I searched for inputs to z that were from neither XOR nor OR. This required a visual check and validated by adding the binary numbers from X and Y resulted in Z.
The Network Visualization Tool can visually highlight problems. Differentiating using direction, color, and size made the process much clearer. Additionally, thanks to @Tokimatsu's advice, gate names are included in the labels, which significantly improved clarity.
Solved!
Part 1 here was fairly quick and easy... Part 2 was a BEAST! This involved lots of research into circuit adders to better understand how things SHOULD be working. I built out a test macro to check for the first break point where a problem existed and therefore wires were "crossed" in that area that needed swapping. Shout out to @DaisukeTsuchiya for the hint of using the Network Analysis tool to better visualize what was going on. Using my "next error" check macro along with this viz, and updating pairs one at a time until the circuit produced the proper output allowed me to quickly identify and sort out the circuit.
Part 1 was relatively easy. An iterative macro is perfect for evaluating all logic. Part 2, as others have said, is very easy to make very difficult. I knew the general vicinity of all errored outputs within an hour, then proceeded to take the next day trying to wrap my head around finding the specific answer. Knowing how circuits work with boolean logic will be a tremendous asset although I still struggled to build with Alteryx. This was a very manual problem for me.
At first I answered Part2 by looking at the network diagram. After that, I created a workflow to derive the answer to part 2 from the relationship between the operators. However, other people's data may not give the correct answer.