We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2022 Day 19 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team
Discussion thread for day 19 of the Advent of Code - https://adventofcode.com/2022/day/19
5 REPLIES 5
AkimasaKajitani
16 - Nebula
16 - Nebula

I couldn't create a specific algorithm to make geode efficiently. As a result, I solved this challenge by making all patterns while reducing the records.

 

Spoiler
AkimasaKajitani_0-1672588169730.png
Macro for Part1 and 2:
AkimasaKajitani_1-1672588214887.png

 


 

 

patrick_digan
17 - Castor
17 - Castor

It took a lot of time to write all the logic, but got there in the end.

Spoiler
Similar to day 16, just created all the possible paths/actions and then only kept the top 50,000 paths. It took a minute to get the sort right. 

patrick_digan_1-1672836943823.png

 



patrick_digan_0-1672836854854.png

 

clmc9601
13 - Pulsar
13 - Pulsar

Seemed like there should have been a math-based solution, but I didn't find it...

 

Spoiler
Instead, I took the iterative route. The toughest part was keeping record count from exploding. Lots of information to store in variables: I passed 20+ fields between iterations.

The macro logic is complete by the second formula. The rest of the tools are purely for reducing record count. 

Full workflows posted here: https://github.com/clmc9601/Advent-of-Code-solutions/tree/main/2022%20Alteryx

workflow, only a slight adjustment in detour for part 1 vs 2workflow, only a slight adjustment in detour for part 1 vs 2iterative macroiterative macro
Pang_Hee_Choy
10 - Fireball

same concept. but i used batch macro + iteration macro instead. easier to build by this way.

 

Spoiler
Part1:

extract data and crosstab it. this is master data for required resource for each robot.

Pang_Hee_Choy_0-1673517618378.png

workflow


In batch macro, create a start. 1 ore robot. and iteration macro to process by each blueprint.
Pang_Hee_Choy_1-1673517780486.png

batch macro

in iteration macro,
add 5 possible moves (builds 1 of 4 robots or nothing), add rows control.
sort by total geode, total obsidian, and total clay. (used + current)

Pang_Hee_Choy_2-1673518039930.png

iteration macro


Part2:
careful on data you to multiply. just multiply for geode. need not multiply with blueprint number.
increase the record control if the answer is too low.




 

 

SeanAdams
17 - Castor
17 - Castor

 :-) this felt like an easier one - including from some debugging, got this one done in a few hours.

 

Spoiler
I treated this as a depth-first tree search - where at each iteration, you add on child nodes for 
- save your money
- build each of the different types of bots
(so you have an explosion factor of 5 on each layer - i.e. max of 5 to the power of n where n is depth of tree)

Once the expansion takes place - I eliminated any options that were not possible due to resources - that brought the tree width down - and then invented a scoring factor to reward the higher level resources - and only kept the top performing nodes.

The solution for part 1 worked with part 2 without any changes



SeanAdams_0-1673956225115.png

 

Labels