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]
topsis = Topsis(table)
result = topsis.solve()
# Access results
best_idx = topsis.index_of_best_alternative
worst_idx = topsis.index_of_worst_alternative
ranking = topsis.ordered_indices
PROMETHEE
from znum import Znum, Promethee, Beast
table = [weights, *alternatives, criteria_types]
promethee = Promethee(table)
sorted_alternatives = promethee.solve()
# Access results
best_idx = promethee.index_of_best_alternative
worst_idx = promethee.index_of_worst_alternative
ranking = promethee.ordered_indices
Development
# Install dependencies
pip install -e ".[dev]"
# Run tests
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file znum-0.6.0.tar.gz.
File metadata
- Download URL: znum-0.6.0.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06b399d96fb03a4f51f3ed94a795a82907fab968821c3796803a9faf7a9090eb
|
|
| MD5 |
4514978c4fd76311b3eb87bac49c5d25
|
|
| BLAKE2b-256 |
ef17e022ef57f393e269bc5ce1bbc26ad4eb875e0f01ffd922a5c7fe766344bb
|
Provenance
The following attestation bundles were made for znum-0.6.0.tar.gz:
Publisher:
publish.yml on MahammadNuriyev62/Znum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
znum-0.6.0.tar.gz -
Subject digest:
06b399d96fb03a4f51f3ed94a795a82907fab968821c3796803a9faf7a9090eb - Sigstore transparency entry: 909222750
- Sigstore integration time:
-
Permalink:
MahammadNuriyev62/Znum@2fdb753fc55d364d9629aed205ec66e1a56ce693 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/MahammadNuriyev62
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2fdb753fc55d364d9629aed205ec66e1a56ce693 -
Trigger Event:
release
-
Statement type:
File details
Details for the file znum-0.6.0-py3-none-any.whl.
File metadata
- Download URL: znum-0.6.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8ecfa6a6a4d50eb294f810f48779a854613c565573ca6c6eade4de2c93535d7
|
|
| MD5 |
6dbe3dcb1e023d97d599b984b133bda5
|
|
| BLAKE2b-256 |
e5b59654a3bc54c2ff8b9fc5924a657a0a75b2a386bfebafd328d40cf043c602
|
Provenance
The following attestation bundles were made for znum-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on MahammadNuriyev62/Znum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
znum-0.6.0-py3-none-any.whl -
Subject digest:
a8ecfa6a6a4d50eb294f810f48779a854613c565573ca6c6eade4de2c93535d7 - Sigstore transparency entry: 909222754
- Sigstore integration time:
-
Permalink:
MahammadNuriyev62/Znum@2fdb753fc55d364d9629aed205ec66e1a56ce693 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/MahammadNuriyev62
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2fdb753fc55d364d9629aed205ec66e1a56ce693 -
Trigger Event:
release
-
Statement type: