General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2023 Day 23 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 23 of the Advent of Code - https://adventofcode.com/2023/day/23

6 REPLIES 6
AndrewDMerrill
13 - Pulsar

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:

Spoiler
Main:
_Main.png
Maze Solving Iterative Macro (Part 1):
_Solve Maze Part 1.png
Graph Building Iterative Macro (Part 2):
_Build Node Graph.png
Graph Traversal Iterative Macro (Part 2):
_Node Traversal.png

Happy Solving!!!

gawa
15 - Aurora
15 - Aurora

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

Spoiler
In your dataset, you would find the below "T" and "+" points. Those pints are conjunction points each other. You need to just trace these points from start to end.
image.pngimage.png
By converting the map into spatial object, you will have the below objects.(To do so, you need to do a lot of work, I know) 
By cutting out line objects into multiple lines by points object, you will have separate line objects(To do so, you need to buffer objects somewhat)
image.png
In Graph viz, it simply looks like
image.png
In short, you just have to solve based on the above graph, instead of the given input data that is too complicated and messy.
Calculation to get max distance took 1 min in my case. In  process of iteration, max no. of record reached to millions but it reduced soon after some more iteration) 

 

AkimasaKajitani
17 - Castor
17 - Castor

 

Part 1 is very simple. But part 2 is needed for the ingenuity.

 

Spoiler
Only just to walk simply.

Macro for Part 1:

AoC_2023_23_03.png


Workflow for part 1 : 
AoC_2023_23_05.png

part 2:
There is no slippery floors now. The route was limited by it, but now there are too many routes to use the simple way. 
So I tried to compress the route. The way is to find the nodes that have intersection that can go 3 or 4 direction. It took much time to find this way.

AoC_2023_23_08.png
After that, I need the steps of each edge. To get them, I made the macro.

AoC_2023_23_06.png

And then I did the BFS.

AoC_2023_23_14.png


Workflow for part 1 and 2:

AoC_2023_23_15.png





Tokimatsu
12 - Quasar

A check of the input data revealed that each branch had a direction. I solved this as a graph problem.

Spoiler
スクリーンショット 2024-01-07 190220.png

branch macro

スクリーンショット 2024-01-07 190324.png

 part1 macro

スクリーンショット 2024-01-07 190409.png


part2 macro

スクリーンショット 2024-01-07 190442.png

Pang_Hee_Choy
12 - Quasar

same concept. 

Spoiler
part1: skipped. 
part2: find the point have 3 or 4 directions, calculate the steps for them. 
then build a similar macro as part 1.
Then get the max value of the result. 

workflow
Screenshot 2024-01-08 120441.png

 part1 macro

Screenshot 2024-01-08 120451.png
part2: get path and steps for each cross nodes
Screenshot 2024-01-08 120457.png
part2 find path macro:
1a57dcc8-438c-4407-a9ff-364e0c766619.png
Carolyn
11 - Bolide

@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.

Labels