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.1.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.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: combinatorics_utils-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f8a91506b133ade89971a4b531118be21097d555d22f1b154eccdf99285c4bb9
MD5 6d6fc333b84901deee9d49701099cd04
BLAKE2b-256 dfd15e4c81c2f8c9adbebcdd42a65f8e1c39cba56378cd9f6d504f3d96c94def

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for combinatorics_utils-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b34c780b0b174515078df81f3ec1b9cbe6996df7c42c867349736ce3b9a37fa
MD5 64cb5895a0fe4ebaa1ddc9cc290f1b0d
BLAKE2b-256 761809d72bb0234cd0841fc8b396836369a44987bbb917552bf9d04569245039

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