Fuzzy Majority Algorithms for the 1-Median and 2-Median Problems on a Fuzzy Tree

ABSTRACT In the classical p-median problem, we want to find a set Y containing p points in a given graph G such that the sum of weighted distances from Y to all vertices in V is minimised. In this paper, we consider the 1-median and 2-median problems on a tree with fuzzy weights. We show that the majority property holds for fuzzy 1-median problem on a tree. Then based on a proposed ranking function and the majority property, a fuzzy algorithm is presented to find the median of a fuzzy tree. Finally, the algorithm is extended to solve 2-median problem on fuzzy trees.


Introduction
The p-median problem is an important issue in the location theory. In this problem, we want to find p best places for locating facility centers to provide the demands of n customers such that the sum of weighted distances from customers to the nearest facility is minimised. The p-median problem was first introduced by Hakimi in 1964 [1]. Kariv and Hakimi [2] showed that this problem is NP-hard. An O(pn 2 ) algorithm for the p-median and related problems on tree graphs was presented by Tamir [3]. Tragantalerngsak et al. [4] studied single-source capacitated facility location problem and proposed a Lagrangian relaxation-based branch and bound algorithm for this problem. Charikar and Guha [5] presented a constant-factor approximation algorithm for the k-median problem. An uncertain model for single-facility location problems on networks was presented by Gao [6].
Since median problem is NP-hard, some heuristic methods were presented for finding the solution of this problem (e.g. see [7][8][9][10]). Median problem has many applications in the real world such as establishing public services in transportation networks. However, it is seldom known to determine the value of parameters precisely. In most of the cases, according to the opinion of decision-makers the value of parameters is defined approximately by some degree of uncertainty. The fuzzy set theory is one of the best tools for illustrating this uncertain parameter and model the problem in a mathematical form. In 1999, Canos et al. [11] considered the fuzzy p-median problem and presented an exact algorithm to solve it. Moreno Perez et al. [12] considered fuzzy location problems on networks. Kutangila and Verdegay [13] studied p-median problems in a fuzzy environment. Uno et al. [14] considered the facility location problem on a network with fuzzy random weights. In 2013, Mehrjerdi and Nadizadeh [15] presented a greedy clustering method to solve capacitated location-routing problem with fuzzy demands. Then in 2016, Mohammadi et al. [16] considered a bi-objective single allocation p-hub center-median problem. Definition 2.7: A fuzzy numberÃ is a fuzzy set on the real line that satisfies the condition of normality and convexity.

Definition 2.8:
A fuzzy numberÃ on R is a triangular fuzzy number, if its membership function is defined as follows: where 0 ≤ wÃ ≤ 1 is a constant number that is called the height of generalised triangular fuzzy numbers. The parameters a l , a m and a u are real numbers. Also fuzzy number is denoted byÃ = (a l , a m , a u ; wÃ).

Remark 2.1:
If wÃ = 1, thenÃ = (a l , a m , a u ; 1) is a normalised triangular fuzzy number and is denoted byÃ = (a l , a m , a u ). Generally,Ã is called a generalised triangular fuzzy number if 0 ≤ wÃ ≤ 1 as shown in Figure 1. The fuzzy number is a crisp number if a l = a m = a u and wÃ = 1.

Remark 2.2:
The opposite (or image) of generalised triangular fuzzy number A = (a l , a m , a u ; wÃ) can be defined as −Ã = (−a u , −a m , −a l ; wÃ).

Remark 2.3:
In this paper, the set of all generalised triangular fuzzy numbers on the real line is denoted by F and zero triangular fuzzy number is denoted by0 = (0, 0, 0).

