I thought it would be a long-runner, but I also guessed that getting to a better solution would take a while, so I set it off and it did eventually return an answer before I could even plan out a solution that might improve things. Who needs algorithms when you've got Moore's law.
My first version ran for about 90 minutes. My second version, for about 45 seconds. I'm sure there's more optimization to be done, but that was good enough for me :)