A REFINEMENT OF DIJKSTRA’S ALGORITHM FOR EXTRACTION OF SHORTEST PATHS IN GENERALIZED REAL TIME-MULTIGRAPHS

The networks of the present day communication systems, be it a public road transportation system or a MANET or an Adhoc Network, frequently face a lot of uncertainties in particular regarding traffic jam, flood or water logging or PWD maintenance work (in case of public road network), attack or damage from internal or external agents, sudden failure of one or few nodes. Consequently, at a real instant of time, the existing links/arcs of a given network (graph) are not always in their original/excellent condition physically or logically, rather in a weaker condition, or even sometimes disabled or blocked temporarily and waiting for maintenance/repair; and hence ultimately causing delay in communication or transportation. We do not take any special consideration if few of the links be in a better condition at the real time of communication, we consider only such cases where few links are in inferior condition (partially or fully damaged). The classical Dijkstra’s algorithm to find the shortest path in graphs is applicable only if we assume that all the links of the concerned graph are available at their original (ideal) condition at that real time of communication, but at real time scenario it is not the case. Consequently, the mathematically calculated shortest path extracted by using Dijkstra’s algorithm may become costlier (even in-feasible in some cases) in terms of time and/or in terms of other overhead costs; whereas some other path may be the most efficient or most optimal. Many real life situations of communication network or transportation network cannot be modeled into graphs, but can be well modeled into multigraphs because of the scope of dealing with multiple links (or arcs) connecting a pair of nodes. The classical Dijkstra’s algorithm to find the shortest path in graphs is not applicable to multigraphs. In this study the authors make a refinement of the classical Dijkstra’s algorithm to make it applicable to directed multigraphs having few links partially or fully damaged. We call such type of multigraphs by GRT-multigraphs and the modified algorithm is called by Dijkstra’s Algorithm for GRT-Multigraphs (DA-GRTM, in short). The DA-GRTM outputs the shortest paths and the corresponding min cost in a GRT-multigraph at real time and thus the solution is a real time solution, not an absolute solution. It is claimed that DA-GRTM will play a major role in the present day communication systems which are in many cases giant networks, in particular in those networks which cannot be modeled into graphs but into multigraphs.


INTRODUCTION
Graph Theory (Balakrishnan, 2005) has wide applications in several branches of Engineering, Science, Social Science, Statistics, Economics, Medical Science to list a few only out of many. Graph is also an important non-linear data structure in Computer Science. The model 'multigraph' (Biswas et al., 2012) JCS is a generalization of 'graph' where multiple links (edges/arcs) may exist between a pair of nodes. A huge and rich volume of literature is available in the area of 'Graph Theory', but unfortunately the 'Theory of Multigraphs' has not so far developed upto that extent to meet the present requirements to deal with real life network problems. The classical Dijkstra's algorithm (Dijkstra, 1959;Cormen et al., 2009) to find the shortest path from a source node to a destination node works well for the kind of network model which is a graph, but cannot be used to solve the Shortest Path Problem (SPP) in a multigraph. In real life applications, such as in Link State routing protocols are based on the concepts of Dijkstra's algorithm. Most of these applications were based on the fact that the concerned network is a simple directed graph, where there is at most one and only one arc between any two nodes in a single direction, i.e., in a network or a directed graph, between any two of its nodes u and v, there can be maximum two arcs, uv and vu. The classical Dijkstra's algorithm for finding single source shortest path in case of a directed graph has over the years found many real life applications, particularly in network theory, optimization, transportation. One of the reasons for large acceptance of Dijkstra's algorithm is its simplicity. But one major shortcoming of this algorithm, in its present form is that, it is limited to simple graphs only and cannot be implemented in case of multigraphs. There are many real life networks of communication systems or transportation systems which cannot be modeled into graphs, but can be well modeled into multigraphs because of the reason that there could be more than one link between a pair of neighbor nodes. We consider in our work here such type of real life networks, which are multigraphs without any loops (i.e., not pseudographs). Biswas et al. (2013a) modified the classical Dijkstra's algorithm to make it applicable to solve SPP in a multigraph and also considered the real time situation of a network where few (or even nil or all) of its links are not available to the communication system for the time being due to sudden damage (under repair at this period of time). Such type of multigraphs are called by Real Time Multigraphs (or RT-multigraphs). In the model of RT-multigraphs, one link is either 'available' or 'unavailable' for communication (i.e., link status is either 1 or 0). In this study, we consider more real situation of a network. For instance, one of the existing connecting roads from a city A to a city B which happens to be the shortest road between A and B in a public transport network is available but with water logging condition (flooded with one foot depth of water) at this real period of time causing the transportation by busses/vehicles very slow. This road/link is under repair but to regain its original condition it may take 10-12 h at least. Consequently, at this real period of time, having all these real time information in hand, the algorithm for SPP should consider the second shortest link between A and B instead of this mathematically shortest link. We thus consider the real time condition (physical or logical) of each and every link of a network quantified as a value in the closed interval [0,1] instead of discrete option in {0,1} and we call the corresponding multigraph as Generalized Real Time multigraph (GRT-multigraph). In a GRT-multigraph, all real time information is updated at every quantum q of time (pre-chosen by the concerned communication system). Then we solve the SPP in a GRT-multigraph with the philosophy of Classical Dijkstra's algorithm incorporating the necessary modifications, the new algorithm being called by Dijkstra's Algorithm for GRT-Multigraphs (DA-GRTM, in short). The notion of GRT-graphs can be viewed as a special case of the notion of GRTmultigraphs. For a quick visit of Dijkstra's Algorithm, one could see the book (Cormen et al., 2009). For a recent work on the theory of multigraphs, one could see (Biswas et al., 2012). The notion of RT-multigraph is introduced by Biswas et al. (2013a). In the next section, we introduce the notion of GRT-multigraph.

