Skip to main content

A library for combinatorics operations and utilities

Project description

Combinatorics Utils

A Python library for generating value combinations, specifically designed to handle combinations with repetition of specific sizes.

Installation

You can install this package locally using pip:

pip install combinatorics_utils

Usage

Combinations with Repetition

Generate combinations of a set of values with a specified size.

from combinatorics_utils import combinations_with_repetition

values = [1, 2, 3]
size = 2

# Generate combinations of length 2 allowing repetition
result = combinations_with_repetition(values, size)

for combo in result:
    print(combo)

Example Output:

[1, 1]
[1, 2]
[1, 3]
[2, 2]
[2, 3]
[3, 3]

Features

  • Efficient generation of combinations with repetition.
  • Logic to prevent duplicate combination sets (multiset equality).

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

combinatorics_utils-0.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

combinatorics_utils-0.0.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file combinatorics_utils-0.0.2.tar.gz.

File metadata

  • Download URL: combinatorics_utils-0.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for combinatorics_utils-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4ae3da56ac5e612e3e78e8529596b162d11772bbf7e1c322b5446d1950245103
MD5 5a3c3cb3318b318517cfb9b4189ebdcf
BLAKE2b-256 456311833c86a211d1d739dc3827c8c053ef44557b9f5bbfc5b0f74f236c14f3

See more details on using hashes here.

File details

Details for the file combinatorics_utils-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for combinatorics_utils-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c71a9e5f23d01dc3397d6d587e68578bc5a20bd1cd7347748747d684ac21b246
MD5 a1a5439ed9126df76c3ffd5617b33c7b
BLAKE2b-256 7690e4b198f10fc3d1df537dc4d56d0b990f98c1cf81f2fd9bfe9e0ee2066d22

See more details on using hashes here.

Supported by

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