Intuitionistic Fuzzy Model of the Hungarian Algorithm for the Salesman Problem and Software Analysis of a Shipping Company Example

Here we propose for the first time a temporal intuitionistic fuzzy extension of the Hungarian method for solving the Travelling Salesman Problem (TIFHA-TSP) based on intuitionistic fuzzy logic and index matrices theories. The time for passing a given route between the settlements depends on different factors. The expert approach is used to determine the intuitionistic fuzzy time values for passing the routes between the settlements. The rating coefficients of the experts take the times into account. We are also developing an application for the algorithm's provision to use it on a real case of TIFHA-TSP.


I. INTRODUCTION
H AMILTON [11] defined the travelling salesman problem (TSP). The Hungarian algorithm (HA) was described by Kuhn in 1955 [6]. In today's dynamic environment, some of the parameters of this problem are unclear and rapidly changing. Traditional optimisation methods are not easily applicable to this problem. The use of intuitionistic fuzzy logic proposed by Atanassov [8] as an extension of Zadeh's fuzzy (F) logic [12] allows us to model uncertainty. The TSP and related problems have been solved through various techniques, including meta-heuristic algorithms [1]. FTSP with trapezoidal and triangular fuzzy costs has been solved in [2], [14] using the fuzzy Hungarian method. An improved Hungarian method is described in [15] for FTSP. The optimal solution of triangular intuitionistic FTSP is found [10] using the fuzzy HA. From the literature review we can see that optimal solutions in uncertainty are found only with triangular IF parameters, which are a special case of IF sets. Here we will extend our previous implementation of an IF Hungarian method [16], [19] by using temporal IF pairs and index matrices [9] to find the solution for the TSP at a certain moment in time to fulfil delivery requests. We will denote this approach as Temporal IF HA for the TSP (TIFHA-TSP). We are also in the process of developing a software application for the provision of TIFHA-Work is supported by the Asen Zlatarov University through project Ref.
No. NIX-449/2021 "Index matrices as a tool for knowledge extraction". TSP and with its help we apply TIFHA-TSP in a real case. The experts' ratings are taken into account in a way similar to [8]. The rest of this work contains the following sections: Section II describes the definitions of index matrices (IMs) and temporal intuitionistic fuzzy pairs (TIFPs). In Section III, we describe TIFHA-TSP and software for its implementation, and then apply it to a real case. Section IV marks some conclusions and some aspects for future research.

II. TIFP AND INDEX MATRICES
In this section, we will recall the definitions of temporal intuitionistic fuzzy pairs (TIFPs) and index matrices (IMs), as well as some operations and relations with them from [3], [9].

Temporal Intuitionistic Fuzzy Index Matrix (TIFIM)
We remind the definition of a TIFIM [9] where I be a fixed set of indices, (K, L, T ¢ I ), and its elements are TIFP. T is a some fixed temporal scale and its element t g (g = 1, . . . , g, . . . f ) are time-moments.
III. AN OPTIMAL TEMPORAL IF HA FOR THE TSP This section describes a type of temporal intuitionistic fuzzy TSP to find the the fastest route for fulfilling all delivery requests to certain sites with temporal intuirionistic fuzzy data. The IFTSP has the following description: The seller must visit m settlements K = {k 1 , . . . , k i , . . . , k m } at time t f . He wants to start from a certain settlement, visit each settlement once and then return to his starting point. The time c k i ,l j ,t f (for 1 f i, j f m, i ; = j) for switching from settlement k i to l j at a particular moment t f are given TIFPs, depending on the peak hours of the day, the condition of the roads, the road conditions, etc. factors. The ratings of the experts {r 1 , . . . , r s , . . . , r D } in the form of TIFPs are defined on the basis of their participation in λ s (t f )(s = 1, ..., D) evaluating time procedures respectively before a particular moment t f and were reflected in the final assessment of the travel time from one point to another. Our aim is to choose the visiting sequence of the settlements so that its total time is minimal.

