Skip to main content

A collection of PARTITION algorithms

Project description

partition package

This is a collection of several algorithms to solve PARTITION.

test lint mypy coverage

The package offers two heuristics:

The latter is also available in a more efficient version for some instances.

Resources on the partition problem

The implementation stem from a project during my master's degree. The resulting thesis is available, feel free to read especially the sections 1 to 3. From the references, I would like to recommend the following publications in particular:

R. E. Korf. A complete anytime algorithm for number partitioning. Artif. Intell., 106(2): 181–203, dec 1998. ISSN 0004-3702. doi:10.1016/S0004-3702(98)00086-1.

B. Hayes. Computing science: The easiest hard problem. American Scientist, 90(2):113–117, 2002. ISSN 00030996. URL http://www.jstor.org/stable/27857621.

S. Mertens. The easiest hard problem: number partitioning. In Computational Complexity and Statistical Physics. Oxford University Press, 12 2005. ISBN 9780195177374. doi:10.1093/oso/9780195177374.003.0012.

Installation and usage

Run pip install partitionpy to install.

Example code:

import partitionpy

partitionpy.karmarkar_karp([4,5,6,7,8])
partitionpy.naive_greedy([4,5,6,7,8])
partitionpy.complete_karmarkar_karp([4,5,6,7,8])
partitionpy.kernelized_complete_karmarkar_karp([4,5,6,7,8])
partitionpy.complete_greedy([4,5,6,7,8])

Alternatives

This is by far not the only package for PARTITION. You may want to check out numberpartitioning and prtpy as well.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

partitionpy-1.0.0.tar.gz (632.8 kB view details)

Uploaded Source

Built Distribution

partitionpy-1.0.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file partitionpy-1.0.0.tar.gz.

File metadata

  • Download URL: partitionpy-1.0.0.tar.gz
  • Upload date:
  • Size: 632.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for partitionpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 354299749d273c84fa4fefc46183630fa4986180f82f243fdeaee4f398b53930
MD5 35da7144bd13e190494ae6f0d9254989
BLAKE2b-256 63692e646fc10fef7d8d4b78578b0eebd26e6cf2f17872322bb59cad259176c9

See more details on using hashes here.

File details

Details for the file partitionpy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: partitionpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for partitionpy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ee80663c7473b77574d66391deea16ecdadb550963da89c5ee9ac689a25b05f
MD5 eb24f33764201ec197801284d7076e62
BLAKE2b-256 05d36517501c307c3971c5444d3813606b049eb63b23ce4dcd6ed7a88654f577

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page