commits
lol I cracked open my big book of algorithms to confirm this is NP-hard
before trying out the most näive approach possible
I don't love how I don't really understand how this works – I should
read up more on linear programming – and the number of additional
dependencies this pulls in, but it sure does run a lot faster than my
previous approach. It only takes 10ms to solve the problem and that's
with an unoptimised pure Rust solver.
I spent ages trying to refine and optimise a solution for this challenge
which made use of combinatorics whilst trying to optimise the number of
permutations tested as much as possible. I still had to kill the program
after it ran for 5 hours on my M1 Pro and still was only about 25%
complete.
I saw other people suggesting linear algebra online and I've been
stubbornly avoiding trying it because I doubt I would have thought of
that myself, but now I'm going to take it as an opportunity to learn (or
revise?!) a new subject!
Cracking out itertools because I get the idea with implementing all
these combinatronics by now.
This almost certainly took more time to write than it will ever save me,
but at least I got to learn a new scripting language.
I don't love how I don't really understand how this works – I should
read up more on linear programming – and the number of additional
dependencies this pulls in, but it sure does run a lot faster than my
previous approach. It only takes 10ms to solve the problem and that's
with an unoptimised pure Rust solver.
I spent ages trying to refine and optimise a solution for this challenge
which made use of combinatorics whilst trying to optimise the number of
permutations tested as much as possible. I still had to kill the program
after it ran for 5 hours on my M1 Pro and still was only about 25%
complete.
I saw other people suggesting linear algebra online and I've been
stubbornly avoiding trying it because I doubt I would have thought of
that myself, but now I'm going to take it as an opportunity to learn (or
revise?!) a new subject!