Generalized Real Time Multigraph (GRT-MultigrapH)
Consider a classical multigraph corresponding to a public transport network where there are four cities A, B, C and D connected by alternative links (roads) of various costs (here, distance in Km). As shown in the Fig. 1 below (an hypothetical example).
Suppose that at some period of time the links AB 1 and CD 2 are 'Not Available' (flooded heavily with water due to torrential rain), but all other links are 'Available'. However, it is expected that the link AB1 will be available for communication within 7 h next and the link CD2 will not be available for at least one day. Consequently, this multigraph physically reduces to the following directed RT-Multigraph G, (Fig. 2) at least for 7 h next.
In our proposed mathematical model of GRTmultigraphs (Fig. 3), we consider further amount of ground-reality by incorporating more amount of real time information from the network regarding the actual condition of each and every 'available' link to make the notion of RT-multigraphs (Biswas et al., 2013b) more dynamic, more useful and hence more efficient to the users for making an optimal strategy for a successful communication from a source node to a destination node.   For a given node u the node v will be designated as a 'neighbor' node of u if u has at least one link from u to v, irrespective of its status 'available' or 'unavailable' at some period of time. In our work here we consider real situations which are actually and frequently faced by the present communication systems. For example, consider

JCS
an Adhoc Network or a MANET in which there may exist multiple links between two neighbor nodes, but because of some reasons at some real instant of time one or more number of links may not be in the ideal condition (may be partially damaged or temporarily damaged, or even severely damaged, either physically or logically). Thus, although they are available for transmission of packets by a node u to its neighbor node v, but will cause the communication delayed (for a fully damaged condition, they are practically 'unavailable' as there cannot be any scope for communication via such links). This is a very useful information to the communication system if available to the sender nodes in advance. In the model of our real time multigraphs (RT-multigraphs) (Biswas et al., 2013b), we considered that a link is either 'available' or 'unavailable'. In this study, we consider the situation of reality with further dimension, considering more real time information about the actual condition of the available links. For this, first of all we introduce a new real time parameter tagged logically with each link called by 'Condition Factor' which signifies the 'link status' at the real time of actual communication.

