Jan 2017 | Jan 2016 | Jan 2015 | Jan 2014 | Jan 2013 | Jan 2012 | Jan 2011 | Jan 2010 | Jan 2009
-
Subscribe
-
Reading
-
About
Being the thoughts and writings of one Gustaf Erikson; father, amateur photographer, technologist.
Frequently updated microblog.
More stuff can be found at gerikson.tumblr.com and Flickr.
I toot at @gerikson@mastodon.social.
Follow my bookmarks at Pinboard.
A fun problem!
My initial idea was to utilize Snell’s law, which was indeed the right idea, but I didn’t have the right constraints.
After a while I rethought the problem to minimize a multi-variable function using the “downhill simplex” algorithm.
Brute-forcing for 5 minutes gave the correct answer, and access to the forum and an even faster solution…
Pretty happy with this solution!
Algo adopted from this solution.
I had to write some code for AoC 2017 day 22 which matched up with this pretty nicely.