adventofcode

Happy Advent 2020! Please put answers in the pinned threads or create one if it does not exist yet. | https://github.com/adventofcode-clojurians/adventofcode-clojurians | Join the private leaderboard with code 217019-4a55b8eb
2018-12-22T01:24:38.018200Z

@potetm — Have the old videos scrolled off of Twitch? — I’m still back on day 4

2018-12-22T01:59:05.018800Z

@tbrooke They have. I have the recordings I’m planning on posting on my site soon.

2018-12-22T01:59:32.019100Z

My code is posted at https://github.com/potetm/advent-of-code

2018-12-22T06:34:42.019500Z

How I spent the last hour of my life:

2018-12-22T06:34:43.019700Z

target: 14,796

😱 1
2018-12-22T06:35:08.020300Z

Oh, my region is 14796 x 14796…. That’s kind of big ….

2018-12-22T06:35:11.020500Z

sigh

2018-12-22T06:39:56.021200Z

14x796 is much more manageable

fellshard 2018-12-22T07:46:28.022100Z

I'm gonna have to finish part two tomorrow; I don't think I can rely on creating a static graph with JGraphT, I need to be able to expand it on the fly. 😞

2018-12-22T08:46:48.023700Z

Things I re-learned today: it’s really hard to memoize a recursive anonymous function….

uneman 2018-12-22T12:38:45.025500Z

Is day22 pt2... A* again?! 😨

ihabunek 2018-12-22T12:39:39.026Z

seems so, but the map changes based on tool used

misha 2018-12-22T13:33:14.027800Z

wasted hours, and solution passing tests returns wrong result after 20 minutes :dafuq:

misha 2018-12-22T13:34:01.028300Z

reddit says dijkstra

2018-12-22T13:56:02.032Z

@potetm - I’m still working on comparing my failed attempt at 4 with your solution - in looking back through the thread here I noticed you highlighted a discussion in #10 so I plan to jump around and go to #10— keep highlighting good ones or ones that follow others — I am at the level where I can get started but usually end up stuck with most of the problems and I need the video to get through

2018-12-22T15:24:54.034200Z

djikstra (weighted BFS) works but is kind of slow. You may need to cheat the dimensions or use A*,

2018-12-22T15:25:40.035200Z

I my new holiday spirit of of writing garbage code for AoC I did the the former, but I may switch over after I clean up and commit because it’s an interesting search problem

2018-12-22T15:27:01.036100Z

I do like the twist of the tools here. I kind of makes a 2d grid into a 3d grid

2018-12-22T15:30:24.036600Z

and representing it as a 3d grid actually makes the solution pretty straight forward.

2018-12-22T15:32:26.037900Z

there's probably alot of potential to optimize, but it runs in about 2,5 secs for part 2

2018-12-22T16:06:29.038400Z

You beat me: “Elapsed time: 5045.311258 msecs”

2018-12-22T17:03:24.039900Z

And it looks like your effective X search is larger than mine too… It looks like the main difference is I visit one node at a time and you visit all the nodes for time T at the same time, which seems to provide some efficiencies

2018-12-22T17:21:38.040600Z

right I'm just storing which nodes are reachable after n seconds, advancing the seconds until the target is in this set.

gklijs 2018-12-22T17:30:58.042200Z

I'm not sure whether I have an off by one error, or my solution is 'better' than the approved one. The example runs correct, but on my data the output is 1088, while the accepted answer was 1089.

2018-12-22T18:00:30.042900Z

Maybe you are really good at changing tools 🙂

2018-12-22T18:01:28.043700Z

Are you allowing your search to go beyond the target [x y]?

misha 2018-12-22T18:27:33.044600Z

it would return longer path then, not shorter. I also got shorter results

gklijs 2018-12-22T18:46:40.046800Z

Probably a bug then. When I filter the routes more aggressively I do get the answer, and it's a solution that takes less steps.

misha 2018-12-22T20:29:49.048500Z

@drowsy used your approach of sets 1 distance at a time, after I wasted half a day waiting "per-xy" to complete, with all the different filters and sorting and stacks/lists/queues combinations.

misha 2018-12-22T20:34:54.049Z

and it doe not accept an answer :kappa:

misha 2018-12-22T20:50:20.049500Z

it is off by 4! can't even blame off-by-1™

gklijs 2018-12-22T20:58:08.053900Z

From a Kotlin slack channel came the awnser, apparently when you change the tool, it has to be valid in the current one. So for example you can't put away the torch in a rocky place to move into a wet place. Or put your rock climbing gear in a narrow area to move to a rocky one.

misha 2018-12-22T20:59:58.054300Z

hm, looking into it

misha 2018-12-22T21:02:43.054800Z

yep, that did it