SlideShare a Scribd company logo
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
DOI: 10.5121/ijsea.2016.7302 11
JAVA BASED VISUALIZATION AND ANIMATION FOR
TEACHING THE DIJKSTRA SHORTEST PATH
ALGORITHM IN TRANSPORTATION NETWORKS
Ivan Makohon1
, Duc T. Nguyen2
, Masha Sosonkina3
, Yuzhong Shen4
and Manwo Ng5
1
Graduate Student, Department of Modeling, Simulation & Visualization Engineering
(MSVE), Old Dominion University (ODU), Norfolk, Virginia
2
Professor, Civil & Environmental Engineering (CEE) Department, ODU, Norfolk,
Virginia
3
Professor, Department of MSVE,ODU, Norfolk, Virginia
4
Associate Professor, Department of MSVE, ODU, Norfolk, Virginia
5
Assistant Professor, Department of Information Technology and Decision, ODU,
Norfolk, Virginia
ABSTRACT
Shortest path (SP) algorithms, such as the popular Dijkstra algorithm has been considered as the “basic
building blocks” for many advanced transportation network models. Dijkstra algorithm will find the
shortest time (ST) and the corresponding SP to travel from a source node to a destination node.
Applications of SP algorithms include real-time GPS and the Frank-Wolfe network equilibrium.
For transportation engineering students, the Dijkstra algorithm is not easily understood. This paper
discusses the design and development of a software that will help the students to fully understand the key
components involved in the Dijkstra SP algorithm. The software presents an intuitive interface for
generating transportation network nodes/links, and how the SP can be updated in each iteration. The
software provides multiple visual representations of colour mapping and tabular display. The software can
be executed in each single step or in continuous run, making it easy for students to understand the Dijkstra
algorithm. Voice narratives in different languages (English, Chinese and Spanish) are available.A demo
video of the Dijkstra Algorithm’s animation and result can be viewed online from any web browser using
the website: http://www.lions.odu.edu/~imako001/dijkstra/demo/index.html.
KEYWORDS
Transportation, Dijkstra Algorithm, Java, Visualization, Animation
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
12
1. INTRODUCTION
Finding the shortest time (ST), or the shortest distance (SD) and its corresponding shortest path
(SP) to travel from any i-th “source” node to any j-th “destination (or target)” node of a given
transportation network is an important, fundamental problem in transportation modelling.
Efficient SP algorithms, such as the Label Correction Algorithm (LCA) and its improved version
of Polynomial (or partitioned) LCA, forward Dijkstra, backward Dijkstra, Bi-directional Dijkstra,
A* algorithms have been developed, tested and well documented in the literatures [1-3].
Teaching the SP algorithms (such as the Dijkstra algorithm), however, can be a
difficult/challenging task!
While some teaching information/lecture/tool/animation for Dijkstra algorithms have
existed/appeared in the literatures [4-6], none seems to be suitable/appropriate for our students’
learning environments, due to the lack of one (or more) of the following desirable
features/capabilities:
1. The developed software tool should be user friendly (easy to use).
2. Graphical/colourful animation should be extensively used to display equations, and/or
intermediate/final output results.
3. Clear/attractive computer animated instructor’s voice should be incorporated in the
software tool.
4. The instructor’s voice for teaching materials can be in different/major languages
(English, Chinese, and Spanish).
5. User’s input data can be provided in either interactive mode, or in edited input data file
mode, or by graphical mode.
6. Options for partial (or intermediate) results and/or complete (final results) are available
for the user to select.
7. Options for displaying all detailed intermediate results in the first 1-2 iterations, and/or
directly show the final answers are available for users.
8. Users/learners can provide his/her own data, and compare his/her hand-calculated results
with the computer software’s generated results (in each step of the algorithm) for
enhancing/improving his/her learning abilities.
The remaining sections of this article is organized as follow. In section II, the basic forward
Dijkstra algorithm is summarized (for the readers’ convenience). Java language is adopted in this
work due to its powerful graphical and animated features. Special and useful features of the
developed Java software for teaching Dijkstra algorithm are high-lighted and demonstrated in
(including some computer screen captures) Section III. Conclusions are summarized/suggested in
Section IV.
2. SUMMARY OF THE BASIC FORWARD DIJKSTRA SHORTEST PATH
ALGORITHM
The basic forward Dijkstra algorithm is a graph search algorithm that solves for the shortest path,
time, or distance from any given source node to a destination node. The graph is
represented/stored within a 2-Dimentional NxN matrix where the rows and columns of the matrix
headers are represented as the nodes and the values within the matrix at a location (Aij) are the
link’s value (path, distance, or time value), refer to Figure 1. Figure 1 shows a simple 3 x 3
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
13
matrix where Node 1 Node 2 has a link value of 6, Node 1 Node 3 have a link value of 4,
and Node 2 Node 3 has a link value of 2
With any given N x N size matrix, the shortest path, time, or distance can be solved using the
basic forward Dijkstra shortest path algorithm. For example, we demonstrate and solve for a
sample 6 x 6 matrix (Figure 2) and graph (Figure 3) to find the shortest path, time, or distance
from Node 1 (source node) to Node 6 (destination node).
We demonstrate and use a simple (easy to use) bookkeeping (Figure 4) method while iterating
through the forward Dijkstra algorithm. Figure 4 shows the initial values for the Set s and Set s
prime. Set s is empty during initialization and is used to bookkeep nodes already visited. Set s
prime contains all the nodes during initialization and nodes are removed as they are visited. The
vector {d} bookkeeps the shortest path, time, or distance value and the vector {pred} bookkeeps
the predecessor nodes after each iteration within the Dijkstra algorithm.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
14
During the first iteration, we set the source node to Node 1 and update Set s = {1} and Set s prime
= {2, 3, 4, 5, 6}. Note that Node 1 is removed from Set s prime and added to the Set s.
From Node 1, there are 2 outgoing links, Node 2 and Node 3 (Figure 3). We check the outgoing
Nodes (2 and 3) from Node 1 (Source Node) to determine if Vector [d] and [pred] need to be
updated with the shortest path, time or distance. This can be done referencing the values stored in
Vector d[2] and d[3]. Compare the stored Vector d[2] value to see if it’s greater-than the
computed value, which is the stored Vector d[1] plus the value at C13(link value between Node 1
and 3). Compare the stored Vector d[3] value to see if it’s greater-than the computed value,
which is the stored Vector d[1] plus C12(link value between Node 1 and 2). If the stored values
are greater-than the computed values then update the Vector d with the computed value. If not,
then no update is needed and the stored value remains the same.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
15
In both of these cases, the stored values for d[2] and d[3] are infinity (∞) so the values in Vector
[d] and [pred] will need to be updated with the computed values (Figure 5). Figure 5 shows the
simple (easy to use) bookkeeping method and updates (if needed).
Once this calculation and update has taken place, we determine the smallest value among the
nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[3] has the
smallest value among the nodes in Set {s prime}, we move Node 3 to Set {s} = { 1, 3 } and
remove it from Set {s prime} = { 2, 4, 5, 6 }. Now Node 3 becomes the next source node.
The Next iteration (k = 2), begins by checking the outgoing nodes from Node 3 (source node).
We check the outgoing Nodes (4 and 5) from Node 3 (Source Node) to determine if Vector [d]
and [pred] need to be updated with the shortest path, time or distance. This can be done
referencing the values stored in Vector d[4] and d[5]. Compare the stored Vector d[4] value to
see if it’s greater-than the computed value, which is the stored Vector d[3] plus the value at
C34(link value between Node 3 and 4). Compare the stored Vector d[5] value to see if it’s
greater-than the computed value, which is the stored Vector d[3] plus C35(link value between
Node 3 and 5). If the stored values are greater-than the computed values then update the Vector d
with the computed value. If not, then no update is needed and the stored value remains the same.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
16
In both of these cases, the stored values for d[4] and d[5] are infinity (∞) so the values in Vector
[d] and [pred] will need to be updated with the computed values (Figure 6). Figure 6 shows the
simple (easy to use) bookkeeping method and updates (if needed).
Once this calculation and update has taken place, we determine the smallest value among the
nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[4] has the
smallest value among the nodes in Set {s prime}, we move Node 4 to Set {s} = { 1, 3, 4 } and
remove it from Set {s prime} = { 2, 5, 6 }. Now Node 4 becomes the next source node.
The Next iteration (k = 3), begins by checking the outgoing nodes from Node 4 (source node).
We check the outgoing Node 6 from Node 4 (Source Node) to determine if Vector [d] and [pred]
need to be updated with the shortest path, time or distance. This can be done referencing the
values stored in Vector d[6]. Compare the stored Vector d[4] value to see if it’s greater-than the
computed value, which is the stored Vector d[4] plus the value at C46(link value between Node 4
and 6). If the stored value is greater-than the computed value, then update the Vector d with the
computed value. If not, then no update is needed and the stored value remains the same.
In this case, the stored value for d[6] is infinity (∞) so the value in Vector [d] and [pred] will need
to be updated with the computed value (Figure 7). Figure 7 shows the simple (easy to use)
bookkeeping method and updates (if needed).
Once this calculation and update has taken place, we determine the smallest value among the
nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[2] and d[5]
has the smallest value, 6 among the nodes in Set {s prime}, we arbitrarily select and move Node 2
to Set {s} = { 1, 3, 4, 2 } and remove it from Set {s prime} = { 5, 6 }. Now Node 2 becomes the
next source node. Note: we could do further research here to pick the better of the 2 choices
instead or arbitrarily selecting one.
The Next iteration (k = 4), begins by checking the outgoing nodes from Node 2 (source node).
We check the outgoing Nodes (3 and 4) from Node 2 (Source Node) to determine if Vector [d]
and [pred] need to be updated with the shortest path, time or distance. This can be done
referencing the values stored in Vector d[3] and d[4]. Compare the stored Vector d[3] value to
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
17
see if it’s greater-than the computed value, which is the stored Vector d[2] plus the value at
C23(link value between Node 2 and 3). Compare the stored Vector d[4] value to see if it’s
greater-than the computed value, which is the stored Vector d[2] plus C24(link value between
Node 2 and 4). If the stored values are greater-than the computed values then update the Vector d
with the computed value. If not, then no update is needed and the stored value remains the same.
In both of these cases, the stored values for d[3] and d[4] are 4 and 5 respectively so the values
are not greater-than the computed values so no update is needed (Figure 8). Figure 8 shows the
simple (easy to use) bookkeeping method and updates (if needed). In this case, no update is
needed since the stored values are not greater-than the computed values.
Once this calculation and update has taken place, we determine the smallest value among the
nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[5] has the
smallest value among the nodes in Set {s prime}, we move Node 5 to Set {s} = { 1, 3, 4, 2, 5 }
and remove it from Set {s prime} = { 6 }. Now Node 5 becomes the next source node. Remark:
When determining the smallest value was a tie for Nodes 2 and 5 (see previous iteration), we
were better off to select and move Node 5 instead of arbitrarily selecting Node 2.
The Next iteration (k = 5), begins by checking the outgoing nodes from Node 5 (source node).
We check the outgoing Nodes (4 and 6) from Node 5 (Source Node) to determine if Vector [d]
and [pred] need to be updated with the shortest path, time or distance. This can be done
referencing the values stored in Vector d[4] and d[6]. Compare the stored Vector d[4] value to
see if it’s greater-than the computed value, which is the stored Vector d[5] plus the value at C54
(link value between Node 5 and 4). Compare the stored Vector d[6] value to see if it’s greater-
than the computed value, which is the stored Vector d[5] plus C56(link value between Node 5 and
6). If the stored values are greater-than the computed values then update the Vector d with the
computed value. If not, then no update is needed and the stored value remains the same.
In both of these cases, the stored values for d[4] and d[6] are 5 and 12 respectively so the value
for d[4] is not greater-than the computed values so no update is needed (Figure 9). However, the
value for d[6] is greater-than the computed values in Vector [d] and [pred] will need to be
updated with the computed values (Figure 9). Figure 9 shows the simple (easy to use)
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
18
bookkeeping method and updates (if needed). In this case, one outgoing node is updated is
needed since the stored values is greater-than the computed values.
Once this calculation and update has taken place, we determine the smallest value among the
nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[6] is the only
remaining node and is the destination node, we move Node 6 to Set {s} = { 1, 3, 4, 2, 5, 6 } and
remove it from Set {s prime} = { empty }. Now Node 6 becomes the next source node and is our
destination node. This completes the shortest path, time, or distance for solving for the basic
forward Dijkstra algorithm.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
19
The updates for each iteration for Vector [d], Vector [pred], and Set {s} are displayed in Figures
10, 11, and 12, respectively. For each iteration, the highlighted circle (light blue circle) shows the
corresponding values being updated during that iteration.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
3. JAVA COMPUTER A
FORWARD DIJKSTRA ALGORITHM
The previous section’s small-scale 6 x 6 Matrix [A] graph data will be used for the Java [7
computer animated software tool for teaching the
initialize and run the Java software. Once initialized, the application’s “Main Control” Graphical
User Interface (GUI) is displayed (Figure 13). This GUI controls the flow of the basic forward
Dijkstra algorithm teaching steps from start to finish and will provide detailed algorithm steps
while solving for the shortest path, time, or distance.
The users/learners will be able to input the matrix [A] data from several input options (input file,
manual input or randomly generated values) from the “Main Control” GUI. When an input
option is selected the user/learner will be able to modify the data within the “Matrix Editor” GUI.
The “Matrix Editor” GUI (Figure 14) allows the user/learner to change the size of
dimensions and modify the values before solving for the shortest path, time, or distance.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
ANIMATED SOFTWARE TOOL FOR T
LGORITHM
scale 6 x 6 Matrix [A] graph data will be used for the Java [7
computer animated software tool for teaching the Dijkstra algorithm. The users/learner will
initialize and run the Java software. Once initialized, the application’s “Main Control” Graphical
User Interface (GUI) is displayed (Figure 13). This GUI controls the flow of the basic forward
hm teaching steps from start to finish and will provide detailed algorithm steps
while solving for the shortest path, time, or distance.
The users/learners will be able to input the matrix [A] data from several input options (input file,
r randomly generated values) from the “Main Control” GUI. When an input
option is selected the user/learner will be able to modify the data within the “Matrix Editor” GUI.
The “Matrix Editor” GUI (Figure 14) allows the user/learner to change the size of the matrix [A]
dimensions and modify the values before solving for the shortest path, time, or distance.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
20
TEACHING
scale 6 x 6 Matrix [A] graph data will be used for the Java [7-9]
Dijkstra algorithm. The users/learner will
initialize and run the Java software. Once initialized, the application’s “Main Control” Graphical
User Interface (GUI) is displayed (Figure 13). This GUI controls the flow of the basic forward
hm teaching steps from start to finish and will provide detailed algorithm steps
The users/learners will be able to input the matrix [A] data from several input options (input file,
r randomly generated values) from the “Main Control” GUI. When an input
option is selected the user/learner will be able to modify the data within the “Matrix Editor” GUI.
the matrix [A]
dimensions and modify the values before solving for the shortest path, time, or distance.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
21
After the Matrix data [A] is entered into the "Matrix Editor" and "Ok" is selected, the focus is
returned back to the "Main Control" GUI. The matrix data [A] is shown in to viewable formats,
the “Matrix Canvas”, "Data", and "Network Graph" views. Both views will be updated
accordingly throughout the steps in the basic forward Dijkstra Algorithm.
Once the matrix data [A] is inputted, the "Play" button is enabled. Once the user/learner selects
the "Play" button, the teaching of the basic forward Dijkstra Algorithm steps begins. The basic
forward Dijkstra Algorithm performs the algorithm steps against the matrix data [A], the matrix
data [A] is updated accordingly and displayed within the Views, and the algorithm steps is
lectured to the user/learner by a computer animated voice. The algorithm steps handled within the
Java software are as follows:
3.1. Step 0 – Initialization
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will handle the
matrix data if provided as a rectangular or tall matrix. The algorithm will add "dummy" rows (or
columns) with the maximum corresponding value within the matrix.
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will solve for
shortest path, time, or distance. The GUI will prompt an input dialog for the user/learning to
select what the source and destination nodes.
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will initialize the
data vectors and sets and set the source node (Figure 15).
3.2. Step 1 – Consider all Outgoing Edges from the Current Node
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will consider all
outgoing links from the current node and will determine if the stored Vector [d] values for the
outgoing nodes are greater-than the computed values of the previous node plus the link (edge)
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
22
values. If the stored Vector [d] value is greater-than the computed value then the Vector [d] value
is updated accordingly; otherwise, the value remains the same.
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will have animated
each step and provide detailed animated voice and text for each step (Figure 16).
3.3. Step 2 – Determine the Smallest “d” Value for each Node within Set
Sfinal`(Prime) and Move the Smallest Node to Set Sfinal
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will determine the
smallest value from the Set {s prime} and remove the smallest from Set {s prime} and add it to
Set {s}.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
23
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will update the
current node as the source node for the next iteration (Figure 17).
3.4. Step 3 – Determine the Shortest Time and Path from the Source Node to the
Target Node
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will determine the
shortest path, time, or distance based on the outcome of the Dijkstra algorithms using the
bookkeeping of Vector [d], Vector [pred], Set {s}, Set {s prime}.
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will highlight the
shortest path (Figure 18).
The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will display the final
results of the shortest path, time, or distance by highlighting the nodes and links from the source
to destination node.
4. CONCLUSIONS
In this article, the basic Dijkstra algorithm has been firstly summarized. Then, Java Computer
Animated Software Tool has been developed to enhance student’s learning. The developed Java
animated software has all the following desirable features/capabilities, such as:
1. The developed software tool should be user friendly (easy to use).
2. Graphical/colourful animation should be extensively used to display equations, and/or
intermediate/final output results.
3. Clear/attractive computer animated instructor’s voice should be incorporated in the
software tool.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
24
4. The instructor’s voice for teaching materials can be in different/major languages
(English, Chinese, and Spanish).
5. User’s input data can be provided in either interactive mode, or in edited input data file
mode, or by graphical mode.
6. Options for partial (or intermediate) results and/or complete (final results) are available
for the user to select.
7. Options for displaying all detailed intermediate results in the first 1-2 iterations, and/or
directly show the final answers are available for users.
8. Users/learners can provide his/her own data, and compare his/her hand-calculated results
with the computer software’s generated results (in each step of the algorithm) for
enhancing/improving his/her learning abilities.
ACKNOWLEDGEMENTS
The partial support provided by the NSF grant # ACI-1440673 (ODU-RF Project # 100507-010)
to Duc T. Nguyen is gratefully acknowledged. The work of Sosonkina was supported in part by
the Air Force Office of Scientific Research under the AFOSR award FA9550-12-1-0476, and by
the National Science Foundation grants NSF/OCI---0941434, 0904782, 1047772.
REFERENCES
[1] Sheffi, Y., 1985. Urban Transportation Networks: Equilibrium Analysis with Mathematical
Programming Methods. Available free of charge at:
http://web.mit.edu/sheffi/www/urbanTransportation.html
[2] Lawson, G., Allen, S., Rose, G., Nguyen, D.T., Ng, M.W. “Parallel Label Correcting Algorithms for
Large-Scale Static and Dynamic Transportation Networks on Laptop Personal Computers”,
Transportation Research Board (TRB) 2013 Annual Meeting (Washington, D.C.; Jan. 13-17, 2013);
Session 844 Presentation # 13-2103 (Thursday, Jan. 17-2013; 10:15am-noon); Poster Presentation #
P13-6655.
[3] Paul Johnson III, Duc T. Nguyen, and Manwo Ng, “An Efficient Shortest Distance Decomposition
Algorithm for Large-Scale Transportation Network Problems”, TRB 2014 Annual Meeting
(Washington, D.C.; January 2014); Oral, and Poster Presentations.
[4] Dijkstra’s Shortest Path Algorithm.
http://www.cs.uah.edu/~rcoleman/CS221/Graphs/ShortestPath.html.
[5] Dijkstra Algorithm. http://students.ceid.upatras.gr/~papagel/project/kef5_7_1.htm.
[6] Dijkstra’s Algorithm.http://www3.cs.stonybrook.edu/~skiena/combinatorica/animations/dijkstra.html.
[7] Java Matrix Library (EJML).
Efficient http://code.google.com/p/efficient-java-matrix-library/wiki/EjmlManual.
[8] Google Translate Java. http://code.google.com/p/google-api-translate-java/.
[9] Java Platform Standard
Edition.http://www.oracle.com/technetwork/java/javase/downloads/index.htmllishers.
International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016
25
Authors
Ivan Makohon is a current Old Dominion University graduate student pursuing his Masters in Modeling
and Simulations. He has received his Bachelors of Science in Computer Science from Christopher
Newport University (CNU). He has been working as a contractor (and now, a civil servant) as a Senior
Software Engineer, and he is also a Private Pilot.
Duc T. Nguyen has received his B.S., M.S. and Ph.D. (Civil/Structural engineering) degrees from
Northeastern University (Boston), University of California (Berkeley), and the University of Iowa (Iowa
City), respectively. He has been a Civil Engineering faculty at Old Dominion University since 1985. He has
published 4 undergraduate/graduate textbooks. Over 160 research articles and nearly $ 4 million funded
projects have been generated by him. He has received Cray Research, NASA, ODU shining star, and Rufus
Tonelson Distinguished Faculty Awards. His name has been included in the ISIHighlyCited.com list of
most highly cited researchers in Engineering.
Masha Sosonkina has received her B.S. and M.S. degrees in Applied Mathematics from Kiev National
University in Ukraine, and a Ph.D. degree in Computer Science and Applications from Virginia Tech.
During 2003-2012, Dr. Sosonkina was a scientist at the US Department of Energy Ames Laboratory and an
adjunct faculty at Iowa State University. She is currently a professor of Modeling, Simulation and
Visualization Engineering at Old Dominion University. She has also been a visiting research scientist at the
Minnesota Supercomputing Institute, at CERFACS and INRIA French research centers. Her research
interests include high-performance computing, large-scale simulations, parallel numerical algorithms,
performance analysis, and adaptive algorithms.
Yuzhong Shen received his B.S. degree in Electrical Engineering from Fudan University, Shanghai, China,
M.S. degree in Computer Engineering from Mississippi State University, Starkville, Mississippi, and Ph.D.
degree in Electrical Engineering from the University of Delaware, Newark, Delaware. His research
interests include computer graphics, visualization, serious games, signal and image processing, and
modeling and simulation. Dr. Shen is currently an Associate Professor of the Department of Modeling,
Simulation, and Visualization Engineering and the Department of Electrical and Computer Engineering of
Old Dominion University. He is also affiliated with Virginia Modeling, Analysis, and Simulation Center
(VMASC). Dr. Shen is a Senior Member of IEEE.
Manwo Ng is currently an Assistant Professor of Maritime and Supply Chain Management at Old
Dominion University (ODU). He obtained his Ph.D. degree in Transportation from The University of Texas
at Austin. His research focuses on port operations, container shipping, and transportation network
modeling.
Ad

Recommended

Finding Relationships between the Our-NIR Cluster Results
Finding Relationships between the Our-NIR Cluster Results
CSCJournals
 
Clustering, k-means clustering
Clustering, k-means clustering
Megha Sharma
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
IJERD Editor
 
K means report
K means report
Gaurav Handa
 
Kernal based speaker specific feature extraction and its applications in iTau...
Kernal based speaker specific feature extraction and its applications in iTau...
TELKOMNIKA JOURNAL
 
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
butest
 
Hierarchical Clustering
Hierarchical Clustering
Megha Sharma
 
K mean-clustering
K mean-clustering
Afzaal Subhani
 
New Approach for K-mean and K-medoids Algorithm
New Approach for K-mean and K-medoids Algorithm
Editor IJCATR
 
Expert system design for elastic scattering neutrons optical model using bpnn
Expert system design for elastic scattering neutrons optical model using bpnn
ijcsa
 
Kmeans
Kmeans
Nikita Goyal
 
PCA and SVD in brief
PCA and SVD in brief
N. I. Md. Ashafuddula
 
Lda
Lda
sk19920909
 
Image recogonization
Image recogonization
SANTOSH RATH
 
Reduct generation for the incremental data using rough set theory
Reduct generation for the incremental data using rough set theory
csandit
 
Pca analysis
Pca analysis
kunasujitha
 
Dimensionality reduction
Dimensionality reduction
Shatakirti Er
 
Presentation on unsupervised learning
Presentation on unsupervised learning
ANKUSH PAL
 
On the High Dimentional Information Processing in Quaternionic Domain and its...
On the High Dimentional Information Processing in Quaternionic Domain and its...
IJAAS Team
 
Unsupervised learning clustering
Unsupervised learning clustering
Dr Nisha Arora
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
theijes
 
Data clustering using kernel based
Data clustering using kernel based
IJITCA Journal
 
K means clustering algorithm
K means clustering algorithm
Darshak Mehta
 
Principal component analysis
Principal component analysis
Farah M. Altufaili
 
Unsupervised learning clustering
Unsupervised learning clustering
Arshad Farhad
 
Unsupervised learning: Clustering
Unsupervised learning: Clustering
Deepak George
 
A COMPARATIVE STUDY ON DISTANCE MEASURING APPROACHES FOR CLUSTERING
A COMPARATIVE STUDY ON DISTANCE MEASURING APPROACHES FOR CLUSTERING
IJORCS
 
Optimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering Algorithm
IJERA Editor
 
Dijkstra Shortest Path Visualization
Dijkstra Shortest Path Visualization
IRJET Journal
 
Graphs
Graphs
Ghaffar Khan
 

More Related Content

What's hot (20)

New Approach for K-mean and K-medoids Algorithm
New Approach for K-mean and K-medoids Algorithm
Editor IJCATR
 
Expert system design for elastic scattering neutrons optical model using bpnn
Expert system design for elastic scattering neutrons optical model using bpnn
ijcsa
 
Kmeans
Kmeans
Nikita Goyal
 
PCA and SVD in brief
PCA and SVD in brief
N. I. Md. Ashafuddula
 
Lda
Lda
sk19920909
 
Image recogonization
Image recogonization
SANTOSH RATH
 
Reduct generation for the incremental data using rough set theory
Reduct generation for the incremental data using rough set theory
csandit
 
Pca analysis
Pca analysis
kunasujitha
 
Dimensionality reduction
Dimensionality reduction
Shatakirti Er
 
Presentation on unsupervised learning
Presentation on unsupervised learning
ANKUSH PAL
 
On the High Dimentional Information Processing in Quaternionic Domain and its...
On the High Dimentional Information Processing in Quaternionic Domain and its...
IJAAS Team
 
Unsupervised learning clustering
Unsupervised learning clustering
Dr Nisha Arora
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
theijes
 
Data clustering using kernel based
Data clustering using kernel based
IJITCA Journal
 
K means clustering algorithm
K means clustering algorithm
Darshak Mehta
 
Principal component analysis
Principal component analysis
Farah M. Altufaili
 
Unsupervised learning clustering
Unsupervised learning clustering
Arshad Farhad
 
Unsupervised learning: Clustering
Unsupervised learning: Clustering
Deepak George
 
A COMPARATIVE STUDY ON DISTANCE MEASURING APPROACHES FOR CLUSTERING
A COMPARATIVE STUDY ON DISTANCE MEASURING APPROACHES FOR CLUSTERING
IJORCS
 
Optimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering Algorithm
IJERA Editor
 
New Approach for K-mean and K-medoids Algorithm
New Approach for K-mean and K-medoids Algorithm
Editor IJCATR
 
Expert system design for elastic scattering neutrons optical model using bpnn
Expert system design for elastic scattering neutrons optical model using bpnn
ijcsa
 
Image recogonization
Image recogonization
SANTOSH RATH
 
Reduct generation for the incremental data using rough set theory
Reduct generation for the incremental data using rough set theory
csandit
 
Dimensionality reduction
Dimensionality reduction
Shatakirti Er
 
Presentation on unsupervised learning
Presentation on unsupervised learning
ANKUSH PAL
 
On the High Dimentional Information Processing in Quaternionic Domain and its...
On the High Dimentional Information Processing in Quaternionic Domain and its...
IJAAS Team
 
Unsupervised learning clustering
Unsupervised learning clustering
Dr Nisha Arora
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
theijes
 
Data clustering using kernel based
Data clustering using kernel based
IJITCA Journal
 
K means clustering algorithm
K means clustering algorithm
Darshak Mehta
 
Unsupervised learning clustering
Unsupervised learning clustering
Arshad Farhad
 
Unsupervised learning: Clustering
Unsupervised learning: Clustering
Deepak George
 
A COMPARATIVE STUDY ON DISTANCE MEASURING APPROACHES FOR CLUSTERING
A COMPARATIVE STUDY ON DISTANCE MEASURING APPROACHES FOR CLUSTERING
IJORCS
 
Optimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering Algorithm
IJERA Editor
 

Similar to JAVA BASED VISUALIZATION AND ANIMATION FOR TEACHING THE DIJKSTRA SHORTEST PATH ALGORITHM IN TRANSPORTATION NETWORKS (20)

Dijkstra Shortest Path Visualization
Dijkstra Shortest Path Visualization
IRJET Journal
 
Graphs
Graphs
Ghaffar Khan
 
15-bellmanFord.pptx...........................................
15-bellmanFord.pptx...........................................
ejazayesha485
 
Deixtras Algorithm.pptxdjjdjdjdjddddddddddddddd
Deixtras Algorithm.pptxdjjdjdjdjddddddddddddddd
OrxanMirzzad
 
Dijkstra’s algorithm
Dijkstra’s algorithm
faisal2204
 
AN EFFECT OF USING A STORAGE MEDIUM IN DIJKSTRA ALGORITHM PERFORMANCE FOR IDE...
AN EFFECT OF USING A STORAGE MEDIUM IN DIJKSTRA ALGORITHM PERFORMANCE FOR IDE...
ijcsit
 
Lecture 16 - Dijkstra's Algorithm.pdf
Lecture 16 - Dijkstra's Algorithm.pdf
iftakhar8
 
DIJKSTRA_123.pptx
DIJKSTRA_123.pptx
KrishnaSawant8
 
Dijkstra's algorithm for computer science
Dijkstra's algorithm for computer science
ajmalnajath4
 
mini project_shortest path visualizer.pptx
mini project_shortest path visualizer.pptx
tusharpawar803067
 
SHORTEST PATH FINDING VISUALIZER
SHORTEST PATH FINDING VISUALIZER
IRJET Journal
 
S210
S210
shi t
 
Flight-schedule using Dijkstra's algorithm with comparison of routes findings
Flight-schedule using Dijkstra's algorithm with comparison of routes findings
IJECEIAES
 
Dijkstra’s Algorithm and Prim’s Algorithm in Graph Theory and Combinatorics
Dijkstra’s Algorithm and Prim’s Algorithm in Graph Theory and Combinatorics
Shouvic Banik0139
 
bellman-ford Theorem.ppt
bellman-ford Theorem.ppt
SaimaShaheen14
 
P5 - Routing Protocols
P5 - Routing Protocols
Kurniawan Dwi Irianto
 
9_graphs2.v4.ppt
9_graphs2.v4.ppt
tariqghufran458
 
Single source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstra
Roshan Tailor
 
Dijkstra algorithm ds 57612334t4t44.ppt
Dijkstra algorithm ds 57612334t4t44.ppt
ssuser7b9bda1
 
Dijkstra Shortest Path Algorithm in Network.ppt
Dijkstra Shortest Path Algorithm in Network.ppt
RAJASEKARAN G
 
Dijkstra Shortest Path Visualization
Dijkstra Shortest Path Visualization
IRJET Journal
 
15-bellmanFord.pptx...........................................
15-bellmanFord.pptx...........................................
ejazayesha485
 
Deixtras Algorithm.pptxdjjdjdjdjddddddddddddddd
Deixtras Algorithm.pptxdjjdjdjdjddddddddddddddd
OrxanMirzzad
 
Dijkstra’s algorithm
Dijkstra’s algorithm
faisal2204
 
AN EFFECT OF USING A STORAGE MEDIUM IN DIJKSTRA ALGORITHM PERFORMANCE FOR IDE...
AN EFFECT OF USING A STORAGE MEDIUM IN DIJKSTRA ALGORITHM PERFORMANCE FOR IDE...
ijcsit
 
Lecture 16 - Dijkstra's Algorithm.pdf
Lecture 16 - Dijkstra's Algorithm.pdf
iftakhar8
 
Dijkstra's algorithm for computer science
Dijkstra's algorithm for computer science
ajmalnajath4
 
mini project_shortest path visualizer.pptx
mini project_shortest path visualizer.pptx
tusharpawar803067
 
SHORTEST PATH FINDING VISUALIZER
SHORTEST PATH FINDING VISUALIZER
IRJET Journal
 
S210
S210
shi t
 
Flight-schedule using Dijkstra's algorithm with comparison of routes findings
Flight-schedule using Dijkstra's algorithm with comparison of routes findings
IJECEIAES
 
Dijkstra’s Algorithm and Prim’s Algorithm in Graph Theory and Combinatorics
Dijkstra’s Algorithm and Prim’s Algorithm in Graph Theory and Combinatorics
Shouvic Banik0139
 
bellman-ford Theorem.ppt
bellman-ford Theorem.ppt
SaimaShaheen14
 
Single source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstra
Roshan Tailor
 
Dijkstra algorithm ds 57612334t4t44.ppt
Dijkstra algorithm ds 57612334t4t44.ppt
ssuser7b9bda1
 
Dijkstra Shortest Path Algorithm in Network.ppt
Dijkstra Shortest Path Algorithm in Network.ppt
RAJASEKARAN G
 
Ad

Recently uploaded (20)

SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
parmarjuli1412
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
Q1_TLE 8_Week 1- Day 1 tools and equipment
Q1_TLE 8_Week 1- Day 1 tools and equipment
clairenotado3
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
INDUCTIVE EFFECT slide for first prof pharamacy students
INDUCTIVE EFFECT slide for first prof pharamacy students
SHABNAM FAIZ
 
Peer Teaching Observations During School Internship
Peer Teaching Observations During School Internship
AjayaMohanty7
 
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
How to use search fetch method in Odoo 18
How to use search fetch method in Odoo 18
Celine George
 
A Visual Introduction to the Prophet Jeremiah
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
sumadsadjelly121997
 
LDMMIA Shop & Student News Summer Solstice 25
LDMMIA Shop & Student News Summer Solstice 25
LDM & Mia eStudios
 
How payment terms are configured in Odoo 18
How payment terms are configured in Odoo 18
Celine George
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
Learning Styles Inventory for Senior High School Students
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
 
Aprendendo Arquitetura Framework Salesforce - Dia 02
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
parmarjuli1412
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
Q1_TLE 8_Week 1- Day 1 tools and equipment
Q1_TLE 8_Week 1- Day 1 tools and equipment
clairenotado3
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
INDUCTIVE EFFECT slide for first prof pharamacy students
INDUCTIVE EFFECT slide for first prof pharamacy students
SHABNAM FAIZ
 
Peer Teaching Observations During School Internship
Peer Teaching Observations During School Internship
AjayaMohanty7
 
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
How to use search fetch method in Odoo 18
How to use search fetch method in Odoo 18
Celine George
 
A Visual Introduction to the Prophet Jeremiah
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
sumadsadjelly121997
 
LDMMIA Shop & Student News Summer Solstice 25
LDMMIA Shop & Student News Summer Solstice 25
LDM & Mia eStudios
 
How payment terms are configured in Odoo 18
How payment terms are configured in Odoo 18
Celine George
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
Learning Styles Inventory for Senior High School Students
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
 
Aprendendo Arquitetura Framework Salesforce - Dia 02
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
Ad

JAVA BASED VISUALIZATION AND ANIMATION FOR TEACHING THE DIJKSTRA SHORTEST PATH ALGORITHM IN TRANSPORTATION NETWORKS

  • 1. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 DOI: 10.5121/ijsea.2016.7302 11 JAVA BASED VISUALIZATION AND ANIMATION FOR TEACHING THE DIJKSTRA SHORTEST PATH ALGORITHM IN TRANSPORTATION NETWORKS Ivan Makohon1 , Duc T. Nguyen2 , Masha Sosonkina3 , Yuzhong Shen4 and Manwo Ng5 1 Graduate Student, Department of Modeling, Simulation & Visualization Engineering (MSVE), Old Dominion University (ODU), Norfolk, Virginia 2 Professor, Civil & Environmental Engineering (CEE) Department, ODU, Norfolk, Virginia 3 Professor, Department of MSVE,ODU, Norfolk, Virginia 4 Associate Professor, Department of MSVE, ODU, Norfolk, Virginia 5 Assistant Professor, Department of Information Technology and Decision, ODU, Norfolk, Virginia ABSTRACT Shortest path (SP) algorithms, such as the popular Dijkstra algorithm has been considered as the “basic building blocks” for many advanced transportation network models. Dijkstra algorithm will find the shortest time (ST) and the corresponding SP to travel from a source node to a destination node. Applications of SP algorithms include real-time GPS and the Frank-Wolfe network equilibrium. For transportation engineering students, the Dijkstra algorithm is not easily understood. This paper discusses the design and development of a software that will help the students to fully understand the key components involved in the Dijkstra SP algorithm. The software presents an intuitive interface for generating transportation network nodes/links, and how the SP can be updated in each iteration. The software provides multiple visual representations of colour mapping and tabular display. The software can be executed in each single step or in continuous run, making it easy for students to understand the Dijkstra algorithm. Voice narratives in different languages (English, Chinese and Spanish) are available.A demo video of the Dijkstra Algorithm’s animation and result can be viewed online from any web browser using the website: http://www.lions.odu.edu/~imako001/dijkstra/demo/index.html. KEYWORDS Transportation, Dijkstra Algorithm, Java, Visualization, Animation
  • 2. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 12 1. INTRODUCTION Finding the shortest time (ST), or the shortest distance (SD) and its corresponding shortest path (SP) to travel from any i-th “source” node to any j-th “destination (or target)” node of a given transportation network is an important, fundamental problem in transportation modelling. Efficient SP algorithms, such as the Label Correction Algorithm (LCA) and its improved version of Polynomial (or partitioned) LCA, forward Dijkstra, backward Dijkstra, Bi-directional Dijkstra, A* algorithms have been developed, tested and well documented in the literatures [1-3]. Teaching the SP algorithms (such as the Dijkstra algorithm), however, can be a difficult/challenging task! While some teaching information/lecture/tool/animation for Dijkstra algorithms have existed/appeared in the literatures [4-6], none seems to be suitable/appropriate for our students’ learning environments, due to the lack of one (or more) of the following desirable features/capabilities: 1. The developed software tool should be user friendly (easy to use). 2. Graphical/colourful animation should be extensively used to display equations, and/or intermediate/final output results. 3. Clear/attractive computer animated instructor’s voice should be incorporated in the software tool. 4. The instructor’s voice for teaching materials can be in different/major languages (English, Chinese, and Spanish). 5. User’s input data can be provided in either interactive mode, or in edited input data file mode, or by graphical mode. 6. Options for partial (or intermediate) results and/or complete (final results) are available for the user to select. 7. Options for displaying all detailed intermediate results in the first 1-2 iterations, and/or directly show the final answers are available for users. 8. Users/learners can provide his/her own data, and compare his/her hand-calculated results with the computer software’s generated results (in each step of the algorithm) for enhancing/improving his/her learning abilities. The remaining sections of this article is organized as follow. In section II, the basic forward Dijkstra algorithm is summarized (for the readers’ convenience). Java language is adopted in this work due to its powerful graphical and animated features. Special and useful features of the developed Java software for teaching Dijkstra algorithm are high-lighted and demonstrated in (including some computer screen captures) Section III. Conclusions are summarized/suggested in Section IV. 2. SUMMARY OF THE BASIC FORWARD DIJKSTRA SHORTEST PATH ALGORITHM The basic forward Dijkstra algorithm is a graph search algorithm that solves for the shortest path, time, or distance from any given source node to a destination node. The graph is represented/stored within a 2-Dimentional NxN matrix where the rows and columns of the matrix headers are represented as the nodes and the values within the matrix at a location (Aij) are the link’s value (path, distance, or time value), refer to Figure 1. Figure 1 shows a simple 3 x 3
  • 3. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 13 matrix where Node 1 Node 2 has a link value of 6, Node 1 Node 3 have a link value of 4, and Node 2 Node 3 has a link value of 2 With any given N x N size matrix, the shortest path, time, or distance can be solved using the basic forward Dijkstra shortest path algorithm. For example, we demonstrate and solve for a sample 6 x 6 matrix (Figure 2) and graph (Figure 3) to find the shortest path, time, or distance from Node 1 (source node) to Node 6 (destination node). We demonstrate and use a simple (easy to use) bookkeeping (Figure 4) method while iterating through the forward Dijkstra algorithm. Figure 4 shows the initial values for the Set s and Set s prime. Set s is empty during initialization and is used to bookkeep nodes already visited. Set s prime contains all the nodes during initialization and nodes are removed as they are visited. The vector {d} bookkeeps the shortest path, time, or distance value and the vector {pred} bookkeeps the predecessor nodes after each iteration within the Dijkstra algorithm.
  • 4. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 14 During the first iteration, we set the source node to Node 1 and update Set s = {1} and Set s prime = {2, 3, 4, 5, 6}. Note that Node 1 is removed from Set s prime and added to the Set s. From Node 1, there are 2 outgoing links, Node 2 and Node 3 (Figure 3). We check the outgoing Nodes (2 and 3) from Node 1 (Source Node) to determine if Vector [d] and [pred] need to be updated with the shortest path, time or distance. This can be done referencing the values stored in Vector d[2] and d[3]. Compare the stored Vector d[2] value to see if it’s greater-than the computed value, which is the stored Vector d[1] plus the value at C13(link value between Node 1 and 3). Compare the stored Vector d[3] value to see if it’s greater-than the computed value, which is the stored Vector d[1] plus C12(link value between Node 1 and 2). If the stored values are greater-than the computed values then update the Vector d with the computed value. If not, then no update is needed and the stored value remains the same.
  • 5. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 15 In both of these cases, the stored values for d[2] and d[3] are infinity (∞) so the values in Vector [d] and [pred] will need to be updated with the computed values (Figure 5). Figure 5 shows the simple (easy to use) bookkeeping method and updates (if needed). Once this calculation and update has taken place, we determine the smallest value among the nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[3] has the smallest value among the nodes in Set {s prime}, we move Node 3 to Set {s} = { 1, 3 } and remove it from Set {s prime} = { 2, 4, 5, 6 }. Now Node 3 becomes the next source node. The Next iteration (k = 2), begins by checking the outgoing nodes from Node 3 (source node). We check the outgoing Nodes (4 and 5) from Node 3 (Source Node) to determine if Vector [d] and [pred] need to be updated with the shortest path, time or distance. This can be done referencing the values stored in Vector d[4] and d[5]. Compare the stored Vector d[4] value to see if it’s greater-than the computed value, which is the stored Vector d[3] plus the value at C34(link value between Node 3 and 4). Compare the stored Vector d[5] value to see if it’s greater-than the computed value, which is the stored Vector d[3] plus C35(link value between Node 3 and 5). If the stored values are greater-than the computed values then update the Vector d with the computed value. If not, then no update is needed and the stored value remains the same.
  • 6. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 16 In both of these cases, the stored values for d[4] and d[5] are infinity (∞) so the values in Vector [d] and [pred] will need to be updated with the computed values (Figure 6). Figure 6 shows the simple (easy to use) bookkeeping method and updates (if needed). Once this calculation and update has taken place, we determine the smallest value among the nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[4] has the smallest value among the nodes in Set {s prime}, we move Node 4 to Set {s} = { 1, 3, 4 } and remove it from Set {s prime} = { 2, 5, 6 }. Now Node 4 becomes the next source node. The Next iteration (k = 3), begins by checking the outgoing nodes from Node 4 (source node). We check the outgoing Node 6 from Node 4 (Source Node) to determine if Vector [d] and [pred] need to be updated with the shortest path, time or distance. This can be done referencing the values stored in Vector d[6]. Compare the stored Vector d[4] value to see if it’s greater-than the computed value, which is the stored Vector d[4] plus the value at C46(link value between Node 4 and 6). If the stored value is greater-than the computed value, then update the Vector d with the computed value. If not, then no update is needed and the stored value remains the same. In this case, the stored value for d[6] is infinity (∞) so the value in Vector [d] and [pred] will need to be updated with the computed value (Figure 7). Figure 7 shows the simple (easy to use) bookkeeping method and updates (if needed). Once this calculation and update has taken place, we determine the smallest value among the nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[2] and d[5] has the smallest value, 6 among the nodes in Set {s prime}, we arbitrarily select and move Node 2 to Set {s} = { 1, 3, 4, 2 } and remove it from Set {s prime} = { 5, 6 }. Now Node 2 becomes the next source node. Note: we could do further research here to pick the better of the 2 choices instead or arbitrarily selecting one. The Next iteration (k = 4), begins by checking the outgoing nodes from Node 2 (source node). We check the outgoing Nodes (3 and 4) from Node 2 (Source Node) to determine if Vector [d] and [pred] need to be updated with the shortest path, time or distance. This can be done referencing the values stored in Vector d[3] and d[4]. Compare the stored Vector d[3] value to
  • 7. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 17 see if it’s greater-than the computed value, which is the stored Vector d[2] plus the value at C23(link value between Node 2 and 3). Compare the stored Vector d[4] value to see if it’s greater-than the computed value, which is the stored Vector d[2] plus C24(link value between Node 2 and 4). If the stored values are greater-than the computed values then update the Vector d with the computed value. If not, then no update is needed and the stored value remains the same. In both of these cases, the stored values for d[3] and d[4] are 4 and 5 respectively so the values are not greater-than the computed values so no update is needed (Figure 8). Figure 8 shows the simple (easy to use) bookkeeping method and updates (if needed). In this case, no update is needed since the stored values are not greater-than the computed values. Once this calculation and update has taken place, we determine the smallest value among the nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[5] has the smallest value among the nodes in Set {s prime}, we move Node 5 to Set {s} = { 1, 3, 4, 2, 5 } and remove it from Set {s prime} = { 6 }. Now Node 5 becomes the next source node. Remark: When determining the smallest value was a tie for Nodes 2 and 5 (see previous iteration), we were better off to select and move Node 5 instead of arbitrarily selecting Node 2. The Next iteration (k = 5), begins by checking the outgoing nodes from Node 5 (source node). We check the outgoing Nodes (4 and 6) from Node 5 (Source Node) to determine if Vector [d] and [pred] need to be updated with the shortest path, time or distance. This can be done referencing the values stored in Vector d[4] and d[6]. Compare the stored Vector d[4] value to see if it’s greater-than the computed value, which is the stored Vector d[5] plus the value at C54 (link value between Node 5 and 4). Compare the stored Vector d[6] value to see if it’s greater- than the computed value, which is the stored Vector d[5] plus C56(link value between Node 5 and 6). If the stored values are greater-than the computed values then update the Vector d with the computed value. If not, then no update is needed and the stored value remains the same. In both of these cases, the stored values for d[4] and d[6] are 5 and 12 respectively so the value for d[4] is not greater-than the computed values so no update is needed (Figure 9). However, the value for d[6] is greater-than the computed values in Vector [d] and [pred] will need to be updated with the computed values (Figure 9). Figure 9 shows the simple (easy to use)
  • 8. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 18 bookkeeping method and updates (if needed). In this case, one outgoing node is updated is needed since the stored values is greater-than the computed values. Once this calculation and update has taken place, we determine the smallest value among the nodes in Set {s prime} and then we move the node to the Set {s}. Because Vector d[6] is the only remaining node and is the destination node, we move Node 6 to Set {s} = { 1, 3, 4, 2, 5, 6 } and remove it from Set {s prime} = { empty }. Now Node 6 becomes the next source node and is our destination node. This completes the shortest path, time, or distance for solving for the basic forward Dijkstra algorithm.
  • 9. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 19 The updates for each iteration for Vector [d], Vector [pred], and Set {s} are displayed in Figures 10, 11, and 12, respectively. For each iteration, the highlighted circle (light blue circle) shows the corresponding values being updated during that iteration.
  • 10. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 3. JAVA COMPUTER A FORWARD DIJKSTRA ALGORITHM The previous section’s small-scale 6 x 6 Matrix [A] graph data will be used for the Java [7 computer animated software tool for teaching the initialize and run the Java software. Once initialized, the application’s “Main Control” Graphical User Interface (GUI) is displayed (Figure 13). This GUI controls the flow of the basic forward Dijkstra algorithm teaching steps from start to finish and will provide detailed algorithm steps while solving for the shortest path, time, or distance. The users/learners will be able to input the matrix [A] data from several input options (input file, manual input or randomly generated values) from the “Main Control” GUI. When an input option is selected the user/learner will be able to modify the data within the “Matrix Editor” GUI. The “Matrix Editor” GUI (Figure 14) allows the user/learner to change the size of dimensions and modify the values before solving for the shortest path, time, or distance. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 ANIMATED SOFTWARE TOOL FOR T LGORITHM scale 6 x 6 Matrix [A] graph data will be used for the Java [7 computer animated software tool for teaching the Dijkstra algorithm. The users/learner will initialize and run the Java software. Once initialized, the application’s “Main Control” Graphical User Interface (GUI) is displayed (Figure 13). This GUI controls the flow of the basic forward hm teaching steps from start to finish and will provide detailed algorithm steps while solving for the shortest path, time, or distance. The users/learners will be able to input the matrix [A] data from several input options (input file, r randomly generated values) from the “Main Control” GUI. When an input option is selected the user/learner will be able to modify the data within the “Matrix Editor” GUI. The “Matrix Editor” GUI (Figure 14) allows the user/learner to change the size of the matrix [A] dimensions and modify the values before solving for the shortest path, time, or distance. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 20 TEACHING scale 6 x 6 Matrix [A] graph data will be used for the Java [7-9] Dijkstra algorithm. The users/learner will initialize and run the Java software. Once initialized, the application’s “Main Control” Graphical User Interface (GUI) is displayed (Figure 13). This GUI controls the flow of the basic forward hm teaching steps from start to finish and will provide detailed algorithm steps The users/learners will be able to input the matrix [A] data from several input options (input file, r randomly generated values) from the “Main Control” GUI. When an input option is selected the user/learner will be able to modify the data within the “Matrix Editor” GUI. the matrix [A] dimensions and modify the values before solving for the shortest path, time, or distance.
  • 11. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 21 After the Matrix data [A] is entered into the "Matrix Editor" and "Ok" is selected, the focus is returned back to the "Main Control" GUI. The matrix data [A] is shown in to viewable formats, the “Matrix Canvas”, "Data", and "Network Graph" views. Both views will be updated accordingly throughout the steps in the basic forward Dijkstra Algorithm. Once the matrix data [A] is inputted, the "Play" button is enabled. Once the user/learner selects the "Play" button, the teaching of the basic forward Dijkstra Algorithm steps begins. The basic forward Dijkstra Algorithm performs the algorithm steps against the matrix data [A], the matrix data [A] is updated accordingly and displayed within the Views, and the algorithm steps is lectured to the user/learner by a computer animated voice. The algorithm steps handled within the Java software are as follows: 3.1. Step 0 – Initialization The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will handle the matrix data if provided as a rectangular or tall matrix. The algorithm will add "dummy" rows (or columns) with the maximum corresponding value within the matrix. The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will solve for shortest path, time, or distance. The GUI will prompt an input dialog for the user/learning to select what the source and destination nodes. The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will initialize the data vectors and sets and set the source node (Figure 15). 3.2. Step 1 – Consider all Outgoing Edges from the Current Node The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will consider all outgoing links from the current node and will determine if the stored Vector [d] values for the outgoing nodes are greater-than the computed values of the previous node plus the link (edge)
  • 12. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 22 values. If the stored Vector [d] value is greater-than the computed value then the Vector [d] value is updated accordingly; otherwise, the value remains the same. The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will have animated each step and provide detailed animated voice and text for each step (Figure 16). 3.3. Step 2 – Determine the Smallest “d” Value for each Node within Set Sfinal`(Prime) and Move the Smallest Node to Set Sfinal The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will determine the smallest value from the Set {s prime} and remove the smallest from Set {s prime} and add it to Set {s}.
  • 13. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 23 The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will update the current node as the source node for the next iteration (Figure 17). 3.4. Step 3 – Determine the Shortest Time and Path from the Source Node to the Target Node The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will determine the shortest path, time, or distance based on the outcome of the Dijkstra algorithms using the bookkeeping of Vector [d], Vector [pred], Set {s}, Set {s prime}. The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will highlight the shortest path (Figure 18). The Java Computer Animation for Teaching the Forward Dijkstra Algorithm will display the final results of the shortest path, time, or distance by highlighting the nodes and links from the source to destination node. 4. CONCLUSIONS In this article, the basic Dijkstra algorithm has been firstly summarized. Then, Java Computer Animated Software Tool has been developed to enhance student’s learning. The developed Java animated software has all the following desirable features/capabilities, such as: 1. The developed software tool should be user friendly (easy to use). 2. Graphical/colourful animation should be extensively used to display equations, and/or intermediate/final output results. 3. Clear/attractive computer animated instructor’s voice should be incorporated in the software tool.
  • 14. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 24 4. The instructor’s voice for teaching materials can be in different/major languages (English, Chinese, and Spanish). 5. User’s input data can be provided in either interactive mode, or in edited input data file mode, or by graphical mode. 6. Options for partial (or intermediate) results and/or complete (final results) are available for the user to select. 7. Options for displaying all detailed intermediate results in the first 1-2 iterations, and/or directly show the final answers are available for users. 8. Users/learners can provide his/her own data, and compare his/her hand-calculated results with the computer software’s generated results (in each step of the algorithm) for enhancing/improving his/her learning abilities. ACKNOWLEDGEMENTS The partial support provided by the NSF grant # ACI-1440673 (ODU-RF Project # 100507-010) to Duc T. Nguyen is gratefully acknowledged. The work of Sosonkina was supported in part by the Air Force Office of Scientific Research under the AFOSR award FA9550-12-1-0476, and by the National Science Foundation grants NSF/OCI---0941434, 0904782, 1047772. REFERENCES [1] Sheffi, Y., 1985. Urban Transportation Networks: Equilibrium Analysis with Mathematical Programming Methods. Available free of charge at: http://web.mit.edu/sheffi/www/urbanTransportation.html [2] Lawson, G., Allen, S., Rose, G., Nguyen, D.T., Ng, M.W. “Parallel Label Correcting Algorithms for Large-Scale Static and Dynamic Transportation Networks on Laptop Personal Computers”, Transportation Research Board (TRB) 2013 Annual Meeting (Washington, D.C.; Jan. 13-17, 2013); Session 844 Presentation # 13-2103 (Thursday, Jan. 17-2013; 10:15am-noon); Poster Presentation # P13-6655. [3] Paul Johnson III, Duc T. Nguyen, and Manwo Ng, “An Efficient Shortest Distance Decomposition Algorithm for Large-Scale Transportation Network Problems”, TRB 2014 Annual Meeting (Washington, D.C.; January 2014); Oral, and Poster Presentations. [4] Dijkstra’s Shortest Path Algorithm. http://www.cs.uah.edu/~rcoleman/CS221/Graphs/ShortestPath.html. [5] Dijkstra Algorithm. http://students.ceid.upatras.gr/~papagel/project/kef5_7_1.htm. [6] Dijkstra’s Algorithm.http://www3.cs.stonybrook.edu/~skiena/combinatorica/animations/dijkstra.html. [7] Java Matrix Library (EJML). Efficient http://code.google.com/p/efficient-java-matrix-library/wiki/EjmlManual. [8] Google Translate Java. http://code.google.com/p/google-api-translate-java/. [9] Java Platform Standard Edition.http://www.oracle.com/technetwork/java/javase/downloads/index.htmllishers.
  • 15. International Journal of Software Engineering & Applications (IJSEA), Vol.7, No.3, May 2016 25 Authors Ivan Makohon is a current Old Dominion University graduate student pursuing his Masters in Modeling and Simulations. He has received his Bachelors of Science in Computer Science from Christopher Newport University (CNU). He has been working as a contractor (and now, a civil servant) as a Senior Software Engineer, and he is also a Private Pilot. Duc T. Nguyen has received his B.S., M.S. and Ph.D. (Civil/Structural engineering) degrees from Northeastern University (Boston), University of California (Berkeley), and the University of Iowa (Iowa City), respectively. He has been a Civil Engineering faculty at Old Dominion University since 1985. He has published 4 undergraduate/graduate textbooks. Over 160 research articles and nearly $ 4 million funded projects have been generated by him. He has received Cray Research, NASA, ODU shining star, and Rufus Tonelson Distinguished Faculty Awards. His name has been included in the ISIHighlyCited.com list of most highly cited researchers in Engineering. Masha Sosonkina has received her B.S. and M.S. degrees in Applied Mathematics from Kiev National University in Ukraine, and a Ph.D. degree in Computer Science and Applications from Virginia Tech. During 2003-2012, Dr. Sosonkina was a scientist at the US Department of Energy Ames Laboratory and an adjunct faculty at Iowa State University. She is currently a professor of Modeling, Simulation and Visualization Engineering at Old Dominion University. She has also been a visiting research scientist at the Minnesota Supercomputing Institute, at CERFACS and INRIA French research centers. Her research interests include high-performance computing, large-scale simulations, parallel numerical algorithms, performance analysis, and adaptive algorithms. Yuzhong Shen received his B.S. degree in Electrical Engineering from Fudan University, Shanghai, China, M.S. degree in Computer Engineering from Mississippi State University, Starkville, Mississippi, and Ph.D. degree in Electrical Engineering from the University of Delaware, Newark, Delaware. His research interests include computer graphics, visualization, serious games, signal and image processing, and modeling and simulation. Dr. Shen is currently an Associate Professor of the Department of Modeling, Simulation, and Visualization Engineering and the Department of Electrical and Computer Engineering of Old Dominion University. He is also affiliated with Virginia Modeling, Analysis, and Simulation Center (VMASC). Dr. Shen is a Senior Member of IEEE. Manwo Ng is currently an Assistant Professor of Maritime and Supply Chain Management at Old Dominion University (ODU). He obtained his Ph.D. degree in Transportation from The University of Texas at Austin. His research focuses on port operations, container shipping, and transportation network modeling.