'Condition Factor' (CF) of a Link at Some Instant
Consider a node u and its neighbor node v. Suppose that there are n (≥1) number of links from u to v outward which are uv 1 , uv 2 , ……, uv n . Let us designate them as 1 st , 2 nd , 3 rd ,….., n th . For each such link uv r , we define the condition factor (CF) or link status at this instant of time in the following way: • The ideal (i.e., best) 'condition factor' for each link uv r is 1, if it is available at its original condition without any damage or attack internally/externally at this moment of time and the node v is functional at the real time under consideration. We write CF(uv r ) = 1 • The worst 'condition factor' for each link uv r is 0, if either it is not available, i.e., at a condition of fully damaged/blocked at this moment of time and thus having no feasibility for communication or the node v itself is non-functional at the real time under consideration. We write CF(uv r ) = 0 • Otherwise, the 'condition factor' for each link uv r is in between 0 and 1, which means that the link is available but not in its original/ideal condition and the node v is functional at the real time under consideration. The link uv r could be partially damaged or in a traffic-jam or in a similar one out of many other real time circumstances (could be a temporary problem and expected to become ok soon after repair) which may cause the communication to be at slower pace Thus, for the pair of nodes u and v here: If at some real period of time CF(uv r ) is close to 1, then it signifies that the available link uv r is in its good condition for communication almost like its original condition. If CF(uv r ) is close to 0, the available link uv r is in a very bad condition for communication. If CF(uv r ) is 0, then either the link uv r is 'not available' or the node v itself is nonfunctional at the period of time under consideration. Clearly, if the node v is non-functional then CF(uv r ) = 0 ∀r, but the converse is not necessarily true.
The above network is a case of real life situation, where because of natural phenomenon (viz. flood, earthquake, thunderstorm, solar storm) or because of some external attack or technical failure, the following are some information at this real period of time: • The links AB 1 and CD 2 are completely damaged and hence 'unavailable' • The links AC 1 , BC 1 and CB 1 are damaged, but available (communication will be very slow if these roads are followed) • The links AB 2 and CD 1 are available in good or almost good condition (communication will be almost at per expected pace if these roads are followed) • The link BD 1 is available but not in so good condition (communication will be delayed if this road is followed) In our proposed model of GRT-multigraphs, these are very precious information and is available with the concerned sender nodes in advance.

Link Status Vector (LSV)
Corresponding to every neighbour node v of u in a GRT-multigraph and corresponding to a given period of real time, there exist a Link Status Vector (LSV) I uv = <i 1 , i 2 , i 3 , ….., i n > of u where i r = CF(uv r ) which happens to be some value from the closed interval [0,1], where r = 1, 2, 3,…., n.

Temporarily Blocked Link (TBL)
If at a given time i r happens to be 0, i.e., if the link uv r is completely non-functional then we say that the link uv r is a Temporarily Blocked Link (TBL) from u.

Link Status Class (LSC)
If a node u has k (≥0) number of neighbour nodes v1, v2, v3,…,vk, then u carries k number of LSV: I uv1 , I uv2 , I uv3 ,……,I uvk . For a given node u, the collection of all LSV is called 'Link Status Class' (LSC) of u denoted by I u . Thus I u = { I uv1 , I uv2 , I uv3 ,……,I uvk }.

Temporarily Blocked Neighbour (TBN) and Reachable Neighbour (RN)
If v is a neighbour node of a given node u and if I uv is a null vector at a given instant of time then v is called a Temporarily Blocked Neighbour (TBN) of u for that instant.
However, since it is a temporary phenomenon and if any of the links be repaired in due time, then obviously a 'blocked neighbour' may regain its unblocked status at some later stage. If a neighbour v is not a tbn, then it is called a Reachable Neighbour (RN) of u. Thus v is a reachable node from u if there is at least one link having non-zero CF (Fig. 4a,b above).

Communicable Node
For a given node u, if I u ≠ φ and at least one member of I u is a non-null vector at a given time, then the node u is called a communicable node for that instant of time. If u does not have any neighbor node then I u = φ and in that case it is trivial that further communication is never possible. However, if I u ≠ φ and all the members of I u are null vectors at a point of time, then it signifies that further communication is not possible temporarily.

Effective Cost (EC) of a Link
Consider a node u and its neighbor node v having n (≥1) number of links (arcs) from u to v outward which are uv 1 , uv 2 ,……, uv n . Corresponding to each link uv r of the multigraph, there is a cost (weight) of the link which is c r . If this link uv r is not available at its original condition, then a fraction of its original condition is available to the system for communication. Consequently, if this link uv r is choosen for communication of a packet from node u to node v, the effective cost of this link will not be in reality equal to c r but a little higher side, depending upon the condition of the link uv r at that real instant of time.

