r/adventofcode • u/askalski • Dec 17 '19
Upping the Ante [2019 Day 17 Part 2] Pathological Pathfinding
Here is a somewhat more challenging scaffold to solve within the specified constraints.
.........................................
...................#############.........
...................#.....................
...................#.....................
...................#.....................
...................#.....................
...................#.....................
...................###########...........
.............................#...........
...................#######...#...........
...................#.....#...#...........
...................#.....#...#...........
...................#.....#...#...........
...................#.....#...#...........
...................#.....#...#...........
.###########.......#.....#...#...........
.#.........#.......#.....#...#...........
.#.........#.....#####...#...#...........
.#.........#.....#.#.#...#...#...........
.#.....#############.#...#...###########.
.#.....#...#.....#...#...#.............#.
.#.....#...#######...#...#####.........#.
.#.....#.............#.......#.........#.
.#.....#.............#.......#.........#.
.#.....#.............#.......#.........#.
.#.....#.........#######################.
.#.....#.........#...#.......#...........
.#.....#.......#######.#######...........
.#.....#.......#.#.....#.................
.#######.......#.#.....#.................
...............#.#.....#.................
...#######.....#.###########.............
...#.....#.....#.......#...#.............
...#.....#.....#####...#...#.............
...#.....#.........#...#...#.............
...#.....#.........#...#...#.............
...#.....#.........#...#...#.............
...#.....###########...#####.............
...#.....................................
...#.....................................
...#.....................................
...###########...........................
.............#...........................
.............#...........................
.............#...........................
.............#...........................
.............#...........................
...^##########...........................
.........................................
10
Upvotes
View all comments
Show parent comment
2
u/ukaocer Dec 17 '19
Ok, so it's not the first twist I'd though it would be.
I don't have a solution yet, but here's what I've done so far and where I think it might be being clever:-
I changed my solver to output all possible solutions assuming you don't always go straight on at an intersection. So there are a maximum of 3^intersections possibilities although many are non-viable as they don't visit all bits as required. But this doesn't produce an result for your pathalogical case. 256 of the possible 2187 routes are viable for your pathalogical input. The only route that works for my real input is the straight on at intersections route.
So I think your twist might be:-
A case where the instructions are not split on a turn, i.e. you've got A="R,4,L,6,R,8" and B="2,L,..." or similar. Which will take some different rejigging of my encoder (at least I can give it the input of the "straight on at intersection only" route as input.
Of course:-
If you've combined the two horrible ideas in spoilers above then it's even more evil.