Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AddressSet.unify: pay off technical debt
The perfect implementation of this algorithm would be to perform a full circuit minimization, ala Quine–McCluskey. However, that would require expanding out to every addres, very exponential time! The previous heuristic algorithm was O(n^2) for n AddressSet terms. However, it did not always merge sets by the same bit in order. This led to poor outcomes on common inputs. The new heuristic merges by lowest bits first. This is O(n * bits), which has better worst-case performance. On contiguous ranges it also finds better results.
- Loading branch information