JCS
The Effective Cost (EC) of the link uv r is defined by EC (uv r ) = c r /CF(uv r ), where CF(uv r ) ≠ 0. However, if CF(uv r ) = 0 then we say that EC(uv r ) = ∞.

Periodical Update of Information
In our mathematical model of GRT-multigraph, we propose that there is a system S which updates all the real time information of all the nodes after every quantum time τ. This quantum τ is fixed (can be reset) for the system S in a multigraph but different for different communication systems even if the same network be followed.
A multigraphs having these above properties is called a 'Generalized Real Time Multigraph' or 'GRTmultigraph' as it contain all real time information of the network with respect to time. Consequently, for a given network the GRT-multigraph is not a static multigraph but changes with time, i.e., becomes weaker sometime, regain ideal or original condition back, again becomes weaker, so on. As a special case, if a network can be modelled into a graph (need not be a multigraph) then we call our proposed model as 'Generalized Real Time Graph' or 'GRT-graph'.

Modification of Classical Dijkstra's Algorithm for GRT-Multigraphs
The main objective of the work in this study is to modify the classical Dijkstra's algorithm (which is used for solving SPP in graphs) so as to make it applicable to solve SPP in GRT-multigraphs. For this, first of all we need to define the terms: EC multiset, Min-EC multiset, Real time shortest path estimate (d[v]) of a node, Real time relaxing a link all in the context of the GRT-multigraphs.

EC Multiset of <u, v> and Min-EC Multiset of a Directed GRT-Multigraph
Consider a node u in a directed GRT-multigraph G and its neighbor node v. Suppose that there are n number of arcs from the node u to the neighbor node v in G, where n is a non-negative integer. Let W uv be the multiset of n weights (costs) of the n arcs from the node u to the node v and C uv be the multiset of n number of corresponding CFs. Consider the multiset E uv of the collection of all EC(uv r ) for r = 1, 2, 3, …., n given by: EC(uv r ) = c r / CF(uv r ).
The multiset E uv is called the EC multiset of the ordered pair of nodes <u,v>.
Let e uv be the min value of the EC multiset E uv . The collection of all e uv for all pair of neighbor nodes in the GRT-multigraph forms a multiset which is denoted by E and is called by 'Min-EC Multiset' of the GRT-multigraph G.

Real Time Shortest Path Estimate (d[v]) of a Node in a Directed GRT-Multigraph
The SPP is an important problem in Graph Theory. In (Biswas et al., 2012) we have solved SPP in a crisp multigraph. In this study, we point out that the mathematically calculated shortest path may not be always the optimal path in real life situation of a communication network in terms of the total communication costs involved (viz. time, financial implication, overhead cost, man-hour, manpower). The real time shortest path could be different from the mathematically computed shortest path (calculated using any good existing algorithm) and the most important point we consider here is that the mathematically computed shortest path (calculated using any good existing algorithm) may not be even a feasible path for communication/transportation at the real time of business.
To modify the classical Dijkstra's algorithm for solving real time SPP in a directed GRT-multigraph, we must upgrade its RELAX sub-algorithm so as to enable it to choose the real time minimum value out of all the effective costs (not the actual costs as considered in classical Dijkstra's algorithm) for each of the arcs/links between node u and the node v. Using the value of e uv from the min-EC multiset E of the directed GRTmultigraph, we can now find the real time shortest path estimate i.e., d[v] of any node v (Fig. 5 below) using the following equation: • (real time shortest path estimate of node v) = • (real time shortest path estimate of node u) + • (min EC of the arcs from the node u to the node v) • or, d[v] = d[u] + e uv

Relaxing an ARC in a Directed GRT-Multigraph
With the revised notion of the real time shortest distance estimate d [v], we now upgrade the classical RELAX algorithm below to make it applicable in GRTmultigraphs (Fig. 6). Call this modified algorithm by 'GRT-RELAX' algorithm.  In this section we generalize the classical Dijkstra's algorithm so that it can be used to find single source shortest path in case of GRT-multigraphs also. We name the new algorithm as 'Dijkstra's Algorithm for GRTmultigraphs' (DA-GRTM, in short).

