Discussion thread for day 23 of the Advent of Code - https://adventofcode.com/2023/day/23
Spent a lot of time thinking about how to solve this problem. Path Optimization problems are an area I can use some work in. My methods are probably not optimal, but I was able to use a couple clever strategies to my advantage, which felt good to come up with and execute!
Algorithm: (Plan to add later)
Workflow:
Happy Solving!!!
For, Part1 Brute Force worked well, but for Part2, it didn't.
Then, I examine the input data carefully, and solved with Spatial Analysis.
Pls see spoiler for detail
Part 1 is very simple. But part 2 is needed for the ingenuity.
part 2:
And then I did the BFS.
A check of the input data revealed that each branch had a direction. I solved this as a graph problem.
branch macro
part1 macro
part2 macro
same concept.
part1 macro
@AkimasaKajitani - Thank you so much for posting your solution! I was trying to solve it similarly to you, but was stuck on Part 2.
I was doing a weird thing where I started at Start and then each time I hit a node point, I split that into a new iterative line and then was only checking to see if the new points at the end were the same. I was ending up in these weird infinite loops and I couldn't get any good data out.
Your way of solving it where you ran all the node points through at once was so much smarter. That, plus your Contains instead of my exact match solved my issue with the infinite loops.
I also like how you did the Generate Rows to create the points to the left, right, above, and below. I was doing 4 Formula Tools and then Unioning the results, which worked, but your way is way cooler.