Definition 2.9:
Function ψ : F → {−1, 1} is defined as follows: (1) Figure 1. Generalised triangular fuzzy number (a l , a m , au; w). Definition 2.10: LetÃ = (a l , a m , a u ; wÃ) andB = (b l , b m , b u ; wB) be two generalised triangular fuzzy numbers. Then, arithmetics of fuzzy numbers are defined as follows: Now we are able to define the fuzzy graph and fuzzy network. Let G = (V, E) be a connected undirected graph in which V = {v 1 , v 2 , . . . , v n } is the set of vertices and E = {e 1 , e 2 , . . . , e m } is the set of edges. Each edge e ∈ E consists of infinite points that join vertex u to vertex v and is represented by e = (u, v). The vertices u, v ∈ V are then named the extremes of e. The function l(.) is defined on E and corresponds to each edge e ∈ E a positive number l(e) where denotes the length of edge e. Also a function w(.) is defined on V, so that for each vertex v ∈ V, w(v) is a positive number that indicates the weight of v. According to these concepts, the fuzzy graph and fuzzy network are defined as follows.

Definition 2.13:
A fuzzy graph is the structure G = (V, E, ρ, μ) where V is a vertex set, E is the edge set, and ρ : V −→ [0, 1] and μ : E −→ [0, 1] are the membership functions of vertex set and edge set, respectively, in which A fuzzy graph is denoted byG = (Ṽ,Ẽ). Definition 2.14: LetG = (Ṽ,Ẽ) be a fuzzy graph, and w(.) and l(.) be the weight and the length functions that are defined onṼ andẼ, respectively. Ifw andl correspond fuzzy positive numbers to all or some elements ofṼ andẼ, respectively, then network N = (V, E, w, l) reduces to a fuzzy networkÑ = (Ṽ,Ẽ,w,l).
A fuzzy network is classified as follows:  In this paper, we deal with the fuzzy networkÑ = (V, E,w, l).

New ranking function
Ranking of fuzzy numbers is an important procedure in many fuzzy optimisation and decision-making problems. Hence, different methods of ranking fuzzy numbers have been studied by many authors such as [28][29][30][31]. However, most of these proposed methods have several disadvantages. For instance, they are not linear, they are unable to distinguish all fuzzy numbers and they cannot rank all generalised fuzzy numbers. Thus in this paper, a new method with less computational process is presented in which there is no integral operator and any radical functions. This new method can rank triangular fuzzy numbers with the best accuracy. Also, it must be mentioned that the ranking results of the new method are the same as famous methods. Also, the new method is a linear ranking method and if two fuzzy numbers have the same ranking according to this method, certainly these two generalised triangular fuzzy numbers are equal. As a result, the presented method can effectively distinguish different generalised triangular fuzzy numbers. Also, the suggested ranking method can rank real numbers as effectively as fuzzy numbers. The simple ranking method is proved to always guarantee the consistency between the ranking of generalised triangular fuzzy numbers and their images. Recently, Jian et al. [32] proposed a triangular approximation operator that preserves the centroid of fuzzy numbers which is an important index for evaluating fuzzy numbers. Thus, it is possible to approximate any arbitrary fuzzy number with a triangular fuzzy number with the same centroid point. Therefore, our method can be used for all fuzzy numbers. In the Appendix, by six comparative examples the superior validity, applicability, efficiency and simplicity of proposed method in comparison with the existing methods are illustrated.
Our new method is based on the centroid point for ranking generalised triangular fuzzy numbers. According to Wang et al. [33], for any generalised triangular fuzzy numberÃ = (a l , a m , a u ; wÃ), its centroid can be determined by Clearly, it can be concluded from (5) that the centroid point corresponding to a generalised triangular fuzzy number is obtained based on the parameters a l , a m , a u and wÃ. Thus, we define a novel ranking NR index of generalised triangular fuzzy numberÃ = (a l , a m , a u , wÃ) in R 4 as follows: It can be seen that in some previous existing methods, a real number is assigned to each fuzzy number. Then, the fuzzy numbers are ranked by comparing their corresponding real numbers. However, some important information is lost by this conversion. Hence, in our new method for saving these important information, a unique quartet NR index in R 4 is assigned to each generalised triangular fuzzy number. The NR index involves the centroid point, the core, the half-length of support set and the height of generalised triangular fuzzy number that can easily be computed. Actually, the NR index is easily computed for any triangular fuzzy number with less computation processes and without using operators such as integral or any functions such as radical and so on. In contrast with the existing ranking methods, in the next theorem it is shown that if the NR indexes of the two generalised triangular fuzzy numbers are equal, then both of these generalised triangular fuzzy numbers are also equal.
Using the above equation and Definition 2.9, it can be concluded that ψÃ = ψB.
Now generalised triangular fuzzy numbers can be ordered using lexicographical order on NR index. LetÃ = (a l , a m , a u ; wÃ) andB = (b l , b m , b u ; wB) be two arbitrary generalised triangular fuzzy numbers. According to NR index, two generalised triangular fuzzy numbers A andB can be compared as follows: where the symbol < L denotes the lexicographical order and defined as follows: and (x m < y m ) .
The lexicographical order is a perfect order in R 4 [34], thus the proposed ranking is able to rank all generalised triangular fuzzy numbers. Unlike many existing methods, crisp numbers can be ranked as effectively as triangular fuzzy numbers using the proposed ranking. It is necessary to point out that the proposed method not only is able to rank similar generalised triangular fuzzy numbers but also needs very simple calculations. Some more important properties of the proposed ranking approach are given in the following sections. Proposition 3.1: LetÃ = (a l , a m , a u ; wÃ) be an arbitrary generalised triangular fuzzy number, then Proof: According to Remark 2.2 and Definition 2.9, we have Also, the following relation holds: Proof: The result can be achieved easily using (6) and Proposition 3.1. From Proposition 3.1, it is obviously concluded that the simple ranking method is proved to always guarantee the consistency between the ranking of triangular fuzzy numbers and their images.

