Applied Mathematics and Computation 174 (2006) 660–668 www.elsevier.com/locate/amc
A new algorithm for the discrete fuzzy shortest path problem in a network Tzung-Nan Chuang a b
a,*
, Jung-Yuan Kung
b
Department of Merchant Marine, National Taiwan Ocean University, Keelung 20224, Taiwan Department of Information Management, Chinese Naval Academy, Kaohsiung, 81342, Taiwan
Abstract In a network, the arc lengths may represent time or cost. In practical situations, it is reasonable to assume that each arc length is a discrete fuzzy set. We called it the discrete fuzzy shortest path problem. There were several methods reported to solve this kind of problem in the open literature. In these methods, they can obtain either the fuzzy shortest length or the shortest path. In this paper, we propose a new algorithm that can obtain both of them. The discrete fuzzy shortest length method is proposed to find the fuzzy shortest length, and the fuzzy similarity measure is utilized to get the shortest path. An illustrative example is given to demonstrate our proposed algorithm. Ó 2005 Elsevier Inc. All rights reserved. Keywords: The shortest path problem; Discrete fuzzy sets; Fuzzy similarity
1. Introduction In the past decades, much attention has been paid to the shortest path problem in a network since it is important to a great deal of applications such as *
Corresponding author. E-mail addresses:
[email protected] (T.-N. Chuang),
[email protected] (J.-Y. Kung). 0096-3003/$ - see front matter Ó 2005 Elsevier Inc. All rights reserved. doi:10.1016/j.amc.2005.04.097
T.-N. Chuang, J.-Y. Kung / Appl. Math. Comput. 174 (2006) 660–668
661
routing, communication, and transportation [1]. In a network, the shortest length is the minimum of all path lengths. In the crisp world, it is apparent to obtain the shortest length. For example, there are two path lengths in a network, l1 = 4 and l2 = 5. The shortest length is the minimum of l1 and l2. It is trivial to obtain the shortest length is 4. However, in real world, the arc length in the path of network may represent cost or time and it can be considered to be a discrete fuzzy set. If the arc lengths are fuzzy, it is not so obvious to obtain the shortest length. For example, in a network, there are two path lengths that are discrete fuzzy sets L1 and L2. Assume L1 = {1.0/5, 0.6/6} and L2 = {1.0/ 4, 0.7/7}, that is, L1 has lengths 5 and 6 with a membership grade of 1.0 and 0.6, respectively; L2 has lengths 4 and 7 with a membership grade of 1.0 and 0.7, separately. The shortest length is the minimum of L1 and L2. The length 4 in L2 is a possible shortest length since it is smaller than both of the possible lengths in L1. The length 7 in L2 is, however, not a possible shortest one since it is larger than both of the possible lengths in L1. On the other hand, both the lengths 5 and 6 in L1 are possible shortest length since they are smaller than the possible length 7 in L2. The lengths, 4, 5 and 6 are then possible shortest length while 7 is not. As mentioned above, L1 has two possible shortest lengths 5 and 6; L2 has one possible shortest length 4. Thus, neither L1 nor L2 can represent the final set of possible shortest length. In this paper, we propose a discrete fuzzy shortest length method to find the fuzzy shortest length in a network. Lots of approaches were developed to deal with the fuzzy shortest path problem [3–9]. Dubois and Prade [3] presented a method based on FloydÕs algorithm and FordÕs algorithm [1,2] to treat the fuzzy shortest path problem. Their method can obtain the shortest path length whereas the corresponding shortest path in the network perhaps does not exist. Later, Klein [7] proposed an improved algorithm that was based on dynamical programming recursion. KleinÕs algorithm can get not only the shortest path length but also the corresponding shortest path in the network; nevertheless, the assumption that the possible arc lengths are 1 through a fixed integer seems to be impractical. In this paper, to overcome the drawback mentioned above, we develop a method to determine the fuzzy shortest length from source node to the destination node in the network. Then, by means of fuzzy similarity measure to evaluate similarity degree between fuzzy lengths, we decide a practical shortest path whose length is closest to the yielded fuzzy shortest length. The rest of this paper is organized as follows. In Section 2, some related fuzzy set operations and fuzzy similarity measure are reviewed. In Section 3, a method to find the discrete fuzzy shortest length is presented. In Section 4, through combining the previous method with fuzzy similarity measure, a new algorithm is developed to get the shortest length as well as the shortest path. An illustrative example is also included to demonstrate our proposed algorithm. Finally, some conclusions are drawn.
662
T.-N. Chuang, J.-Y. Kung / Appl. Math. Comput. 174 (2006) 660–668
2. A review of related fuzzy set operations and similarity measure In this section, some basic fuzzy set operations and fuzzy similarity measure are reviewed. Both of them are beneficial to the treatment of the discrete fuzzy shortest problem. 2.1. Fuzzy set operations In this section, some fuzzy set operations related to this paper are reviewed. Let A be a discrete fuzzy set and can be represented as follows: A ¼ fAða1 Þ=a1 ; Aða2 Þ=a2 ; . . . ; Aðan Þ=an g; where aj is a real number, A(aj) is membership grade of aj, j = 1, . . . , n and 0 < A(aj) 6 1. The support of a fuzzy set A in the universal set X is the crisp set that contains all the elements of X that have a non-zero membership grade in A. That is suppðAÞ ¼ fx 2 X jAðxÞ > 0g. There are a variety of fuzzy set operations. Among them, four basic and commonly used operations are complementation, union, intersection and addition. The definitions of them are presented as follows [10]: and the member(1) The complementation of a fuzzy set A is denoted by A ship function of A is given by AðxÞ ¼ 1 AðxÞ 8x 2 X . ð1Þ (2) The intersection of fuzzy sets A and B is denoted by A \ B and the membership function of A \ B is given by ðA \ BÞðxÞ ¼ min½ðAðxÞ; BðxÞÞ 8x 2 X . ð2Þ (3) The union of fuzzy sets A and B is denoted by A [ B and the membership function of A [ B is given by ðA [ BÞðxÞ ¼ max½ðAðxÞ; BðxÞÞ
8x 2 X .
ð3Þ
(4) The addition of fuzzy sets A and B is denoted by A + B and the membership function of A + B is given by ðA þ BÞðzÞ ¼ max min½ðAðxÞ; BðyÞÞ z¼xþy
8x 2 X .
ð4Þ
The above fuzzy set operations will be helpful to the development of algorithm in this paper. 2.2. Fuzzy similarity measures In many practical situations, we often encounter how to distinguish between two similar sets or groups. That is to say, we need to employ a measurement
T.-N. Chuang, J.-Y. Kung / Appl. Math. Comput. 174 (2006) 660–668
663
tool to measure similarity degree between them. A similarity measure S: F2 ! [0, 1) should satisfy some properties shown below [13]: (P1) (P2) (P3) (P4)
S(A, B) = S(B, A) for all A, B 2 F; SðE; EÞ ¼ 0, if E is a crisp set and E is the complement of E; S(H, H)PS(A, B) for all A, B, H 2 F; If A B C for all A, B, C 2 F then S(A, C) 6 S(A, B) and S(A, C) 6 S(B, C).
Several similarity measures satisfying (P1)–(P4) had been presented to evaluate the similarity degree between two fuzzy sets and some of them had been applied to linguistic approximation and system analysis [11–17]. However, it is difficult to point out which one is the best among these reported similarity measures. In this paper, in order to compute easily, we pick out the following similarity measure to measure the similarity degree between two fuzzy lengths [16]: m X SðA; BÞ ¼ ½1 jAðxk Þ Bðxk Þj=m. ð5Þ k¼1
As mentioned previously, the similarity measure defined in (5) will help decision makers to decide which path is the shortest one.
3. The discrete fuzzy shortest length method In real world, the arc length in a network can be considered to be a discrete fuzzy set and so can the path length. Suppose that there are m fuzzy path lengths Li for i = 1, 2, . . . , m, we expect to find the fuzzy shortest length. In the crisp world, a length is the shortest one if any other length is greater than or equal to it. In other words, if a length is the shortest one of a set of length, then this length does exist and the other length smaller than it does not exist. We extend this idea to find the fuzzy shortest length, which is also a fuzzy set. We give two examples below to illustrate how to extend this idea to fuzzy sets. Example 1. Assume two path lengths in a network are l1 = 5 and l2 = 6. Crisp sets can be represented by fuzzy sets. l1 = 5 can be written as L1 = {1.0/5}, which means that the membership grade of 5 is 1.0. Similarly, l2 = 6 can be written as L2 = {1.0/6}. It means the existent possibility of 6 is 1.0. If the shortest length is 6, then 6 exist and the other lengths that are smaller than 6 do not exist. It is obvious that 5 is smaller than 6 and its possibility is 1.0. The possibility that the shortest length is 6 equals 0.0 (=1.0 ^ (1–1.0)). Similarly, if the shortest length is 5, then 5 exist and the other lengths smaller than 5 do not exist. It is obvious that there are no lengths smaller than 5. The possibility that
664
T.-N. Chuang, J.-Y. Kung / Appl. Math. Comput. 174 (2006) 660–668
the shortest length equals 5 is 1.0 (=1.0 ^ (1–0.0)). As a result, the shortest length is {1.0/5, 0.0/6}, which is equivalent to {1.0/5}. We now can extend this idea to fuzzy sets. This is illustrated by the next example. Example 2. Assume two path lengths in a network are L1 = {1.0/5, 0.6/6} and L2 = {0.7/4, 1.0/7}. If the shortest length is 5 in L1, then 5 exist and the other lengths that are smaller than 5 do not exist. It is obvious that 4 in L2 is smaller than 5 and its possibility is 0.7. The possibility that the shortest length is 5 in L1 is equal to 0.3 (=1.0 ^ (1–0.7)). Similarly, we can find the possibility that the shortest length is 6 in L1 equals 0.3 (=0.6 ^ (1–0.7)). The possibility that the shortest length is 4 in L2 is 0.7 (=0.7 ^ (1–0.0)); the possibility that the shortest length is 7 in L2 equals 0.0 (=1.0 ^ (1–1.0)). Accordingly, the shortest length is {0.7/4, 0.3/5, 0.3/6, 0.0/7}, which can also be expressed as {0.7/4, 0.3/5, 0.3/6}. Next, by generalizing two discrete fuzzy lengths to m discrete fuzzy lengths, we will show how to find the shortest length from m discrete fuzzy lengths. In order to distinguish it from ‘‘the shortest length’’ which is commonly used to represent the shortest length of a set of crisp lengths, we call it ‘‘the discrete fuzzy shortest length’’. Assume there are m discrete fuzzy path lengths, L1, L2, . . . , Lm. L1(x)/x represents that the element x in L1 has a membership grade L1(x). As noted for crisp lengths, x is the shortest length if any other length is greater than or equal to x. Therefore, the membership grade SL1(x) of x in L1 is the possibility that x in L1 is the shortest length, and it can be expressed as SL1 ðxÞ ¼ L1 ðxÞ ^ L02 ðxÞ ^ L03 ðxÞ ^ ^ L0m ðxÞ h i ¼ min½L1 ðxÞ; L02 ðxÞ; L03 ðxÞ; . . . ; L0m ðxÞ ¼ min L1 ðxÞ; min½L0k ðxÞ ; k6¼1
ð6Þ L0k ðxÞ
L0k
where denotes the membership grade for all lengths in not greater than x. For a different x, there exist a different L0k ðxÞ, and it can be expressed as y
L0k ðxÞ ¼ 1 max Lk ðyÞ.
ð7Þ
y2LK
Substitution of (7) into (6) can yield h i y
ð8Þ
Similarly, we can obtain the membership grade SLt(x) of x in Lt as h i y
ð9Þ
k6¼1
k6¼t
y2LK
y2LK
The membership grade Lmin(x) of x as the shortest length of m discrete fuzzy lengths is then
T.-N. Chuang, J.-Y. Kung / Appl. Math. Comput. 174 (2006) 660–668
665
m
Lmin ðxÞ ¼ SL1 ðxÞ _ SL2 ðxÞ _ SL3 ðxÞ _ _ SLm ðxÞ ¼ max SLt ðxÞ t¼1 ii h h m 0 ¼ max min Lt ðxÞ; min Lk ðxÞ ¼ max t k6¼t t¼1 iii h h h y
y2LK
ð10Þ
According to (10), we can find the membership grade that x in Lk is the shortest length of m discrete fuzzy path lengths. An example is given to illustrate the above formula. Example 3. Let two fuzzy path lengths in a network be L1 = {0.5/3, 1.0/4, 0.6/ 5} and L2 = {0.6/4, 0.6/5, 1.0/6}, respectively. We want to find the discrete fuzzy shortest length. By (9), one can get SLt(x) for different x as follows: SL1 ð3Þ ¼ min½L1 ð3Þ; ð1 0Þ ¼ 0.5; SL1 ð4Þ ¼ min½L1 ð4Þ; ð1 0Þ ¼ 1.0; SL1 ð5Þ ¼ min½L1 ð5Þ; ð1 0.6Þ ¼ 0.4; SL2 ð4Þ ¼ min½L2 ð4Þ; ð1 0.5Þ ¼ 0.5; SL2 ð5Þ ¼ min½L2 ð5Þ; ð1 1.0Þ ¼ 0.0; SL2 ð6Þ ¼ min½L2 ð6Þ; ð1 1.0Þ ¼ 0.0. From (10), one can obtain Lmin ð3Þ ¼ SL1 ð3Þ ¼ 0.5; Lmin ð4Þ ¼ SL1 ð4Þ _ SL2 ð4Þ ¼ 1.0 _ 0.5 ¼ 1.0; Lmin ð5Þ ¼ SL1 ð5Þ _ SL2 ð5Þ ¼ 0.4 _ 0.0 ¼ 0.4; and Lmin ð6Þ ¼ SL2 ð6Þ ¼ 0.0.
ð11Þ
Then, the discrete fuzzy shortest length is {0.5/3, 1.0/4, 0.4/5, 0.0/6} or equivalently {0.5/3, 1.0/4, 0.4/5}.
4. An algorithm for the discrete fuzzy shortest problem Suppose that in a directed acyclic network the arc lengths are fuzzy. We aim at determining the fuzzy shortest length Lmin and the shortest path needed to traverse from source node s to destination node d. By combining the discrete fuzzy shortest length method with similarity measure, the new algorithm is proposed as follows:
666
T.-N. Chuang, J.-Y. Kung / Appl. Math. Comput. 174 (2006) 660–668
Step 1. Form the possible paths from source node s to destination node d and compute the corresponding path lengths Li, i = 1, 2, . . . , m, for possible m paths. Step 2. Find the fuzzy shortest length Lmin by using the discrete fuzzy shortest length method. Step 3. Employ fuzzy similarity measure defined in (5) to yield the similarity degree S(Lmin, Li) between Lmin and Li for i = 1, 2, . . . , m. Step 4. Decide the shortest path with the highest S(Lmin, Li). It is worth remarking that for easier showing our proposed algorithm, in Step 1 we directly form the possible paths in the network. Alternatively, multiple labeling methods [4,9] can also be applied to our algorithm to reduce computational load; once the shortest path in Step 4 is found, the path in the original network can be formed via backwards composing technique. An illustrative example to demonstrate our proposed algorithm is given as follows: Example 4. A classical network with discrete fuzzy arc lengths is shown in Fig. 1 where the fuzzy arc lengths are P = {0.5/2, 1.0/3}, Q = {0.4/1, 1.0/3}, R = {1.0/ 2, 0.2/3, 0.1/4}, U = {1.0/2, 0.6/4}, V = {1.0/3, 0.5/4}, Y = {1.0/4, 0.7/5}, W = {0.6/4, 1.0/5, 0.5/6} and G = {1.0/3, 0.4/5}, respectively. Step 1. There are four possible paths in this network. They are path 1–2–4–5–6 with fuzzy path length L1 = P + U + W + G = {0.5/11, 0.5/12, 1.0/ 13, 0.4/14, 0.5/15, 0.4/16, 0.4/17, 0.4/18}, path 1–2–4–6 with fuzzy path length L2 = P + U + Y = {0.5/8, 1.0/9, 0.5/10, 0.5/11, 0.4/12}, path 1–2– 3–5–6 with fuzzy path length L3 = P + R + V + G = {0.5/10, 1.0/11, 0.4/12, 0.4/13, 0.4/14, 0.2/15, 0.1/16}, and path 1–3–5–6 with fuzzy path length L4 = Q + V + G = {0.4/7, 0.4/8, 1.0/9, 0.5/10, 0.4/11, 0.4/12}. Step 2. Make use of the discrete fuzzy shortest length method to obtain the fuzzy shortest length as Lmin = {0.4/7, 0.5/8, 0.6/9}. Step 3. By means of fuzzy similarity measure (5), one can get the similarity degree S(Lmin, Li) between Lmin and Li as follows:
U 2
P
4
R
1
Q
Y
W 3
6 5
V Fig. 1. Classical network.
G
T.-N. Chuang, J.-Y. Kung / Appl. Math. Comput. 174 (2006) 660–668
SðLmin ; L1 Þ ¼ 0.53; SðLmin ; L3 Þ ¼ 0.71;
667
SðLmin ; L2 Þ ¼ 0.85; SðLmin ; L4 Þ ¼ 0.94.
Step 4. We choose path 1–3–5–6 as the shortest path since the corresponding fuzzy length L4 has the highest similarity degree (=0.94) to the fuzzy shortest length Lmin. 5. Conclusions In the past, there were several methods reported to deal with the discrete fuzzy shortest path problem in the open literature. In these methods, they can obtain either the fuzzy shortest length or the shortest path. It is the purpose of this paper to propose a new algorithm that can obtain both of them. We present the discrete fuzzy shortest length method to find the fuzzy shortest length. This method is based on the idea that a crisp length is the shortest one if and only if any other length is larger than or equal to it. It owns a firm theoretic base in fuzzy sets theory and can be implemented effectively. Then, we employ the fuzzy similarity measure to measure the similarity degree between the fuzzy shortest length and each fuzzy path lengths. The path with the highest similarity degree is the shortest path. A classic example is also given to demonstrate our proposed algorithm. In the future, we will also make an effort to develop new algorithms for the fuzzy shortest path problem based on continuous types of fuzzy arc lengths such as L–R type, trapezoidal, and triangular fuzzy sets. References [1] P. Jenson, J. Barnes, Network Flow Programming, John Wiley and Sons, New York, 1980. [2] E. Lawler, Combinational Optimization; Networks and Matroids, Holt, Reinehart and Winston, New York, 1976. [3] D. Dubois, H. Prade, Fuzzy Sets and Systems: Theory and Applications, Academic Press, New York, 1980. [4] E.Q.V. Martins, On a multicriteria shortest path problem, Eur. J. Operat. Res. 16 (1984) 236– 245. [5] R. Yager, Paths of least resistance on possibilistic production systems, Fuzzy Sets Syst. 19 (1986) 121–132. [6] J. Broumbaugh-Smith, D. Shier, An empirical investigation of some bicriterion shortest path algorithm, Eur. J. Operat. Res. 43 (1989) 216–224. [7] C.M. Klein, Fuzzy shortest paths, Fuzzy Sets Syst. 39 (1991) 27–41. [8] K. Lin, M. Chen, The fuzzy shortest path problem and its most vital arcs, Fuzzy Sets Syst. 58 (1994) 343–353. [9] S. Okada, T. Soper, A shortest path problem on a network with fuzzy lengths, Fuzzy Sets Syst. 109 (2000) 129–140. [10] A. Kaufmann, Introduction to Fuzzy Arithmetic, Van Nostrand Reinhold, New York, 1985. [11] C. Murthy, S.K. Pal, D. Dutta Majumder, Correlation between two fuzzy membership functions, Fuzzy Sets Syst. 17 (1985) 23–38.
668
T.-N. Chuang, J.-Y. Kung / Appl. Math. Comput. 174 (2006) 660–668
[12] G.C. Oden, Integration of fuzzy linguistic information in language comprehension, Fuzzy Sets Syst. 14 (1984) 29–41. [13] X. Liu, Entropy, length measure and similarity measure of fuzzy sets and their relations, Fuzzy Sets Syst. 52 (1992) 305–318. [14] T. Gerstenkorn, J. ManÕko, Correlation of intuitionistic fuzzy sets, Fuzzy Sets Syst. 44 (1991) 39–43. [15] C.P. Pappis, N.I. Karacapilidis, A comparative assessment of measures of similarity of fuzzy values, Fuzzy Sets Syst. 56 (1993) 171–174. [16] L.K. Hyung, Y.S. Song, K.M. Lee, Similarity measure between fuzzy sets and between elements, Fuzzy Sets Syst. 62 (1994) 291–293. [17] W.J. Wang, New similarity measures on fuzzy sets and on elements, Fuzzy Sets Syst. 85 (1997) 305–309.