#AoC 2022 | Day 19 | Solutions & Spoilers

1014 messages · Page 2 of 2 (latest)

simple cypress
#

What is your pruning strategy?

blissful lily
#
  1. if a proposed purchase would lead to more robots than needed to build things in a single turn, don't buy it
  2. if there's a useful pre-requisite that can purchased while waiting for an advanced machine without delaying the advanced purchase, don't buy it
  3. if magically the state started buying geodebots one a turn for the rest of the sim and still didn't outproduce the current best, don't add any new states to the frontier
simple cypress
#

1 and 3 sound ok, but I'm not sure about 2. What's the reasoning?

blissful lily
#

like, at the present I can build an obsidian robot in 1 turn or a geode robot in 4 turns, I could add both futures to the frontier, but the geode robot future is skipping out on possibly building an obsidian robot while it's waiting for 4 turns, so it's just always behind the other path. So avoid excess branching and just explore the future where I build the obsidian robot

#

i think my implementation of 2 is probably where the mistakes are happening

molten kernel
#

do you make sure you have enough ore such that building the obsidian bot doesn't slow down the geode bot making?

random rose
blissful lily
random rose
#

But you might not be able to build a clay robot the turn after because you decided that branch is worse, having 4 ore and 3 obsidian robots may be better than having 0 ore and 4 obsidian robots. It's really the whole reason you can't just easily precalculate the best path without branching.

#

The problem is about timings so you just won't know how each combination of robots to ores will perform

#

Or at least if you had the method to actually calculate the best path with math you wouldn't be doing BFS/DFS in the first place.

#

In the same way you couldn't say for sure that (1, 2, 1, 1) < (1, 2, 1, 2) for the robots you couldn't say (1, 2, 1, 2) < (1, 2, 2, 2) either

kindred python
#

it's important to prune using stuff you can guarantee removes states that can't be optimal

#

otherwise you have no guarantees the answer you get is correct