Skip to content

bulanik

Easy-to-use fuzzy numbers, fuzzy inference and fuzzy multi-criteria decision making in pure Python, with no runtime dependencies.

Bulanık is Turkish for fuzzy. Optional bridges connect bulanik to LumiX (optimization modelling) and sezgi (metaheuristics), and the optional bulanik.plot module draws publication-quality figures of all of it.

  • Fuzzy numbers

    Triangular and trapezoidal numbers, intuitionistic, Pythagorean, Fermatean and q-rung orthopair numbers, spherical, picture and neutrosophic numbers. Immutable, validated on construction, with named operator families.

    :octicons-arrow-right-24: Numbers

  • Aggregation and scales

    Weighted average and geometric mean, expert aggregation, membership functions, linguistic variables and ready-made linguistic scales.

    :octicons-arrow-right-24: Aggregation

  • Fuzzy inference

    Mamdani, Sugeno and Tsukamoto systems from plain-text rules, interval type-2 systems with type reduction, and ANFIS learning from data.

    :octicons-arrow-right-24: Mamdani inference

  • Decision making

    AHP, fuzzy AHP, SWARA, entropy and best-worst weights; TOPSIS, VIKOR, WASPAS, EDAS and Chen's fuzzy TOPSIS for the ranking.

    :octicons-arrow-right-24: Weighting

  • Bridges

    Solve the best-worst method and Zimmermann's fuzzy programs with LumiX, tune Sugeno systems and train ANFIS with sezgi.

    :octicons-arrow-right-24: LumiX bridge

  • Figures

    One validated palette, light and dark themes, direct labels: bulanik.plot.membership, orthopair, variable, mamdani_output, ranking and more.

    :octicons-arrow-right-24: bulanik.plot

A ten-line taste

Rate three suppliers with linguistic terms and rank them with fuzzy TOPSIS. The block runs when the site is built:

from bulanik.mcdm import fuzzy_topsis
from bulanik.scales import EXAMPLE_TFN_7 as scale

ratings = scale.convert([["G", "VG", "F"], ["F", "G", "G"], ["MP", "F", "VG"]])
weights = [scale["G"] / 10, scale["MG"] / 10, scale["F"] / 10]
result = fuzzy_topsis(ratings, weights, ["benefit", "benefit", "cost"],
                      alternatives=["A", "B", "C"], criteria=["quality", "service", "price"])
print(result.ranking)
print({k: round(v, 3) for k, v in result.scores.items()})
('A', 'B', 'C')
{'A': 0.591, 'B': 0.427, 'C': 0.292}

Where to go next

  • New here? Install, then the Quickstart: five short recipes, each one runnable.
  • Conventions explains what every function promises: immutability, validation, tolerances, and the one naming rule for operator families, scores and methods.
  • Choosing a method maps problems to number types, inference systems and MCDM methods.
  • The user guide has one page per topic with the formulas the code uses; the examples are 24 complete scripts with their real output; the API reference lists every public name.