A. An Optimal Temporal Intuitionistic Fuzzy HA for TSP
Let us be given the following TIFIMs, in accordance with the problem: The initial IM C, which consisting the time for passing the road from settlement k i to settlement l j at the current moment t f has the form: We can see, that |K| = m + 1 and |L| = n + 1; The auxiliary matrices in the algorithm have the forms: . . , k m } and for 1 f i f m: rc k i ,e 0 ,t f is equal to 0 or 1, depending on whether the k i -th row of K 0 of the matrix S is crossed out; where L 0 = {l 1 , l 2 , . . . , l n } and for 1 f j f m: cc k i ,l j ,t f is equal to 0 or 1, depending on whether the l j -th row of L 0 of the matrix S is crossed out. Let us rc k i ,e 0 ,t f = cc r 0 ,l j ,t f = 0. In the beginning of the algorithm, the initial IM for passing the road from settlement k i to settlement l j at a current moment t f are constructed by application of similar expert approach, described in [3], [8], [19].
to the uncertain evaluation of the time for passing the road of the d s -th expert from the k i -th settlement to the l j -th settlement at a current time moment t f . If the optimistic (pessimistic) scenario is obtained, then the maximum (minimum) degree of membership µ k i ,l j ,d s ,t f , proposed by the experts, will be the time evaluation for passing the road from the k i -th settlement to the l j -th settlement at a current time t f . The degree of non-membership of the time evaluation for passing the road from the k i -th settlement to the l j -th settlement at a current time t f is calculated as 1-(minimum) maximum degree of membership, proposed by the experts.
The index matrix interpretation of the described process for creating of the IM C is as follows: Let the ordinal coefficient r s (t f ) of each expert (s * D) is defined by an TIFP ïδ s (t f ), ε s (t f )ð, which elements can be interpreted respectively as his degree of competence and of incompetence at a current time t f . Then the IM , "k i * K, "l j * L, "s * D, 1 f q f 3 is constructed and it contains the final time evaluation for passing the road from the k i -th settlement to the l j -th settlement at a current time t f .
If we use # 7 1 = ïmin, maxð, then the decision maker accepts super pessimistic scenario, with # 7 2 = ïaverage, averageð the decision maker assumes averaging scenario and with # 7 3 = ïmax, minð he proposes super optimistic scenario for the time evaluation between the settlements.
The steps of TIFHA-TSP approach are as follows: Step 1. This step checks the problem balance requirement according to [6]. For this aim, the algorithm compares the number of rows with the number of columns in C.
Step 1.1. If the number of rows is greater than the number of columns, then a dummy column l n+1 * I is entered in the matrix C, in which all time evaluations c k i ,l n+1 (i = 1, . . . , m) are equal to ï1, 0ð; otherwise, go to the Step 1.2. For this purpose, the following operations are executed: , whose elements are equal to ï1, 0ð; -the new cost matrix is obtained by: Step 1.2. If the number of columns is greater than the number of rows, then a dummy row k m+1 * I is entered in the time matrix, in which all time evaluations are equal to ï1, 0ð. Similar operations to those in Step 1.1. are performed. Let us create IM S = [K, L, {s k i ,l j }] such that S = C.
Step 2. In each row k i of K of S, the smallest element is found among the elements s k i ,l j ,t f ( j = 1, . . . , n) and it is subtracted from all elements s k i ,l j ,t f for j = 1, 2, . . . , n. Go to Step 3.
Step 2.1. For each row k i of K of S, the smallest element is found and is recorded as the value of the element s k i ,R,t f : If the minimum elements are more than one, then one of them is chosen arbitrary. We create S 1 and S 2 : Step 2.2. The smallest element s k i ,l v j ,t f is subtracted from the elements s k i ,l j ,t f ( j = 1, . . . , m). Let us create IM B = pr K,R,t f S.
Step 3. For each index l j of L of S, the smallest element is found among the elements s k i ,l j ,t f (i = 1, . . . , m) and it is subtracted from all elements s k i ,l j ,t f , for i = 1, 2, . . . , m at a particular moment t f . Go to Step 4. Similar operations to those in Step 2. are executed. They are presented in [16].
Step 4. At this step are crossed out all elements s k i ,l j ,t f for ïk i , l j ,t f ð * {Index (max ν),k i /l j (S)} or equal to ï0, 1ð in S with the minimum possible number of lines (horizontal, vertical or both). If the number of these lines is m, go to Step 6. If the number of lines is less than m, go to Step 7. This step introduces IM D[K 0 , L 0 ,t f ], which has the same structure as the IM X. We use to mark whether an element in S is crossed out with a line. If d k i ,l j ,t f = 1, then s k i ,l j ,t f is covered with one line; if d k i ,l j ,t f = 2, then s k i ,l j ,t f is covered with two lines. The IMs CC[r 0 , L 0 ] and RC[K 0 , e 0 ] reflect whether the element is covered by a line in a row or column in the S matrix.
for i = 1 to m, for j = 1 to n If s k i ,l j ,t f = ï0, 1ð (or ïk i , l j ,t f ð * Index (max ν),k i /l j (S)) and d k i ,l j ,t f = 0, Then we count the covered rows and columns in CC and RC: If count(Index (1) (RC))+count(Index (1) (CC)) = m, then go to Step 6, otherwise to Step 5.
Step 5. We find the smallest element in the IM S that it is not crossed by the lines in Step 4, and subtract it from any uncovered element of S, and we add it to each element, which is covered by two lines. We return to Step 4. The operation AGIndex min R ,(; §) (S) = ïk x , l y ,t f ð finds the smallest element index of the IM S. The operation IO 2 (max,min) ïSð, ïk x , l y ,t f Sð subtract it from any uncovered element of S. Then we add it to each element of S, which is crossed out by two lines: Go to Step 4.
Step 6. Here we search each row until we find a row-wise exactly single element, which is a TIFFalseP. We mark this pair to make the assignment, then cross out all elements lying in the respective column. If there lie more than one unmarked TIFFalseP in any column or row, then choose one of them arbitrary and cross out the remaining elements in its row or column. We repeat until no unmarked elements are left in the reduced IM. Then each row and column of S has exactly one marked TIFFalseP. If the solution does not satisfy the route conditions, adjustments need to be made to the assignments with minimum increase to the total cost [14]. The optimal solution X opt [K 0 , L 0 , {x k i ,l j ,t f }] is found where the elements ï1, 0ð in X correspond to the marked elements in S.
{for i = 1 to m, for j = 1 to n if (ïk i , l j ,t f ð * Index (max ν),k i /l j (S)) and d k i ,l j ,t f ; = 3), then The optimal time evaluation for X opt at a particular moment t f is: If we want an optimistic result, we can use 3 in place of 1.
Step 7. The old rank coefficients of the experts, involved in the evaluation process are changed by [8]: if the expert has assessed correctly if the expert had not given any estimation The complexity of the HA as used here is comparable with that of the standard Hungarian method [7], [13]. To explore the effect of TIFHA-TSP on various input data, we are currently developing a software tool that implements the algorithm. It reads a file containing the matrix of time evaluations and performs the steps stated above. It is written in C++ and uses the IndexMatrix template class [4] with TIFPs. Several operations had to be adjusted, most significantly the IFP and TIFP subtraction operation, which will now return a false pair ï0, 1ð of the two operands are equal, and subtracting a false pair from another (T)IFP will result in no change.