Proposition 3.3:
Let be an arbitrary finite subset of F. Then the following properties hold: Proof: According to lexicographical order, the items (1) and (2) can be obtained easily.
To show item (3), sinceB C , according to lexicographical order on NR index, one of the following cases holds: 3 .
Suppose that Then, sinceÃ B , therefore Thus Similarly, the three other cases forB <C can be easily proved.

Proposition 3.4: Suppose be an arbitrary finite subset of F and
Proof: According to Definition 2.8, we have Now, according to the lexicographical order on NR index, we concludeÃ >B.
Also the following property can be easily proved. Proof: SinceÃ >B, one of the following cases holds according to lexicographical order on NR index: We show that cases (i) and (iii) hold. Other cases can be proved similarly.
To show (i), suppose By adding (c l + c m + c u )/3 to both sides of the above inequality, we obtain According to (6) and Definition 10, we conclude,Ã ⊕C >B ⊕C. Now we show case (iii). Suppose that SinceÃ,B andC have the same sign, according to Definition 2.10, it is obtained that ψÃ ⊕C = ψB ⊕C = ψÃ = ψB. Consequently, we obtain Now, by adding ψB ⊕C · (c u − c l )/2 to both sides of the inequality (7), we have It is concluded from (6) and Definition 2.10 thatÃ ⊕C >B ⊕C. Proposition 3.7: LetÃ = (a l , a m , a u ) andB = (b l , b m , b u ) be two triangular fuzzy numbers with the same sign and k ∈ R + . The proposed ranking is linear. That is Proof: Using Definition 2.10, we have And (6) yields SinceÃ andB have the same sign and k ∈ R + , and according to Definition 2.10, we conclude ψ k·Ã⊕B = ψÃ = ψB. Now, by replacing this term in (9), we have Most of the previous existing ranking methods do not satisfy this property. However, it is proved in the recent proposition that the proposed method is a linear ranking method. Generally in the real-world problems, linear ranking requires less computation. Also, in actual applications, the linear ranking can just be used like fuzzy simplex and so on [35,36].

Fuzzy median algorithms
In this section, first, a fuzzy algorithm for finding 1-median of a fuzzy tree is given. Then, the algorithm is extended to solve 2-median problem on a fuzzy tree.

Fuzzy 1-median problem
Let X = (V, E) be a tree. For any vertex v ∈ V, the sub-tree X v is a tree that is rooted at v and W(X v ) is the sum of the weights of all vertices of X v . Let the median be represented by m.
Suppose that S and T are two sub-trees that are obtained by eliminating the edge (s, t) on X in which s ∈ S and t ∈ T. For any sub-tree S of X, we define For the classical 1-median problem on a tree, Goldman [37] presented a majority algorithm based on the following lemmas.

