General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2023 Day 11 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

24 REPLIES 24
gawa
15 - Aurora
15 - Aurora

I'm just wondering if we upload WF here right after we finish, somebody can download, and use them to get answers immediately for just collecting stars...That might be not fair for everybody living in different time zone so I'll upload screenshot meanwhile😅 

Spoiler
image.png
AndrewDMerrill
13 - Pulsar

I am quite satisfied with the solution I came up with today, it feels very intuitive and simple (although I have little doubt someone will post a much denser workflow at some point). It took me a while to work out the kinks and bugs, but it works now and that's what counts. I am inclined to agree with @gawa, so I will include only a screenshot of my solution for now.

Edit: Adding my workflow now that top 15 have solved at least part 1.

Spoiler
Screenshot.png 

 

 

Tokimatsu
12 - Quasar

When I created Part 1, I thought this logic might not work for Part 2, but I still had to create a new logic for Part 2. 

Spoiler
スクリーンショット 2023-12-11 152724.png
AkimasaKajitani
17 - Castor
17 - Castor

My solution.

 

Spoiler
There is no special techniques.

スクリーンショット 2023-12-11 153327.png

kelsey_kincaid
12 - Quasar

I built out an entire solution for Part 1 that worked on my sample data and not my real data. Instead of spending time troubleshooting, I decided I didn't like my approach and started from scratch. While this slowed me down substantially for Part 1, it paid off for Part 2. 

 

ETA: I personally don't have a problem with people uploading their workflows and choose to do so. If someone wants to compete in bad faith, they will. Even if we didn't upload any workflows here, Reddit is full of scripts people could run to get answers and then work through the Alteryx later. I'd rather just post my workflow in the spirit of learning and fun competition, but that's my two cents :) 

 

Spoiler
Part 1: My original approach for expanding the universe was to generate rows, then reshape the data and generate columns. At some point I realized that Generating Rows has historically not served me well in AOC, and that I didn't actually need to have a row in the dataset to get the distances I needed. So instead, I calculated the number of empty rows and columns upstream from each Galaxy (#) and used that to recalculate the coordinates of the galaxy. For the distance calculations, I used a simple macro to generate pairs and subtract the coordinates. Honestly, the macro is overkill, but it was the easiest way for me to figure out how to generate every pair without having duplicate pairs. Though, thinking about it now, I have a few ideas.

Part 2: My rework in Part 1 paid off. All I had to do to answer this question was to change 2 formula tools. Originally whether a row/col needed to expand was a binary flag of 0 or 1. Expanding 1 million times was just a matter of changing my data type and making the expanded value 999999 instead of 1. It's rare that adjusting for part 2 is this straightforward, so I'm pretty happy with this even if I didn't get to part 1 quickly. 

Workflow:
D11.pngMacro:
Day11macro.png

  

ApekshaSharma
6 - Meteoroid
Spoiler
I will make more effort to clean up my workflows & post them here!

As the days have progressed, I have become quite wary of using Joins & multi-row formula tools in my workflow. Was relieved to see that P1 solution required very few tweaks to work on P2. I have kept Expansion multiple as a manual input which can be updated to solve for both P1 & P2. Also, the max RowID & max ColID of the initial grid is an input in my flow which I kept manual as I was lazy!



Day 10 .png
Qiu
20 - Arcturus
20 - Arcturus

Had to reconstrct the logic for Part 2...

Three things I learned from the AoC of 2023

1. Brutal Force does not work, so dont tempt.

2. One day without AoC is actually making me feel life is so much easier..

3. I tends to be stupid when doing AoC. Was trying to develop a macro for the combination of only 2 lists of numbers..

 

Spoiler
AOC2023-Day11.png
DaisukeTsuchiya
13 - Pulsar

Intersting problem.

 

Spoiler
P1 WF was complicated then I realized that WF need to be recreated for P2.
WF is modified so that it can be used both for P1 and P2.

スクリーンショット 2023-12-11 183021.png
AkimasaKajitani
17 - Castor
17 - Castor

Designer Cloud Solution.

 

Spoiler
スクリーンショット 2023-12-11 222518.png

Also I tidied up my Designer Desktop solution of Part 2. 

Spoiler
スクリーンショット 2023-12-11 222757.png

 

 

 

Labels