Discussion thread for day 17 of the Advent of Code - https://adventofcode.com/2023/day/17
This problem was tough. I spent a lot of time thinking about good ways to simplify this problem prior to running my search, but the constraints seemed to ruin everything that I wanted to try although the problem itself may not have been super well suited to the methods I was initially thinking through. I ended up taking the iterative macro approach (I'd be truly surprised if someone can do this without one). I found that Part 2 wasn't actually that much harder than Part 1 today. My method was basically the same (I just needed to add a couple tools to account for the additional constraint). Both ran in ~5 minutes
Algorithm Hint 1 (based off of my approach):
Algorithm Hint 2:
Workflow Screenshots:
After the uncountable attempt, finally solved it. I write the logic I applied in the spoiler. I apologize for my wording is not so good as I'm not English speaker...and not good at thinking clever logic.
This is so tough. I spent long time for debugging and got the answer finally.
Oh man, this was a learning experience! P1 and P2 logic in the spoiler.
run both in 4mins~
Finally, I got the two stars on Day17.
I solved the part 1 puzzle using Dijkstra's algorithm. But it was not fast at Alteryx, however it worked.
At the part 2, I used brute force algorithm(BFS). The data for part 2 is too many nodes for Dijkstra's algorithm. So I went to BFS route.
At part 2, it took 4.5 hours using BFS.
I dispose the data as follows in this macro.
I hope that the Alteryx iterative macro run more fast.
Done.
P1 macro
P2 macro
Hi @PangHC,
Thank you for posting your workflow! I used it to chase down a Join/Union error that I had in my Part 1 macro which I could not find on my own (and then felt really dumb when I finally found it, aided by yours :) )