Skip to main content

Z-number data type for fuzzy arithmetic and multi-criteria decision making (TOPSIS, VIKOR, PROMETHEE)

Project description

Znum

A Python library for Z-number arithmetic and multi-criteria decision making (MCDM).

A Z-number is a fuzzy number with two components:

  • A: The main fuzzy set values (restriction on values)
  • B: The confidence/belief values (reliability of A)

Znum supports full mathematical operations (addition, subtraction, multiplication, division, power), comparison operators, and includes implementations of TOPSIS, VIKOR, and PROMETHEE optimization methods.

Installation

pip install znum

Quick Start

from znum import Znum

# Create Z-numbers
z1 = Znum([1, 2, 3, 4], [0.1, 0.2, 0.3, 0.4])
z2 = Znum([2, 4, 8, 10], [0.5, 0.6, 0.7, 0.8])

# Arithmetic operations
z3 = z1 + z2
z4 = z1 * z2
z5 = z1 - z2
z6 = z1 / z2

# Comparison
print(z1 > z2)  # False
print(z1 < z2)  # True

# Power
z7 = z1 ** 2

MCDM Methods

TOPSIS

from znum import Znum, Topsis, Beast

# Create weights, alternatives, and criteria types
weights = [Znum([0.2, 0.3, 0.4, 0.5], [0.1, 0.2, 0.3, 0.4])]
alternatives = [[Znum([7, 8, 9, 10], [0.6, 0.7, 0.8, 0.9])]]
criteria_types = [Beast.CriteriaType.BENEFIT]

table = [weights, *alternatives, criteria_types]
result = Topsis.solver_main(table)

PROMETHEE

from znum import Znum, Promethee, Beast

table = [weights, *alternatives, criteria_types]
promethee = Promethee(table)
sorted_alternatives = promethee.solve()

Development

# Install dependencies
pip install -e ".[dev]"

# Run tests
pytest

License

MIT

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

znum-0.1.0.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

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

znum-0.1.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file znum-0.1.0.tar.gz.

File metadata

  • Download URL: znum-0.1.0.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for znum-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a16e40ed3cd1ac1b801888bc8798c06fffe48b1fdb944d35c4ab75a31a7c591f
MD5 60c02d29c9977d5c5a3c3f24f5c3504a
BLAKE2b-256 5d0e770476379e89162246ee222ac450d4ba45b6259e0f4735802464d6e51333

See more details on using hashes here.

Provenance

The following attestation bundles were made for znum-0.1.0.tar.gz:

Publisher: publish.yml on MahammadNuriyev62/Znum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file znum-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: znum-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for znum-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6e09e09d95b29f299d6fae1b579029b3690f19ed87263bc3844809d1da5b94a
MD5 09431385657b1b854c28060de39e091b
BLAKE2b-256 d1beeffd2ab5bfbc78c063108f5cadcf8b1e52d243a30507c5129817e0f59503

See more details on using hashes here.

Provenance

The following attestation bundles were made for znum-0.1.0-py3-none-any.whl:

Publisher: publish.yml on MahammadNuriyev62/Znum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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