B. A Real Case Study of TIFHA-TSP
In this section, we demonstrate TIFHA-TSP with a real case study in a shipping company for a day of the week in Bulgaria. The carrier needs to visit 4 settlements and wants to make a cyclical route passing all of them. The evaluation TIFPs are given by experts with ratings {ï0.9, 0.05ð, ï0.8, 0.05ð, ï0.95, 0.05ð} defined on the basis of their participation in 10 (s = 1, ..., D) past procedures respectively in the days before t f . The initial evaluation time IM C[K, L,t f ] incorporating the ratings of the experts is: After application of the software utility, described in the section (III), we get the following results: Step 1. m = n, therefore the problem is balanced.
Step 2. -3. In each row k i of K of S, the smallest element is found among the elements s k i ,l j ,t f ( j = 1, . . . , n) and it is subtracted from all elements s k i ,l j ,t f for j = 1, 2, . . . , n. For each index l j of L of S, the smallest element is found among the elements s k i ,l j ,t f (i = 1, . . . , m) and it is subtracted from all elements s k i ,l j ,t f , for i = 1, 2, . . . , m at a particular moment t f . The form of the IM C(t f ) is Step 4. At this step are crossed out all elements s k i ,l j ,t f equal to ï0, 1ð in S with the minimum possible number of lines. Since each row and each column contain exactly one false pair, we will cross out all four rows. The test for the optimality is satisfied (the number of lines = m = n = 4).
Step 5 does not apply, because there are no uncrossed elements. The next steps will give us the final results. In Step 6, we find that the optimal route is: A 2³ D 2³ C 2³ B 2³ A and in an optimistic scenario it will take the optimal time of travelling with degree of membership 0.65 and degree of non-membership 0.13, forming the IFP ï0.65, 0.13ð. In a pessimistic scenario, the optimal time IFP is ï0.4, 0.45ð.

IV. CONCLUSION
In the study, we defined TIFHA-TSP, a temporal intuitionistic fuzzy extension of the Hungarian method for solving the TSP using the IF logic and IMs concepts. The developed software, which implements this TIFHA-TSP approach, is applied to a real case in a shipping company at a certain time. In the future, the research will continue with the development of TIFHA-TSP so that it can find the optimal solution of the IFTSP, where the initial data have saved in extended TIFIMs [9] and also with a software for its implementation.