Professional Documents
Culture Documents
2SE1 Group 6:
Muhammad Fajrul Falah
Muhammad Yusuf Ilham Abdulhadi
Rivan Anjung Sinar Permana
Faculty:
Mr. Muhammad Riza Iqbal
First of all, definitely we would like to thank God the Almighty, who has given his
blessing to the author for finishing these papers.
In its preparation, these papers consist of four chapters; consisting of Chapter I as the
Introduction of these papers, Chapter II will be discussing the Basic Theory, Chapter III
Problem Analysis, Chapter IV Conclusion and Suggestion of these papers.
As authors, we acknowledge that our limited knowledge and experience may have
resulted in certain limitations in this paper. Consequently, we humbly request constructive
criticism and suggestions from our readers to help us enhance and refine this work. We hope
that these papers can be a reference for choosing topics Dijkstra's Algorithm to find the
optimal route.
Author
i
TABLE OF CONTENTS
PREFACE............................................................................................................i
TABLE OF CONTENTS...................................................................................ii
TABLE OF FIGURES......................................................................................iv
TABLE OF TABLES.........................................................................................v
CHAPTER I: INTRODUCTION......................................................................1
I.1. Background................................................................................................1
IV.1. Conclusion.............................................................................................16
ii
IV.2. Suggestion.............................................................................................16
BIBLIOGRAPHY.............................................................................................17
APPENDIX........................................................................................................18
iii
TABLE OF FIGURES
iv
TABLE OF TABLES
v
CHAPTER I: INTRODUCTION
I.1. Background
Today, the entire world is digitalised. Every typical device that makes our lives so
easy and fast has an intellect and a feeling of communication. These technological
advancements are aided by software, a collection of programmes designed to solve a specific
problem. And every programme is based on an Algorithm, which is a logic/solution.
People often ask us, “what is an algorithm?” To answer them, an algorithm is a step-
by-step technique that specifies a series of instructions that must be followed in a precise
order to achieve the intended outcome. Algorithms are usually designed independently of the
underlying programming languages, which implies that they may be implemented in several
languages. An algorithm's properties include ambiguity, fineness, efficacy, and language
independence. An algorithm's scalability and performance are the major elements that
influence its relevance.
It is not the whole programme or code; rather, it is basic reasoning for a problem
expressed in the form of a flowchart or pseudocode.
1
Dijkstra's Algorithm is a popular problem-solving technique used in computer science
and mathematics to find the shortest path between two points in a graph. The main purpose of
using Dijkstra's algorithm is to find the optimal route between two points on a graph
2
2
The Dijkstra’s Algorithm guarantees to find the shortest path between two nodes in a
weighted graph, where the edges have a weight or distance assigned to them. Dijkstra's
algorithm is a powerful tool for solving optimization problems that involve finding the
shortest path between two points, and it has been widely adopted in many fields to improve
efficiency and reduce costs.
Algorithms are widely used throughout all areas of IT. In mathematics and computer
science, an algorithm usually refers to a small procedure that solves a recurrent problem.
Algorithms are also used as specifications for performing data processing and play a major
role in automated systems.
An algorithm could be used for sorting sets of numbers or for more complicated tasks,
like recommending user content on social media. Algorithms typically start with initial input
and instructions that describe a specific computation. When the computation is executed, the
process produces an output.
The term algorithm got its name from the Persian astronomer and mathematician,
Abu Abdullah Muhammad ibn Musa Al-Khawarizmi (780 AD), dubbed the father of algebra
4
5
infinitely long tape. This tape served as storage space for the data in the squares, computer
memory.
7
It has a ‘head’ or needle that can move to the right or left of each square to read,
write, or erase the symbol within it, the basis for CRUD (Create, Read, Update, and Delete)
operations in programming. Using this system this machine could simulate any algorithm,
regardless of its complexity!
Google engineers use algorithms to improve searches, forecast what users will enter,
etc. Knowing how to create an algorithm is an important component of computer
programming when it comes to problem-solving.
● Theoretical significance: You must break down a real-world challenge into smaller
modules when provided one. To deconstruct the issue, you must first grasp all of its
theoretical components.
8
● Practical Significance: As you are all aware, the theory is useless until it is put into
practice. As a consequence, the theoretical and practical relevance of algorithms may
be evaluated.
CHAPTER III: PROBLEM ANALYSIS
The dijkstra’s algorithm guarantees to find the shortest path between two nodes in a
weighted graph, where the edges have a weight or distance assigned to them. Dijkstra's
algorithm is a powerful algorithm for solving optimization problems that involve finding the
shortest path between two points, and it has been widely adopted in many fields to improve
efficiency and reduce costs.
Dijkstra’s algorithm also requires the graphs to have positive weights. If there’s a
negative weight in the graph, it will change and mess with the fundamental step in which the
Dijkstra Algorithm works.
The algorithm then marks the just calculated node as "visited" or has been calculated
into the algorithm records. This step is to prevent the algorithm from calculating that node
again. This process continues until all the nodes in the graph are in the algorithm records.
With this, we have complete records for all of the shortest paths from the starting node to
each node.
8
9
Figure 1.2 Starting node and assigned value to the rest (REF : Programiz)
Step 2 : Determine a starting node in the graphs and assign infinity value to the rest of the
unvisited node. and marks the starting node as “visited” node
10
Figure 1.3 Determining the shortest path from the starting node and replacing the
infinity value (REF : Programiz)
Step 3 : Go to each vertex that is connected with the starting node and determine the shortest
path between the two from the starting node and replace the infinity with the shortest path for
each of the nodes. Also update its path length.
Figure 1.4 Move to the next shortest path node as the reference node (REF : Programiz)
Step 4 : After determining the shortest path, we shall move the references node to the next
shortest path. We will put the next shortest that we will visit as a “visited” node. Then we will
determine the next shortest path from the current references node. If the path length of the
next shortest path from the reference node is lesser than the new path length, then don’t
update it.
Figure 1.8 All the vertices has been visited (REF : Programiz)
Step 8 : Repeat until the rest of the vertices is visited
12
visitedVertex[i] = false;
distance[i] = Integer.MAX_VALUE;
distance[source] = 0;
visitedVertex[u] = true;
minDistance = distance[i];
minDistanceVertex = i;
return minDistanceVertex;
{ 2, 0, 1, 0, 0, 0, 1 }, { 0, 0, 3, 0, 0, 2, 0 }, { 0, 3, 0, 0, 2,
0, 1 }, { 0, 0, 0, 1, 0, 1, 0 } };
T.dijkstra(graph, 0);
}
14
Parameter Dijkstra A*
Search Algorithm Best First Search Greedy Best First Search
Exploration Strategy Explores all possible paths Prioritizes nodes with the
lowest distance from the
starting node and the lowest
estimated distance to the
goal
Based from our analysis, it shows that Dijkstra is way slower when facing many
obstacle and larger maps, while A* faster in larger map even with many obstacles.
Telephone networks also utilize the algorithm. Each line in a telephone network has a
bandwidth, and the transmission line's bandwidth is the maximum frequency it can handle.
15
The bandwidth is a representation of how much data may be delivered across the connection.
If we visualize a city as a graph, the switching stations would be the vertices, and the
transmission lines would be the edges. The length of the line is represented by the weight of
the edges. We can determine the shortest distance between two switching stations using
Dijkstra's Algorithm.
CHAPTER IV: CONCLUSION AND SUGGESTION
IV.1. Conclusion
The Dijkstra algorithm is still an effective tool for handling optimization issues.
Dijkstra's method is a reliable option for a variety of real-life applications, such as navigation
systems, network optimization, etc. Since it ensures that the best path will be found in a
weighted graph with positive weights.
In contrast to the A* method, the approach might be slower for bigger networks and
requirements that the graphs have positive weights. Despite these limitations, Dijkstra's
Algorithm is often used and has been shown to be successful in resolving optimization issues
involving shortest distance between two points.
IV.2. Suggestion
We hope that this paper will be useful, especially when applying Dijkstra's method to
daily issues of locating the best routes or pathfinding (in this case, finding the closest one).
To increase productivity and cut expenses, it is advised to use this algorithm in a variety of
fields such as network optimization and navigation systems.
16
BIBLIOGRAPHY
Goyal, A., Mogha, P., Luthra, R., & Sangwan, N. (2014). PATH FINDING: A* OR
DIJKSTRA’S? . IJITE.
JetLearn. (2023, 1 26). What Is An Algorithm? Its Uses And Importance In Coding. Retrieved
from JetLearn: https://www.jetlearn.com/blog/algorithm-importance-in-coding
[14/03/2023]
Pyram, J. (2020, 7 18). A Brief History of Algorithms and their Impact on the World.
Retrieved from Medium: https://levelup.gitconnected.com/a-brief-look-at-algorithms-
and-their-impact-on-the-world-2794f8dd70aa [14/03/2023]
Upadhyay, S. (2023, 2 21). What Is An Algorithm? Characteristics, Types and How to write
it. Retrieved from Simplilearn: https://www.simplilearn.com/tutorials/data-structure-
tutorial/what-is-an-algorithm [14/03/2023]
17
APPENDIX
18