Skip to content
Pusat Penelitian, Pengabdian kepada Masyarakat dan Publikasi Internasional
twitter
youtube
instagram
Pusat Penelitian, Pengabdian kepada Masyarakat dan Publikasi Internasional
Call Support 0822-7473-7806
Email Support [email protected]
Location Jl. Kolam No. 1 Medan Estate
  • Beranda
  • Tentang
    • Profil
    • Visi dan Misi
    • Struktur Organisasi
    • Pimpinan Pusat
    • Program Kerja
    • Sasaran, Program Strategis dan IK
  • Berita Kegiatan
  • Layanan & Informasi
    • Aplikasi
      • UMA
        • Penjaminan Mutu
        • Himpunan Aplikasi Online
        • Jurnal Ilmiah Online
        • Repositori UMA
        • Open Access Public Catalog
      • Unit
        • Aplikasi Penelitian & Pengabdian (LIPAN)
        • SWAMP-D
        • SUSITAO
        • SINTA Verifikator
        • BIMA Kemdiktisaintek
    • Arsip Digital
    • Helpdesk
    • Pendanaan
      • Penelitian
        • Penelitian Pendanaan Nasional
        • Penelitian Kerjasama Internasional
      • Pengabdian Kepada Masyarakat
        • PKM Pendanaan Nasional
    • Publikasi
      • Internasional Bereputasi
    • Reviewer Penelitian dan PKM
  • Kerjasama
  • Jadwal Kegiatan

Understanding Dijkstra’s Algorithm: A Pathfinding Powerhouse

Posted on June 3, 2024June 18, 2024 by admin
0

Introduction

Dijkstra’s Algorithm is a fundamental algorithm in computer science, widely used for finding the shortest paths in a graph. Named after its inventor, Dutch computer scientist Edsger W. Dijkstra, the algorithm efficiently solves the single-source shortest path problem for a graph with non-negative edge weights. Its applications span various fields, including network routing, geographical mapping, and robotics.

How Dijkstra’s Algorithm Works

At its core, Dijkstra’s Algorithm operates on a weighted graph, where each edge has a non-negative weight. The algorithm maintains a set of nodes whose shortest distance from the source node is known and iteratively expands this set by choosing the node with the minimum tentative distance.

Here’s a step-by-step breakdown of the algorithm:

1. Initialization:
– Start with a source node. Assign a tentative distance value to every node: set it to zero for the source node and to infinity for all other nodes.
– Mark all nodes as unvisited. Set the source node as the current node.

2. Visit Neighbors:
– For the current node, consider all its unvisited neighbors. Calculate their tentative distances through the current node.
– Compare the newly calculated tentative distance with the current assigned value and assign the smaller one. For example, if the current node \(A\) has a distance of 6 and an edge to a neighbor \(B\) with a weight of 2, the distance to \(B\) through \(A\) will be \(6 + 2 = 8\). If \(B\) previously had a distance greater than 8, update it to 8.

3. Mark as Visited:
– After considering all neighbors of the current node, mark the current node as visited. A visited node will not be checked again.

4. Select the Next Node:
– Select the unvisited node that is marked with the smallest tentative distance and set it as the new current node. Return to step 2.

5. Termination:
– The algorithm terminates when all nodes are visited. The tentative distance to the destination node represents the shortest path from the source node.

Example

Consider a graph with five nodes (A, B, C, D, E) and the following weighted edges:
– A-B: 4
– A-C: 1
– B-D: 1
– C-B: 2
– C-D: 5
– D-E: 3

Using Dijkstra’s Algorithm to find the shortest path from node A to node E:

1. Initialize distances: A=0, B=∞, C=∞, D=∞, E=∞
2. Start at A: Update distances to neighbors B (4) and C (1)
3. Mark A as visited: A=0 (visited), B=4, C=1, D=∞, E=∞
4. Select C (smallest tentative distance): Update B (3) and D (6)
5. Mark C as visited: A=0, B=3, C=1 (visited), D=6, E=∞
6. Select B: Update D (4)
7. Mark B as visited: A=0, B=3 (visited), C=1, D=4, E=∞
8. Select D: Update E (7)
9. Mark D as visited: A=0, B=3, C=1, D=4 (visited), E=7
10. Select E: All nodes are now visited.

The shortest path from A to E is A → C → B → D → E with a total distance of 7.

Applications of Dijkstra’s Algorithm

1. Network Routing:
– Used in routing protocols like OSPF (Open Shortest Path First) to find the shortest path between nodes in an IP network.

2. Geographical Mapping:
– Employed in GPS systems and mapping services to find the shortest route between locations.

3. Robotics:
– Helps in pathfinding for robots, allowing them to navigate efficiently in an environment.

4. Game Development:
– Used in game AI to find the shortest path for characters to navigate the game world.

Advantages and Limitations

Advantages:
– Guarantees the shortest path in graphs with non-negative weights.
– Relatively simple to implement and understand.

Limitations:
– Inefficient for very large graphs due to its time complexity of O(V^2), where V is the number of vertices. This can be improved to O(E + V log V) with priority queues and binary heaps.
– Does not work with graphs containing negative weight edges.

Conclusion

Dijkstra’s Algorithm remains a cornerstone of pathfinding algorithms in computer science. Its ability to efficiently determine the shortest path in various applications makes it indispensable, despite some limitations. Understanding its mechanics and applications provides a solid foundation for tackling more complex problems in graph theory and beyond.

Tags: Digital University, Dosen Terbaik, Green University, Kampus Internasional, Kampus Terakreditasi, Kampus Terbaik, Kampus Unggulan, Mahasiswa Berprestasi, Sustainable University, UMA Keren, UMA Terbaik, Universitas Swasta, Universitas Terbaik

Berita Terbaru
UMA Kukuhkan Posisi sebagai Kampus Swasta Terbaik di Sumut Versi SJR
Universitas Medan Area kembali mencatatkan pencapaian membanggakan di tingkat nasional dengan meraih predikat sebagai perguruan tinggi swasta terbaik di Sumatera...
UMA Terima Kunjungan STIE Graha Kirana: Perkuat Kolaborasi Tridharma dan Pengelolaan HKI
Medan, 24 April 2026 — Universitas Medan Area (UMA) menerima kunjungan akademik dari Sekolah Tinggi Ilmu Ekonomi (STIE) Graha Kirana...
KAMPUS I
Jalan Kolam Nomor 1 Medan Estate / Jalan Gedung PBSI, Medan 20223
(061) 7360168 CALL CENTER : 0811-6013-888
[email protected]
KAMPUS II
Jalan Sei Serayu No. 70 A / Jalan Setia Budi No. 79 B, Medan 20112
(061) 42402994
[email protected]

Statistik Pengunjung

  • 0
  • 67
  • 63
  • 22,752
  • 24,597
@Copyright 2026 BPDI | Universitas Medan Area

This will close in 10 seconds