Lemma 4.2 ([37]): If W(S) ≥ W(T), then the problem of finding the median of X is equivalent to finding the median of sub-tree N s in which the weight of vertex s is replaced by w(s) + W(T).
Now consider the problem with fuzzy demands. In the following, first we will prove that the above two lemmas hold whenever the demands are in a fuzzy form. Then, the fuzzy majority algorithm are presented.

Lemma 4.3:W(S) W (T) if and only if m ∈ S.
Proof: LetW(S) W (T) and suppose that y is any arbitrary vertex of T and NR is our new presented ranking index. It is sufficient to prove thatf (y) f (s).

NR(f (y)) ≥ NRf (y, T) + d(s, y)NR(W(T))
It means thatf (y) ≥f (s). Thus the median cannot be in sub-tree T. Now on the contrary, let m ∈ S andW(S) ≺W(T). Suppose that y is any arbitrary element of S. Then

NR(f (y)) > NR(f (y, S)) + d(y, t)NR(W(S))
This means that m is not in the sub-tree S, that is in contradiction with the assumption of lemma. Thus,W(S) W (T).

Lemma 4.4: IfW(S) W (T), then the problem of finding the median of X is equivalent to finding the median of sub-tree N s in which the weight of vertex s is replaced byw(s) ⊕W(T).
Proof: Based on Lemma 4.3, it is concluded that the median is in sub-tree S. Suppose that the objective function on the sub-tree N s is presented byf . For any y ∈ S, we have It is obviously seen that the difference of two objective functionsf (y) andf (y) is a constant valuef (s, T). Thus, we can conclude that these two objective functions are equivalent.

Now based on Lemmas 4.3 and 4.4, we can present the following fuzzy algorithm. Fuzzy 1-median algorithm
Step 1: Choose an arbitrary vertex r ∈ V as the root of tree T. Let S be the set of children of r. CalculateW(T) andW(T v k ), for any v k ∈ S as follows: Step 2: Based on the presented ranking method find the vertex v i in S such that

IfW(T v i ) W (T)/2, then r is the median and stop.
Step To explain the algorithm, note that in each iteration of the algorithm we calculate the weights of all rooted sub-trees of the root's children. If the weight of largest sub-tree is less than or equal to the half weight of tree, then using Lemma 4.3 the root is the median. Otherwise, we use Lemma 4.4 to make a new smaller tree and continue the method.

Fuzzy 2-median problem
Now consider the problem of finding two medians of a tree with fuzzy demands. The two median of a crisp tree can be obtained by the arc-deletion algorithm (see e.g. [38]). In the same as the classical method of solving 2-median problem, the fuzzy 2-median problem can be solved by the following arc-deletion algorithm.

Fuzzy 2-median Algorithm
Step 1: For any edge e = (s, r) ∈ E, delete e. Thus, the tree is partitioned in two sub-trees T s and T r with the vertex sets V s and V r , respectively. For any of these two sub-trees, find the 1-median and call them m s and m r , respectively.
Step 2: For any m s and m r , calculate the following value: Step 3: Using the proposed ranking method, find the minimum ofF(m s , m r ), k = 1, 2, . . . , m − 1. The pair (m , m ) corresponding to this minimum is 2-median of tree, i.e.

End algorithm.
Note that the strategy in this algorithm involves in removing one edge of a tree at a time. Removal of an edge decomposes the tree into two parts. Then 1-median of both these trees and their corresponding costs are computed. The edge for which the sum of the cost of 1-medians is the lowest is the optimal split edge, and the two 1-median vertices are the resulting 2-medians of the tree.

Numerical examples
In this section, the efficiency of fuzzy algorithms is shown using numerical examples.  To find 1-median of this tree, the iterations of fuzzy 1-median algorithm are as follows.
Let T = T v 2 and r = v 2 then go to step 1.

Example 5.2:
Consider the fuzzy tree of Example 5.1. In this example, we want to find 2median of the fuzzy tree. Table 1 shows the results of fuzzy 2-median algorithm for this tree. In this table, m 1 and m 2 are the medians of sub-trees which are obtained by deleting the arc in the first column. In the last column of this table, the objective functions are presented. Based on our presented ranking function, it is concluded that Thus, the vertices v 2 and v 5 are two medians of mentioned fuzzy tree that is obtained by deleting the arc (v 2 , v 5 ) and the value of optimal objective function is equal to (9.5,26.8,42;1).

