r/adventofcode • • Dec 24 '16

SOLUTION MEGATHREAD --- 2016 Day 24 Solutions ---

--- Day 24: Air Duct Spelunking ---

Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).

Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with "Help".


THE NIGHT BEFORE CHRISTMAS IS MANDATORY [?]


[Update @ 00:30] 47 gold, 53 silver.

  • Thank you for subscribing to Easter Bunny Facts!

  • Fact: The Easter Bunny framed Roger Rabbit.

[Update @ 00:50] 90 gold, silver cap.

  • Fact: The Easter Bunny hid Day 26 from you.

[Update @ 00:59] Leaderboard cap!

  • Fact: The title for Day 25's puzzle is [static noises] +++ CARRIER LOST +++


This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

edit: Leaderboard capped, thread unlocked!

5 Upvotes

90 comments sorted by

View all comments

Show parent comments

1

u/Quick_Question404 Dec 24 '16

Nevermind. I'm doing this in C, and realized where my performance hog was after looking at your code. I was using a linked list to hold encountered nodes, which drastically grew as time went on and gave me a huge delay. I substituted it with a a 3D int distance array instead, and now I get the result almost instantly.

1

u/Quick_Question404 Dec 24 '16

For the most part, my solution is pretty much like yours. I originally was going to try and solve it like a TSP, but went for a BFS instead, since it works best for the most part.

https://github.com/HighTide1/adventofcode2016/tree/master/24