Software implementation of intuitionistic fuzzy sets and some operators

: In this paper, we present a software implementation of the framework of Intuitionistic Fuzzy Sets (IFSs). The presented implementation allows the user to interactively shape an IFS, to compute, plot and visualize various of operators for IFS and allows for the modeling of real world problems.


Introduction
The Intuitionistic Fuzzy Sets (IFSs) were introduced in 1983 in [2]. Its theory was described in details in [4,9], but by the moment there is only one attempt for software implementation of some IFS-operations and operators [1].
The proposed in this paper software implementation for visualization and computation of IFSs, and operations and operators over those, can be applied in the modeling of real world problems. We used Python as programming language. In addition to that, we implement a functionality for serialization of the IFSs in json files. The serialized IFSs can have properties, such as size of the circle in the triangle representation, colour, etc.

Short remarks on IFSs
Since the introduction of fuzzy sets by Zadeh [20] there have been a number of generalizations. Most of them consist of replacing the range [0, 1] by more general algebraic structures satisfying the axioms for a lattice (cf. Birkhoff [13]) -they are called L-fuzzy sets (cf. Goguen [14]).
A very popular extension of fuzzy sets is the Atanassov's generalization -intuitionistic fuzzy set (IFS) (cf. Atanassov [2,4,9]), where the corresponding lattice takes the natural form of a triangular representation (described in the next section). In addition to the membership function of a FS, there is another function, expressing a notion of non-membership degree with the same domain X and range [0, 1], for which the sum of the membership and non-membership degrees should never exceed 1. That is, in the framework of IFSs we have an additional degree, expressing the lack of knowledge/information. This makes the theory invaluable to extend the uncertainty of the limited level of crisp and even fuzzy precision in real world situations and preferences.
In this section, following [4,9], we will give the basic concepts form IFS theory that will be objects of discussion in the subsequent sections, which will be devoted to the software implementation of these basic concepts.

Definition of an IFS
Let a (crisp) set X be fixed and let A be a fixed symbol.
An IFS A * in X is an object of the following form where functions µ A : X → [0, 1] and ν A : X → [0, 1] define the degree of membership and the degree of non-membership of the element x ∈ X to the IFS A * , respectively, and for every x ∈ X 0 ≤ µ A (x) + ν A (x) ≤ 1.
Obviously, every ordinary fuzzy set has the form then π A (x) is the degree of non-determinacy (uncertainty) of the membership of element x ∈ X to set A. In the case of ordinary fuzzy sets, π A (x) = 0 for every x ∈ X. Three very important notions to be used throughout the text are the following: U * X ( or U * (X)) := { x, 0, 0 | x ∈ X}, Let us recall two of the main operators, introduced by Atanassov in [2], called modal operators. Necessity and possibility operators (denoted by and ♦, respectively) applied on an intuitionistic fuzzy set A ∈ IF S(X) have been defined as: From the above definition it is evident that where is the prefix operator ∈ { , ♦}, operating on the class of intuitionistic fuzzy sets.

Geometrical interpretations of an IFS
There are several geometrical interpretations of the IFSs (cf. Atanassov [9]), the earliest of which in the literature is the preprint from 1989 [3]. The three most relevant of them are discussed below (Figs. 1,2,4). Figure 1. Standard geometrical representation of the membership degree µ A and the non-membership degree ν A . 53 Therefore, to every element x ∈ X we can map a unit segment of the form: r r x On the other hand, the situation in Fig. 3 is impossible. Let a universe X be given and let us consider the figure F in the Euclidean plane with a Cartesian coordinate system (see Fig. 4). Let us call the triangle F "IFS-interpretational triangle". If A ∈ IF S(X) is a fixed intuitionistic fuzzy set in the universe X, then we can construct a function f A : Note that if there exist two different elements Figure 4. Triangular representation of a point from X in F .

Main operations on IFSs and their geometrical presentations
In this section, we give the most common operations on IFSs and their geometrical interpretations. Following [2,4,9], for every two IFSs A and B the following relations and operations can be defined (everywhere below "iff" means "if and only if"). They are analogous of the standard set theoretical operations of inclusion (cf. [9]): Let us now give the standard operations of intersection, union, as shown on Fig. 5 and Fig. 6 which are specific for the IFSs (cf. [9]): If A and B ∈ IF S(X), then a function f A∩B assigns to Figure 5. Representation of the intersection operation ∩ between A and B ∈ IF S(X).
If A and B are two IFSs over X, then a function f A∪B assigns to

Standard topological operators on IFSs
Following [9], we introduce two topological operators. For every IFS A, where and where The following operators are defined in Atanassov [9], as extensions of the two topological operators C and I: (21) where K, L, k, l have the forms (16), (17), (19), (20), respectively. The geometrical interpretations of these operators applied on the IFS A in Fig. 7 are shown in Fig. 8 Figure 7. Example of an IFS on which topological operators will be applied.      Figure 10. Example of C µ .

57
Another example of the action of operator C µ (A) is illustrated in Fig. 10. It is obvious from Fig. 10 that the operator C µ transforms points x 2 and x 5 to one point on the hypotenuse. More generally, all points from the hatching trapezoid can be transformed to point A in Fig. 11 (a). Similar is the situation in Fig. 11 (b), where all points from the hatching trapezoid can be transformed to point B by the operator I ν .
In [8], the two new topological operators C * µ and I * ν are introduced as Figure 12. Extended closure C * µ and interior I * ν operators applied on the IFS from Fig. 7.

58
In [10], Atanassov and Ban introduced the "weight-center operator" over a given IFS A by: where card(X) is the number of the elements of a finite set X. For the continuous case, the "summation" may be replaced by integration over X.

Extended modal operators
Following Atanassov [6,9], we construct a series of operators in the next subsections. Some of the extended modal operators will be defined in a more suitable way to be considered in the framework of the topological neighbourhoods and their properties. The change is a trivial linear transformation of the constants α and β, so that if α, β = 0, 0 the operator will be the identity.

Operators D α and F α,β
The next operator represents both operators from (7) and ♦ from (8). Let α ∈ [0, 1] be a fixed real number. Given an IFS A, we define an operator D α as follows: From this definition it follows that D α (A) is a fuzzy set, because: To every point x ∈ X the operator f Dα(A) assigns a point of the segment between f A (x) and f ♦A (x) in the triangle F from Fig. 4 depending on the value of the argument α ∈ [0, 1] (see Fig. 13). As in the case of some of the above operations, this construction needs auxiliary elements which are shown in Fig. 13. As we noted above, the operator D α is an extension of the operators and ♦, but it can be extended even further.
Let α, β ∈ [0, 1] and α + β ≤ 1. Define (see [9]) the operator F α,β , for the IFS A, by Figure 14. Extended modal operators F α,β and D α A feature that both operators share, together with the first two modal operators, is that each of them changes the degree of uncertainty. While the first three operators make this degree equal to zero, the operator F α,β only decreases its value, increasing the degrees of membership and non-membership of the IFS' elements.

Operator G α,β
Let α, β ∈ [0,1]. We are going to change the operator defined by Atanassov (cf. [9]) That way the above extended modal operator will look like, We made this substitution in order to start at A for (α, β) = (0, 0) and gradually to reach U * X . Obviously, G 0,0 (A) = A and G 1,1 (A) = U * X , where U * X is defined by (6). The operator f assigns a point f G α,β (x) in the rectangle with vertex f A (x) and vertices with coordinates, pr 1 f A (x), 0 , 0, pr 2 f A (x) and 0, 0 , where pr i p is the i-th projection (i = 1, 2) of the point p, to every point x ∈ X, depending on the value of the arguments α, β ∈ [0, 1] Let n ≥ 1 be an integer and α i , β i ∈ [0, 1], i = 1, . . . , n. Then, we can construct the IFS In [19], Vassilev studied some properties of this IFS.
We state here four other extended modal operators over an IFS A, given the fixed real numbers α, β ∈ [0,1] (see Atanassov [9]), as In the above definitions for H α,β and H * α,β we make the substitution: α → (1 − α) and for J α,β and J * α,β we make the substitution: β → (1 − β). That way we get the last four extended modal operators: We made those substitutions because we want to start the mapping from µ A , ν A at α, β = 0, 0 .
The operator f H α,β (A) assigns to every point x ∈ X a point f H α,β (A) (x) of the rectangle with vertices with coordinates 0, pr 2 f A (x) , 0, pr 2 f A (x) and vertices f A (x) and f A (x), depending on the value of the parameters α, β ∈ [0, 1] (see Fig. 16 (a)).
The operator f J α,β (A) assigns to every point x ∈ X a point f J α,β (A) (x) of the rectangle with vertices with coordinates pr 1 f ♦A (x), 0 , pr 1 f A (x), 0 and vertices f A (x) and f ♦A (x), depending on the value of the parameters α, β ∈ [0, 1] (see Fig. 16 Figure 16. Extended operators H α,β and H α,β The operator f H * α,β (A) assigns to every point x ∈ X a point f H * α,β (A) (x) from the figure with vertices with coordinates 0, pr 2 f A (x) and 0, 1 and vertices f A (x) and f A (x), depending on the value of the parameters α, β ∈ [0, 1] (see Fig. 17 (a)).

Software implementation of the operators for IFS
In this section, we explain how the software implementation can be used. It consists of open source codes that can be freely used and further customized by the users. The IFSs and their operators have been modelled in the programming language Python and visualized through the library matplotlib.
We are going to briefly describe the most important python scripts and definition of object and their main functionalities.

Universal set
The script universal set.py consists of the definition of the main object describing an IFS and main operations for their mutation and consistency checks.
• Add new object to the Universe In the next script the LATTICE structure of the IFSs is taken into account and two main orderings between IFSs are defined as posets (partially ordered sets). The main operations for posets: the standard one and the π-ordering as described in [15].
• @abc.abstractmethod 11 def eq(self, first, second):  None -iff the elements are not comparable 16 Raise exception iff they are not of comparable classes

IF stack bars representations and stack bars memberhsip and non-membership histogram
In the next script we introduce functions that plot two types of stack bars for IFSs. We also show a 2D histogram taking into account the membership and non-memberhsip functions. Next visualizations can be reproduced by the command: python3 ifs test.py

3D Histograms
In the next file are defined two types of 3D Histograms.
• The first one on Fig. 21 represents 3D Histogram for the membership and non-membership degrees.
• The second one on Fig. 22 represents 3D Histogram for 2D coordinates of the elements of the IFS represented in the triangle.
It is noteworthy that such 3D histograms for the degrees of intuitionistic fuzziness are of particular interest for the visualization of the results of intercriteria analysis as discussed in [11,12] and further implemented in [18]. The novelty with the herewith proposed histogramic approach is the better visualization of the cases when otherwise distinct pairs of criteria form numerically identical intercriteria pairs.

Topological Operators tool
In this section we present the topological operators tool. Next visualizations can be reproduced by the command: python3 ifs topo modeler.py As we can see on Fig. 23, it is an interactive plot where one can change: • font size of the corresponding point  And the source code and images blow correspond to: • A screenshot of the UI showing the result of the preinterior and preclosure operators on the IFS A with binary inclusion indicator metrics (as defined in [17]) of the IFS and its mappings are visualized (cf. [16]) as shown on Fig. 24.

Modal operators tool
In a similar way as in the previous section, we present here the four main modal operators tool. Let us, for example fix, α = 0.25, β = 0.3 Next visualizations, as shown on Fig. 26 and Fig. 27 The user can interactively drag and drop the dark blue points in the triangle corresponding to the original IFSs. By pressing the button 'Save IFS' all the results are are saved in .json formats. That is, in the folder .\working dir we can see the following files: • ifs 0000 original .json

Conclusion
The for computation and visualization of IFSs and their operators, proposed in this paper implementation, can be used for the modeling of real world problems within the framework of IFS. These operators can also be applied to the results from intercriteria analysis approach in order to obtain better visual feedback regarding their inherent topological aspects. Furthermore, in the future, we plan to discontinue matplotlib as the main visualization library by adopting more sophisticated and flexible tools to allow better interactivity between the user and the software.