Discussion thread for day 10 of the Advent of Code - https://adventofcode.com/2023/day/10
Cool problem, good applications from Graph theory. Kind of "cheated" (brute forced/found a pattern in the data) to speed up initial solving time. Then went back and improved the Workflows to make them more generalized.
What follows is the algorithm I used in addition to pictures of my workflows (read at your own risk)
Coordinates always trip me up, but I am proud of my part 2 solution which I was able to accomplish in a few tools after my original macro. As a bonus I got some really neat visualizations from it. I'm slowly getting better at iterative macros and coordinate problems like these!
Day10 is so hard again.It took 4.5 hours to create WF but process is completed in 2min for P1 and P2.
My Sunday comes to an end while solving this.
Tough challenge.
Make Group tool is useful in case like D10P1. Here is how to create groups with Make Group tool without macro.
Very hard challenge.
Finally caught up on day 10! Really enjoy the challenge of these grid problems and thinking how best to tackle them whilst limited to table structures in Alteryx. Part 1 and 2 macros are very similar - I just added an extra print output of the co-ordinates of each iteration so that I could build a polygon and conduct spatial matching for P2.
Good lord this took me a while
FINALLY got Day 10 done. I was busy on Sunday and missed this and finally had a chance to get it done.
I appreciate @kelsey_kincaid posting their solution. I got to the Spatial Match on Part 2 and wasn't sure what to do with the output
I knew I would get to use spatial tools sooner or later! I feel like this is one where Alteryx definitely makes part 2 easier. NOT that it was easy 😅
think of spatial for part2 but no luck, thanks @kelsey_kincaid
D10P2 -
This hot rod runs in a smokin 0.8 sec!!
I post again with solution in yxzp.
Tunnel problems – really allows you to dig into them <wah wah wah>
Part 1 was pretty brute force – and ran in 6:28
Part 2 I gave up on computational approaches (I need to go an look at other people’s solutions) and used spatial – worked like a charm.
😊 oh, and got to use control containers here too!
Details in the spoiler below.
Part 1:
Really just 2 steps:
Find paths macro:
The way this works is that from each current point, you look at where you can move to – if there are no possible moves then exit
The explosion to possible moves happens in the join and in the formula immediately after it
The output of this is a list of all the tunnel pieces (from X to Y) and an engine iteration number. The highest engine iteration number is also the furthest point from the start since it took us the most steps to get there – so the problem is solved.
Part 2:
So – we’re coming into Part 2 with all the tunnel pieces – however I couldn’t figure out a pretty way to computationally see if something was inside or outside the tunnel. I did start by working from the outside edges inwards, but that doesn’t work for the stuff where the rabbit squeezes between the tunnel pieces.
Enter Spatial.
Here’s the recipe:
And why the control container – ‘cause you only want part2 to run when the output from Part 1 completes and the output file finishes writing
thank you for writing this up @CoG - very generous of you to spend the time - and your explanation makes complete sense.
I feel like I cheated a little and used the spatial tools for part 2 - but it is BaseA :-)
great writeup and unique solution - thank you for taking the time @gawa
For whatever reason, I really enjoyed solving part 1 of this, but had very little time each day to work on it.My first approach was a spatial one. Look at the orthogonal neighbors by generating points on a map. And even though I only used that approach to generate neighbors for tiles, for whatever reason my iterative macro started throwing lots of iterative records after about 100 iterations, which was completely wrong.
So just tried the neighbor by numbers approach that @grossal mentored me through last year (at least I think it was last year. Could have been two years ago).
It could definitely be more efficient.
For part 2, I did go with a spatial route. Really enjoyed this challenge, and it was the second this year when I got the answer on the first and then second try.
I used spatial tools.