Re:Project Euler
by nonameiguess on Tuesday October 15, 2024 @07:38PM
(#41854220)
I'm a bit disappointed I didn't see this quicker back when I did this problem like 15 years ago or whatever it is now. My solution was to use matrix exponentiation on the adjacency matrix of the path graph, which is a heck of a lot better than brute force enumeration of all paths, but still roughly cubic rather than linear like computing a bunch of factorials. Even as a math major, I'd done a lot more linear algebra than combinatorics.
[ Parent
| on HN ]
There are no comments on this comment yet.