Shortest Path | Dijkstra's Algorithm Explained and Implemented in Java | Graph Theory | Geekific

preview_player
Показать описание

Finding the shortest path between two vertices of a given graph is a classic yet a fundamental theoretic problem known in graph theory. Dijkstra's Algorithm is one of the many algorithms out there that addresses this problem, and the subject of today’s video.

Timestamps:
00:00 Introduction
00:40 Dijkstra's Algorithm Explained
04:04 Dijkstra's Algorithm Implemented
06:40 Putting our Code to the Test
07:24 Thanks for Watching!

If you found this video helpful, check other Geekific uploads:

#Geekific #Dijkstra #ShortestPath #GraphTheory
Рекомендации по теме
Комментарии
Автор

Love author's distinct pronunciation👍🏼 He definitely thought about audience.

And yes: material got really clear only in code. The gist is not a rocket sience but all mechanics comes in code.

manOfPlanetEarth
Автор

I need the code of it, from the given link of Github - it is difficult to get the correct code. Can u please provide it

anjaliverma
Автор

Awesome explanations, how come youtube algorithm do not suggest this?

vietnguyenquoc
Автор

Amazing Content !!! How did you get your fundamentals so right at java, if there's a book I would like to know about it!

samarthtandale
Автор

Hi, man again:)))
Doing this algo with pen and paper I revealed some point for discussion. At some moment, especially for more connected graphs, both settled and unsettled collections begin to contain the same nodes☝🏼 Moreover, unsettled collection starts containing multiple duplicates of that same nodes.

Yes, your realization still works right but all above brings some meaning disruption (especially simultaneous presence of some node in both collections opposite in their calling) and as for me I came up with two options to fix that.

1. Use TreeSet structure for unsettled list (then use pollFirst() method)

2. Do check:
if(!

Your thoughts?:)

manOfPlanetEarth
Автор

5:20
Any reason you use Collections.singleton(source) instead of Set.of(source)?🤔

manOfPlanetEarth
Автор

I can't use the toList() method on my Stream :/, do you know any solution to that?

AvgABC
Автор

Hi! First of all, many thanks for the video, it's enormously helpful. I'm using this as a blueprint for my college assignment. However, I've got to write it in C# and I'm not that good in Java so could you please explain, how could I write this while loop in the calculateShortestPath method without using streams (can be still in Java)? Or at least how could I replace the .filter line when I'm not using stream?

SabbraCadabra
Автор

Can you add from where you left off by reading from a CSV file and calculate the shortest path please

zukisamaliwa
Автор

1:11
"any sub-path B to D of the shortest path..."

Not "any", but simply "sub-path B to D...", because there is only ONE sub-path for the shortest path.

manOfPlanetEarth
Автор

The code was hard to follow and you didnt give an explanation of how the algorithm is correct. Maybe for an expert who already knows this stuff this video would make sense.

mmm-iews
Автор

Hi thanks for effort It would have been good to add a repo to get the code.
Anyway great effort!

Talaria.School
join shbcf.ru