Conversion of a GRT-Multigraph into an Equivalent RT-Multigraph
A GRT-multigraph cannot be converted physically into an equivalent RT-multigraph (Biswas et al., 2013b). But for the purpose of solving various problems (say, SPP), for implementing very effective communication system via a GRT-multigraph, one can mathematically convert it into an equivalent RTmultigraph and apply all the algorithms/theories of RT-multigraph (Biswas et al., 2013a) to find the final solutions for the GRT-multigraph. Consider the GRTmultigraph G grt at some instant of time (Fig. 7). Now, for each link of this G grt if we replace the existing cost by a new value equal to the corresponding EC value of it, we get a new multigraph G rt with common V and E (Fig. 8). This new multigraph G rt can be viewed as an equivalent RT-multigraph of the GRT-multigraph G grt. In the multigraph G rt the condition factor is either 0 or 1 for each link, none in the open interval (0,1).
It may be noted that in G rt , if LSV of u at some real time is I uv = (i 1 , i 2 , i 3 , ….., i n ), then i r ∈ {0,1} for r = 1, 2, 3,….,n with the following significance: • i r = 0, if either the link uv r or the node v is nonfunctional • r = 1, if the link uv r and v both are functional The following example compares the theoretical result with the real time computing results in case of transportation via a public transport network.

Example 3.1
Consider the directed crisp multigraph G (as shown below in Fig. 9) in which we want to solve the singlesource SPP taking the source node as the node A and the destination node as the node D in a public transport network. The Dijkstra's algorithm for crisp multigraph proposed in (Biswas et al., 2012) will produce the following result if applied in the multigraph G. S = {A, C, B, D}, i.e., the shortest path from the source node A is: The above result is mathematically correct, but may not be appropriate or useful during the actual period of transportation (communication) because of the reason that many of its links are partially/fully damaged and hence not in their original condition for facilitating the transportation (assuming that all the nodes are fully functional).
Suppose that at this period of time the corresponding GRT-multigraph of the multigraph G is G grt as shown in Fig. 10 below.
Thus, instead of solving the SPP in the crisp multigraph G we in fact need to solve now the SPP in the GRT-multigraph G grt taking the source node as the node A and the destination node as the node D. Since most of the links are not in their original physical condition, we replace their actual theoretical costs by the corresponding effective costs as shown in the following RT-multigraph (Fig. 11).  Thus, at this period of time the shortest distance is not 59 but 80. The corresponding real time shortest path is not A→C→B→D, but A→B→D. It may happen that after few hours the real time shortest distance is some value other than 80, although the Fig.  5 and 9 remains always same. This real time information and results will surely make the communication system more efficient and faster (although, apparently not looking so at the outset, if viewed mathematically).

CONCLUSION
In this study we have introduced a new notion of Graph Theory called by "GRT-multigraphs" which is a generalization of the notion of RT-multigraphs (Biswas et al., 2013b). In a RT-multigraph, at a given instance of time, a link is either 'available' (i.e., status = 1) or 'not available' (i.e., status = 0) for facilitating the communication, there is no other possibility. In a GRT-multigraph, the link-status or CF of a link can be any value from the closed interval [0,1], depending upon its physical/logical condition for facilitating communication at that real instant of time. We propose that there is a system S for the GRTmultigraph which updates all the real time information of all the nodes after every quantum time τ. For a solution of the real time SPP in a GRT-multigraph, we have proposed a modified version of the classical Dijkstra's algorithm called by 'Dijkstra's Algorithm for GRT-multigraphs' (DA-GRTM, in short). It is claimed that because of rich potential to deal with the real time condition of a network, the notion of GRT-multigraph and the corresponding DA-GRTM algorithm will incorporate a major dimension to the present day communication systems (transportation systems). A GRT-multigraph can be mathematically converted into a RT-multigraph. As a special case a GRT-multigraph could be a GRT-graph. Our future research work will be to implement fuzzy CF in GRT-multigraphs instead of crisp CF values because of the reason that condition factor of an available link may not be always a precise quantity but an ill-defined quantity.