Solves the optimisation partition problem (NP-hard) in pseudopolynomial time NM where N is size of the list and M is the sum of the elements in the list. Implemented in Haskell with a memoisation "trick".
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
partition.hs

README.md

partition

Solves the optimisation partition problem (NP-hard) in pseudopolynomial time NM where N is size of the list and M is the sum of the elements in the list. Implemented in Haskell with a memoisation "trick".

mindiff takes a list and calculates the minimum difference between the sum of partitions of the list into two lists.