D12 reminds me of another path-finding question in last season, and this is when we start to explore the limit of Alteryx as a "pseudo programming language", I think.
I think the method I used is closest to the "Breath-First Search (BFS)" algorithm (TBH when I did the workflow I did not know this is called BFS). This algorithm is considered greedy and probably is the reason it took 16.8 seconds to run Part 1 but a whopping ~50min to run part 2 on my laptop (Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 2.59 GHz, 8GB RAM). There is definitely a more efficient BaseA solution and I look forward to see the solutions by the wizards amongst us :-)
Part 1 macro
Part 2 macro (which uses part 1 macro)
Inspiration struck when I was having dinner with my husband... so I flipped the workflow to a reverse Dijkstra and voila both part 1 and part 2 finished together in 40 seconds. See hint in the spoiler 😎
It took a couple tweaks to keep the macro from blowing up the count.
Macro:
I finishes today'ss challenge using Breadth First Search algorithm. Today, I didn't have a concentable time because of my work. As a result, I did this challenge after the work.
Not an easy one and h/t @patrick_digan 's solution for removing already-seen paths, which was my main struggle.
Thankful for @patrick_digan 's hint about keeping rows from exploding. My original solution was very close but couldn't keep the row count small enough.
thankful for @patrick_digan for the tips.
macro:
add a message tool as a stopper when have a solution.
thank you for the tips - I have used Djinkstra with slight modification and finally managed to solve the issue
makro: