Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

JOURNAL OF OPTOELECTRONICS LASER ISSN: 1005-0086

Volume 41 Issue 9, 2022

Comparative Study of Standard Dijkstra’s Algorithm with Dijkstra’s Algorithm Modified for
Disjoint Path Construction to Find Shortest Route in Wavelength Routed Networks
1 2 3 4
Rupendeep Kaur* , Sukhdeep Kaur , Harmandar Kaur & Rahul Sharma
1&2
Department of Electronics Technology, Guru Nanak Dev University, Amritsar 143005, India
3
Department of Engineering and Technology, GNDU Regional Campus, Jalandhar 143005, India
4
Department of Electronics and Communication Engineering, Lovely Professional University, Punjab, India

ABSTRACT
Wavelength routed optical networks has been a subject of extensive investigation achieving high capacities in data
transport applications. In this paper, we investigated the problem of routing connections in order to find shortest path
in special types of network conditions. Information conveyed here is in the form of wavelength continuous route called
lightpath and the main concern here is to minimize the blocked connections, time and cost factors. A standard
Dijkstra’s algorithm with low computational complexity can serve this purpose but its application is limited to non-
negative graphs only. On graphs having negative edge weights this algorithm fails. So there was a need for simple
and efficient algorithm to work on these types of graphs. By making slight changes in Dijkstra’s algorithm, a new
algorithm named MDSP algorithm for disjoint path construction problem is proposed and implemented using MATLAB
in this paper. Then both Dijkstra’s algorithm and MDSP algorithm were compared to prove later’s better efficiency in
selecting shortest route in graphs with negative edge weights or graphs with disjoint paths.

Keywords: Wavelength routed networks, Wavelength division multiplexing, Dijkstra’s Algorithm, lightpath, Disjoint
paths, Routing & Wavelength Assignment(RWA)..

I. INTRODUCTION
Wavelength-Division Multiplexing (WDM) in optical fiber networks has been rapidly gaining acceptance as a means to
handle the ever-increasing bandwidth demands of network users. In a wavelength-routed WDM network, end users
communicate with one another via all-optical WDM channels, which are referred to as light-paths. For the routing sub-
problem, there are three basic approaches that can be found in the literature: fixed routing(FR), fixed-alternate
routing(FAR), and exhaust routing(ER) Methods. Exhaust routing algorithm is expected to yield better performance
than the FR and FAR algorithms. Exhaust routing does not predetermine the candidate routes for any node pair.
Instead, it keeps the network state information in the form of a graph. This state information is dynamic, and will keep
changing depending upon the dynamically changing traffic. When a new connection request arrives for a node pair p,
it chooses the best route (based on some cost criterion) among all the possible routes. Thus, by exploring all the
possible routes, it attempts to increase the acceptance rate of connections. Similarly, the fixed routing method is
simpler than the alternate routing method, but it yields poorer performance than the other. For any wavelength routed
network to work properly it is mandatory to use efficient Routing and Wavelength assignment Algorithm.

Disjoint paths
Disjoint paths are obtained from an iterative procedure in a graph modified according to a certain set of rules. Finding
the shortest path or the several shortest paths is a classical problem in graph theory. In modem communication
networks, which can be represented as directed graphs, it is often desirable to find paths that are not only short, but
also disjoint. Two or more paths between a source node and a terminal node are disjoint if none of the paths share
any nodes (vertices), and hence any links (edges), other than the source and terminal nodes.

In case of disjoint path construction, conventional Dijkstra’s algorithm is slightly modified and this modification forms
modified Dijkstra’s algorithm. For RWA graph transformation approach is used. First an auxiliary graph is constructed
from the given source-destination node pairs. Next, the shortest path (SP) between the source-destination node pairs
is determined by Dijkstra’s algorithm [6][9]. Low complexity distributed algorithms having both node-disjoint and link-
disjoint versions with nodes incorporating information necessary to send packets on disjoint paths in distributed
manner are developed offering multiple disjoint paths with minimal lengths between source and its expected
destinations [11].

Previous work
A new algorithm proposed whose blocking performance is better in many cases than other previously proposed
algorithms and it is high for multi-fiber ring networks with a moderate number of fibers per link [1]. Circuit switched
RWA taking into account all available paths between source and destination was developed computing blocking

JOURNAL OF OPTOELECTRONICS LASER DOI: 10050086.2022.09.42

381
JOURNAL OF OPTOELECTRONICS LASER ISSN: 1005-0086

Volume 41 Issue 9, 2022


probabilities by making routing decision based on already included network state [2]. An effective routing &
wavelength assignment (RWA) algorithm was proposed to take into account the impact of conversion cascading
constraint to avoid the significantly reduced blocking performance [3]. A new wavelength assignment scheme, called
Distributed Relative Capacity Loss (DRCL) was proposed, which works well in distributed-controlled networks, and
performance of DRCL was demonstrated through simulation [4]. Dijkstra's algorithm solves the single-source shortest-
paths problem on a weighted, directed graph G = (V, E) for the case in which all edge weights are non-negative. With
a good implementation, the running time of Dijkstra's algorithm is lower than that of the Bellman- Ford algorithm [5].
An Efficient Heuristic for RWA capable of selecting minimal length path based on number of times the found new route
overlapped with ongoing connections, especially when each node is equipped with limited number of converters and
more number of wavelengths. Comparative simulation studies with previous work were made to show its superiority
[6]. In a large network, RWA algorithms based on centralized control are not desirable. Distributed control is a viable
alternative which can overcome the shortcomings of the centralized algorithms. In general, longer hop connections are
subject to more blocking than shorter hop connections. The fairness among the individual streams using connections
with different hop lengths is an important problem in WDM networks [7]. In long-haul optical networks it is found that
offline routing and wavelength assignment algorithms and throughput maximization algorithms performed better than
previously studied online algorithms [8]. A more general approach for RWA in WDM optical networks is proposed.
Major benefit of this dynamic alternate routing scheme is that alternate route not equipped with converters offered
better performance than the route with full wavelength conversion and simulation results proved its adaptability with
network traffic conditions [9]. On a network with nonnegative-length edges, Dijkstra’s shortest path algorithm
computes single-source shortest path in O (m + n log n) time. The time bound assumes that a Fibonacci heap is used
during the implementation of Dijkstra’s algorithm. As the process of building heaps needs a little complex work, it
makes the algorithm not easy to be used [10]. A synchronous implementation of the algorithm is presented that has
better communication and time complexities than any previous distributed algorithm for the same problem except the
“full-information” algorithm that requires each node to know the entire network topology. In dense networks, the
synchronous algorithm has the same communication complexity as, and a better time complexity than, the full-
information algorithm [11]. The performance of three algorithms for allocating wavelength optical networks is
evaluated and they are: first-fit, least-used and most-used. The objective of the experiment was to simulate the
performance of allocation algorithms on relevant aspects: throughput and blocking probability. To this end, a series of
measurements were performed using a simulation tool for networks WDM called OWNS (Optical WDM Network
Simulator) to perform an analysis of the problem RWA (Routing and Wavelength Assignment) based on the algorithms
studied in this article [12]. A new shortest path algorithm called Modified Dijkstra’s Shortest Path algorithm is
proposed. In this algorithm multiple parameters were used to find the valid shortest path instead of using single
parameter. The efficiency of the algorithm is analysed in terms of shortest path by measuring its nodes and Time
complexity [13]. A Quantum Dijkstra’s algorithm (QDA) was proposed in order to optimize existing Dijkstra’s Algorithm
by limiting the number of iterations. Its main logic was to solve the problem where more than one node satisfies the
condition of the next step in the existing Dijkstra’s algorithm. After applying the proposed modifications, the maximum
number of loops or iterations in Dijkstra’s algorithm is lesser than the number of the nodes [14].

II. PROPOSED ALGORITHM

Graphs with negative arcs

Why Dijkstra’s algorithm fails


To demonstrate, consider the graph of Figure 1, which contains negative arcs but no negative cycles. As a result, the
shortest path between a pair of vertices exists and is finite. Suppose that the shortest path from vertex A to vertex Z is
desired.

JOURNAL OF OPTOELECTRONICS LASER DOI: 10050086.2022.09.42

382
JOURNAL OF OPTOELECTRONICS LASER ISSN: 1005-0086

Volume 41 Issue 9, 2022

Figure 1 A graph with positive edges and negative arcs

Since the graph is a mixture of arcs and edges, so there is a need to redefine INF. INF, is a large, but finite number
used to initialize the distance of each one of the vertices (except source vertex A) from vertex A. The arcs are
negative in length. For such graphs containing arcs, INF may at the minimum be set equal to a value greater than the
sum of the length of the edges; alternatively, INF may be set equal to the number greater than the product of l max and
the number of edges in the given graph, where lmax is the largest length among the edges of the graph. Here focus is
on the first definition, and ignoring the negative sign of the arcs, redefine INF to be equal to a number greater than the
sum of the length of the edges and the arcs (after reversal of their signs).Using this definition, INF > 38 for the graph
of figure. Application of Dijkstra’s algorithm yields:
Step 1.d(A) = 0, d(B) = 5, d(D) = 7, d(C) = d(E) = d(Z) = INF(>38).
M = {B, C, D, E, Z}
P(B) = P(C) = P(D) = P(E) = P(Z) = A
Step 2.a) j = B, d(B) = 5.
b) M = {C, D, E, Z}
Step 3. NB = {A, C, Z}.
NB ∩ S = {C, Z}.
d(C) = 6, d(Z) = 13.
P(C) = B, P(Z) = B.
Step 2.a) j = C, d(C) = 6.
b) M = {D, E, Z}.
Step 3. NC = {A,B}.
NC ∩ M = ø.
Step 2.a) j = D, d(D) = 7.
b) M = {E, Z}.
Step 3. ND = {A, E, Z}.
ND ∩ M = {E, Z}.
d(E) = 9.
P(E) = D.
Step 2.a) j = E, d(E) = 9.
b) M = {Z}
Step 3 NE = {C, D}.
NE ∩ S = ø.
Step 2.a) j = Z, d(Z) = 13.
b) M = ø.
END.
According to the Dijkstra’s algorithm, the shortest path from A to Z is ABZ of length equal to 13. However, a close
examination reveals that path ADECBZ of length = 12 is the shortest path from A to Z. Thus, the Dijkstra’s algorithm
fails on account of negative arcs in the given graph.

It is important to mention here that the graph of figure belongs to a special class of graphs. The negative arcs in figure
constitute a single group of contiguous arcs forming path ZECA. If these arcs are reversed in direction and sign, then

JOURNAL OF OPTOELECTRONICS LASER DOI: 10050086.2022.09.42

383
JOURNAL OF OPTOELECTRONICS LASER ISSN: 1005-0086

Volume 41 Issue 9, 2022


the path ACEZ formed from these arcs is the shortest path from A to Z in the resulting non-negative graph. These
types of graphs are encountered in the construction of disjoint paths and via a special graph transformation, these
graphs can be converted to non-negative forms, thus permitting the use of the use of the Dijkstra’s algorithm in the
construction of disjoint paths. In the next section slight modification in Dijkstra’s algorithm that correctly finds the
shortest path from A to Z in the above types of graphs without invoking any special graph transformation; the use of
this algorithm then makes the construction of disjoint paths straightforward.

B. The problem of finding disjoint paths in a network has been given much attention in the literature due to its
theoretical as well as practical significance to many applications, such as layout design of integrated circuits,
survivable design of telecommunication networks and restorable/reliable routing. MDSP algorithm is a slight variant of
the Dijkstra’s algorithm.

The modification made permits the correct determination of the shortest path in graphs of the type Figure 1
encountered during the construction of disjoint paths. For the standard non-negative graph, it reduces to the standard
Dijkstra’s algorithm.

Let d(i) denote the distance of vertex i from source vertex A. Let P(i) denotes its predecessor. The steps of the
algorithm are:
Step I. Begin with d(A)=0
Define adj_matrix[j][k]
d(j)= l(Aj), where j ϵ NA
= INF
Where INF > sum of lengths of edges & arcs (after their sign reversal)
NA = Set of neighbour vertices of j vertex, l(jk)=arc length from vertices j to k
Set M = V – [A] such that V represents set of vertices in the graph
Set P(j) = A.V where j ϵ M
Step II a. Search k ϵ M such that d(k) = min d(j)
b. Assign M = M-{K}
c. If k = Z where Z is destination vertex then STOP
otherwise , Go to Step III
Step III. Vj ϵ Nk, If d(k) + d(kj) < d(j) then set
a. d(j) = d(k) + l(kj), P(j) = k
b. M = M Ս {j}
Go to step II.

The algorithm above is different from the Dijkstra’s algorithm (in step 3 above) in that it scans all the neighbours of the
vertex selected (or permanently labelled) in step 2a. This extended scanning is necessary, since a previously
“permanently” labelled vertex in step 2a can be relabelled, i.e., receive a lower label upon further scanning.
Furthermore ,the algorithm ,via step 3b,ensures the re-entry into set S of any previously “permanently” labelled vertex
that was re-labelled in step 3a.These modifications to the Dijkstra’s algorithm, although redundant for non-negative
graphs, are important for the type of graphs with negative arcs encountered in the disjoint path construction problem.
For non-negative graphs, the MDSP algorithm in effect reduces to the Dijkstra’s algorithm.
Application of the MDSP algorithm to network of Figure 1 yields to :

Step 1.d(A) = 0, d(B) = 5, d(D) = 7, d(C) = d(E) = d(Z) = INF(>38).


M = {B, C, D, E, Z}.
P(B) = P(C) = P(D) =P(E) =P(Z) =A.
Step 2.a) k = B, d(B) = 5.
b) M ={C, D, E, Z}.
Step 3. NB = {A, C, Z}
a) d(C) = 6, d(Z) = 13.
P(C) = P(Z) = B.
b) M = {C, D, E, Z}.
Step 2.a) k = C, d(C) = 6.
b) M = {D, E, Z}.

JOURNAL OF OPTOELECTRONICS LASER DOI: 10050086.2022.09.42

384
JOURNAL OF OPTOELECTRONICS LASER ISSN: 1005-0086

Volume 41 Issue 9, 2022


Step 3. NC = {A, B}
Step 2.a) k = D, d(D) = 7.
b) M = {E, Z}.
Step 3. ND = {A, E, Z}
a) d(E) = 9.
P(E) = D.
b) M = {E, Z}.
Step 2.a) k = E, d(E) = 9.
b) M = {Z}.
Step 3. NE = {C, D}
a) d(C) = 3.
P(C) = E.
b) M = {C, Z}.
Step 2.a) k = C, d(C) = 3.
b) M = {Z}.
Step 3. NC = {A, B}
a) d(B) = 4.
P(B) = C.
b) M = {B,Z}.
Step 2.a) k = B, d(B) = 4.
b) M = {Z}.
Step 3. NB = {A, C, Z}
a) d(Z) = 12.
P(Z) = B.
b) M = {Z}.
Step 2.a) k = Z, d(Z) = 12.
b) M = ø.
c) END

Tracing back from the predecessor of vertex Z, it is found the shortest path from A to Z to be ADECBZ (of length equal
to 12), which the standard Dijkstra’s failed to yield.

Note that vertices B and C are each re-labelled twice in step 3a of the algorithm; the set S dwindles to {Z} before
growing back via the inclusion of these re-labelled vertices in step 3b. Consequently, these vertices are reselected in
step 2a of the algorithm, and the search terminates when the selected vertex is the destination vertex Z. This is in
sharp contrast to the standard algorithm where the set M dwindles each time a vertex is permanently labelled, and
never replenished as in MDSP algorithm.

III. RESULTS AND DISCUSSION


We found shortest path in an undirected graph of Figure 1, which is a mixture of positive edges and negative arcs,
using MDSP Algorithm.

JOURNAL OF OPTOELECTRONICS LASER DOI: 10050086.2022.09.42

385
JOURNAL OF OPTOELECTRONICS LASER ISSN: 1005-0086

Volume 41 Issue 9, 2022

Figure 2 Adjacency matrix for an undirected graph

Description
- Read integer type variables i.e. source vertex, adjacency matrix, number of vertices, i, j, closes
tunmarkednode.
- Define INFINITY=999.Initialize mark[i]=0 as initially node i is not marked. Also
initializepredecessor[i]=1,distance[i]=INFINITY, count=0.
- Under function getclosestunmarkednode(), apply for loop condition on i and get closest unmarked node i.e. i.
Also define set s[j] which includes collection of all the vertices.
- If count is less than number of vertices then mark closest unmarked node as 1.Again if i is not marked and
distance from closest unmarked node to i is greater than 0 and if distance from source to node i is greater
than the sum of distances from source to closest unmarked node and closest unmarked node to i then assign
distance[i] this value.
- Then put this closest unmarked node into predecessors of i and add this permanently labelled vertex i into the
set s[j] and repeat this until all the shortest distances are obtained by incrementing count.
- Now if i equal to source then simply print “source” else print the final distance.

Results
Enter the number of vertices present in this uni-directed graph (count should be greater than 0)
6
Enter adj_matrix for the graph
To enter INF enter 999
0 5 999 7 999 999
5 0 1 999 999 8
-1 1 0 999 999 999
7 999 999 0 2 6
999 999 -6 2 0 999
999 999 999 6 -2 0

0 5 999 7 999 999

5 0 1 999 999 8

-1 1 0 999 999 999

7 999 999 0 2 6

999 999 -6 2 0 999

999 999 999 6 -2 0

Enter source vertex

JOURNAL OF OPTOELECTRONICS LASER DOI: 10050086.2022.09.42

386
JOURNAL OF OPTOELECTRONICS LASER ISSN: 1005-0086

Volume 41 Issue 9, 2022


A
A..A->0
A..D..E..C..B..->4
A..D..E..C..->3
A..D..->7
A..D..E..->9
A..D..E..C..B..Z..->12

IV. CONCLUSION
Dijkstra’s algorithm implemented in MATLAB is used to find the least-cost route on graph G(V,E) so the best one can
be chosen. It is observed that on graphs, having negative edge weights or arcs, Dijkstra’s algorithm do not work. This
usually happens in case of disjoint path construction. With a special graph transformation these graphs with negative
edge-weights can be converted into graphs with positive edge-weights and then conventional Dijkstra’s algorithm can
be applied to find shortest paths. But this transformation is cumbersome. MDSP algorithm is different from Dijkstra’s
nd
algorithm as in case of MDSP algorithm all neighbours of vertex which is selected in 2 step are scanned. This
extended scanning is necessary, since a previously “permanently” labelled vertex in step 2 can be relabelled, i.e.
receive a lower label upon further scanning in negative graphs. But in case of Dijkstra’s algorithm only those vertices
belonging to set S are scanned. It is shown with the help of flowchart that a slight modification is required to be done
in conventional Dijkstra’s algorithm in order to have accurate determination of shortest path in graphs of this type
without any graph transformation which make the construction of disjoint paths simpler and straightforward.

REFERENCES
[1] S. Subramaniam and R. A. Barry, ”Wavelength Assignment in Fixed Routing WDM Networks, Proceedings.,
ICC ’97, Montreal, Canada, vol. 1, pp. 406-410, June 1997.
[2] A. Mokhtar and M. Azizoglu, ”Adaptive Wavelength Routing in All-Optical Networks", IEEE/ACM Transactions
on Networking, Vol. 6, pp. 197-206, April 1998.
[3] R. Ramaswami and A. Segall, “Distributed network control of optical networks”, IEEE/ACM Tranactionss on
Networking.vol. 5, pp. 936–943, 2000.
[4] H. Zang, J. P. Jue, and B. Mukherjee, “A review of routing and wavelength assignment approaches for
wavelength-routed optical WDM networks,” Optical Networking Magazine pp. 47–60, January 2000
[5] Cormen, Thomas H.; Leiserson, Charles E.; Rivest, Ronald L.; Stein, Clifford (2001). "Section 24.3: Dijkstra's
algorithm". Introduction to Algorithms (Second edition),MIT Press and McGraw-Hill. pp. 595–601.
[6] Yongbing Zhang, Koji Taira, Hideaki Takagi, and Sajal K. Das, “An Efficient Heuristic for Routing and
Wavelength Assignment in Optical WDM Networks” ICOIN 2002, LNCS 2343, pp 291-304, 2002.
[7] S.Ramamurthy and Mohan Guruswamy (2002),”WDM Optical networks:concepts,design and algorithms”,
Prentice Hall of India Private Limited, New Delhi.
[8] [8] Biswanath Mukherjee (2006),”Optical WDM Networks”, Department of Computer Science University of
California Davis, USA.
[9] Kuntal Roy, Mrinal K. Naskar, UtpalBiswas,”Adaptive Dynamic Wavelength Routing for WDM Optical
Networks”, IEEE Transactions on communications, 2006.
[10] M.H. Xu a, Y.Q. Liu a, Q.L. Huang a, Y.X. Zhang a, G.F. Luan b “An improved Dijkstra’s shortest path
algorithm for sparse networks”, Applied Mathematics and Computation, pp. 247–254,2007.
[11] Richard G. Ogier, ” Distributed Algorithms for Computing Shortest Pairs of Disjoint Paths”, IEEE transactions
on information theory, vol. 39,no. 2.March 1993.
[12] Paulo H. G. Bezerra, Afonso J. F. Cardoso, and Carlos R. L. Frances. ”Performance Evaluation of Algorithms
for Wavelength Assignment in Optical WDM Networks”, IJCSNS International Journal of Computer Science
and Network Security, Vol.10, No.1, January 2010.
[13] S. Sivakumar,Dr. C.Chandrasekar, “Modified Dijkstra’s Shortest Path Algorithm” , International Journal of
Innovative Research in Computer and Communication Engineering, Vol. 2, Issue 11, November 2014.
[14] Anjali Jain, U.Datta,Neelam.Joshi, “Implemented Modification in Dijkstra’s Algorithm to Find the Shortest Path
for ‘N’ Nodes with Constraint”, International Journal of Scientific Engineering and Applied Science
(IJSEAS)Vol.2,Issue2,February 2016.

JOURNAL OF OPTOELECTRONICS LASER DOI: 10050086.2022.09.42

387

You might also like