Conclusion
Since p-median problems are used to model real-world situations, it is necessary to consider the uncertain parameters. On the other hand, for solving this fuzzy problem and most of the other fuzzy decision-making problems, ranking fuzzy numbers is an important tool. In this paper, a new method is presented for ranking all triangular fuzzy numbers. Unlike many existing methods, the proposed method is a linear ranking method and it is a simple implementation that makes use of the algorithm more effectively to solve fuzzy real-world problems. Also, based on this ranking, a unique index is assigned to each fuzzy number. Thus, our new method is an acceptable ranking method for ranking generalised fuzzy numbers and their images. Moreover, crisp numbers can be ranked as effectively as fuzzy numbers using the proposed ranking. Also, it is shown that the new method is more simple, reasonable and consistent with human intuitions than previous methods that are mentioned in the literature. In this paper, we also proposed a fuzzy algorithm to find the 1median of a tree with fuzzy weights. Then, we extended the algorithm for solving 2-median problem on a tree with fuzzy weights.

Disclosure statement
No potential conflict of interest was reported by the authors.     The ranking results of presented ranking function for the two given sets are compared with four other methods in Table A1. As it is seen for the first set of numbers, the results of Chu-Tsao's method [39] and Chen [40] are unreasonable and incompatible with human intuition. However, for our new method, we obtain the same result as Cheng [41] and Nasseri's methods [42]. Also, it should be mentioned as an important property of the new approach that it is simpler than Cheng [41] and Nasseri's methods [42] in computational processes. The above four sets are shown in Figure A3 and the comparative results are also given in Table A2. It can clearly be seen that (1) The same reasonable results are obtained using our proposed method and the listed methods for ranking the triangular fuzzy numbersÃ,B in Set 1 of Figure A3. Also the new approach is simpler than the listed methods in computational processes.  (2) The fuzzy numbersÃ andB in Set 2 of Figure A3 cannot be ranked according to Yager [43], Murakami et al. [34], and Cheng's methods [41]. However, the results of the methods proposed by Lee and Chen [44], Akyar et al. [45], Chen and Chen [46], and the method proposed in this paper are the same. Also, the fuzzy numbersÃ andB in Set 3 of Figure A3 cannot be ranked using Cheng's method [41], while the proposed method and all other methods have the same ranking results. This set shows that the fuzzy numbers and their images can be ranked using the proposed method consistently. (3) Fuzzy numbersÃ andB in Set 4 of Figure A3 can just be ranked according to the proposed methods by Cheng [41], Akyar et al. [45], and our proposed method.  [43], Fortemps and Roubens [47], and Liou and Wang [48] as shown in Table A3.   It is clear from Table A3 that none of the methods are able to rank these fuzzy numbers completely. Yager [43], and Fortemps and Roubens [47] methods are shown to fail to distinguish the fuzzy num-bersB andC. Also, the methods of Liou and Wang [48] cannot distinguish the fuzzy numbersB,C and A,D, respectively. But, the proposed method gives a complete ranking order.  [43] 0.3 0.3Ã ∼B Murakami et al. [34] 0.233 0.3Ã <B Cheng [41] 0.461 0.5831Ã <B Chen and Chen [46] 0.2063 0.2579Ã <B Lee and Chen [44] ---Akyar et al. [45] --- Figure A6. Three sets of fuzzy numbers.

ORCID
Example A.5: In Figure A5, the generalised triangular fuzzy numberÃ = (0.1, 0.3, 0.5; 0.8) and triangular fuzzy numberB = (0.1, 0.3, 0.5; 1) are presented. According to the new method, the ranking order isÃ <B. The comparison results of the proposed method with some existing methods are given in Table A4. According to Table A4, we cannot obtain any reasonable ranking from Yager's method [43]. Also, Lee's [44], and Akyar's methods [45] cannot rank the generalised fuzzy numbers of Figure A5. Obviously, the inconsistency problem of other methods in ranking fuzzy numbers is overcome with the proposed ranking method.