in reply to Re^3: Brute force vs algorithm (PWC # 100)
in thread Brute force vs algorithm (PWC # 100)
Our approaches are not that different, your dynamic "cache" is just my explicit "weight" triangle.
And you are needing more resources for recursion and hash.
But you could improve it by adding bound criteria (i.e. no need to calculate a subtree if it has no chance to be better than the current minimum).
Though I'm not sure this will pay of, my algorithm is already O(m) with m #cells.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Brute force vs algorithm (PWC # 100)
by tybalt89 (Monsignor) on Feb 16, 2021 at 04:39 UTC | |
by tybalt89 (Monsignor) on Feb 16, 2021 at 05:04 UTC |