Graph Theory - Dijkstra Algorithm (Arabic)

  Рет қаралды 22,638

Arabic Competitive Programming

Arabic Competitive Programming

Күн бұрын

Content Link: www.dropbox.co...
Content:
Shortest Paths Facts
Relaxation
Dijkstra Proof
O(V^2) Algorithm for Adjacency Matrix
O(E logV) Algorithm for Adjacency List
Problems: UVA(429, 762, 10113, 10436, 10525, 10801, 10947, 10959, 10986)

Пікірлер: 22
@zaidrj7374
@zaidrj7374 3 жыл бұрын
أنا بستخدم جافا بالبرمجة , لكن مع ذلك بفهم الفكرة الأساسية منك بطريقة تمكني من الاستغناء عن فهم الكود بال C++ بشكل جزئي ,سواء بهاد الدرس أو بغيره, من قلبي بحب أقلك الله يجزيك الخير.
@abdelrhman_sasalh3522
@abdelrhman_sasalh3522 4 жыл бұрын
how do i add the value in "adjMax" that we are supposed to use "vector" not -> "vector adjMax". min 13:52
@ArabicCompetitiveProgramming
@ArabicCompetitiveProgramming 4 жыл бұрын
a[i][j] = make_pair(2, 3);
@prodev7401
@prodev7401 9 жыл бұрын
NOTE : in some graph work with négative weight but not every time ;)
@ArabicCompetitiveProgramming
@ArabicCompetitiveProgramming 9 жыл бұрын
True, but they are very little graphs...specifically when the a path through negative edge doesn't yield shorter road, probably Dijsktra will work.
@prodev7401
@prodev7401 9 жыл бұрын
because my freinds At the university they said it's impossible :D the problem in the relaxation STEP that's why bellman-ford works because every time relax ALL edges
@ArabicCompetitiveProgramming
@ArabicCompetitiveProgramming 9 жыл бұрын
Pro Dev Graph (1, 2, 10), (2, 3, -100), (3, 4, 7) => Dijkstra works
@prodev7401
@prodev7401 9 жыл бұрын
yes i know thanks ;)))
@hossamahmed4936
@hossamahmed4936 Жыл бұрын
Good explanation but your code works on -ve edges also not as you said in the start of the video
@ArabicCompetitiveProgramming
@ArabicCompetitiveProgramming Жыл бұрын
no
@ayasaber2567
@ayasaber2567 8 жыл бұрын
Good work MSA but i have an question : what does "adjMax" Specifically contain ?
@ArabicCompetitiveProgramming
@ArabicCompetitiveProgramming 8 жыл бұрын
+aya saber Adjacency Matrix Representation en.wikipedia.org/wiki/Adjacency_matrix
@ayasaber2567
@ayasaber2567 8 жыл бұрын
+Arabic Competitive Programming if i have file contains many lines , each line formed ->>"source node , destination node , weight" how i can fill -> adjMax, dist , in code?
@ArabicCompetitiveProgramming
@ArabicCompetitiveProgramming 8 жыл бұрын
+aya saber intialize whole array with some flag (say 10000000) read each line then adj[src][dest] = weight
@fadysamy1542
@fadysamy1542 4 жыл бұрын
Can you write the equality which used to calculate order of Dijkstra2() ,which is O(Elog V)?
@ArabicCompetitiveProgramming
@ArabicCompetitiveProgramming 4 жыл бұрын
As I remember, we iterate on all edges and push them in the queue (each edge processed twice). This is ElogE In worst case, E=V^2. Log(E) = 2LogV = LogV so we write it ELogV consider also, we iterate on every node once. Total is O(ElogV + V), for shor O(Elogv) other implementations will have different implementations
@MsAmrsamy
@MsAmrsamy 5 жыл бұрын
what about if there are many shortest path from source to destination, how can i get them all?
@ArabicCompetitiveProgramming
@ArabicCompetitiveProgramming 5 жыл бұрын
en.wikipedia.org/wiki/K_shortest_path_routing
@yahyaadel6933
@yahyaadel6933 3 жыл бұрын
Dropbox link is 404 , is there any update on the content hosting ?
@ArabicCompetitiveProgramming
@ArabicCompetitiveProgramming 3 жыл бұрын
Find github link from channel about
@mohamedhany9561
@mohamedhany9561 4 жыл бұрын
Good work\
@moazeldfrawy7733
@moazeldfrawy7733 10 жыл бұрын
thanks a lot
Graph Theory - Prim Algorithm (Arabic)
19:17
Arabic Competitive Programming
Рет қаралды 17 М.
Graph Theory - BFS (Arabic)
15:43
Arabic Competitive Programming
Рет қаралды 30 М.
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 62 МЛН
когда не обедаешь в школе // EVA mash
00:51
EVA mash
Рет қаралды 3,9 МЛН
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
Dijkstra's Shortest Path Algorithm | Graph Theory
24:47
WilliamFiset
Рет қаралды 205 М.
How Dijkstra's Algorithm Works
8:31
Spanning Tree
Рет қаралды 1,3 МЛН
Dijkstra's Algorithm - Computerphile
10:43
Computerphile
Рет қаралды 1,3 МЛН
A* (A Star) Search Algorithm - Computerphile
14:04
Computerphile
Рет қаралды 1,1 МЛН
Graph Theory - Kruskal Algorithm [Disjoint Set] (Arabic)
22:14
Arabic Competitive Programming
Рет қаралды 14 М.
Graph Theory - DFS (Arabic)
23:24
Arabic Competitive Programming
Рет қаралды 53 М.
Introduction to Graph Theory: A Computer Science Perspective
16:26
Topological Sort Algorithm | Graph Theory
14:09
WilliamFiset
Рет қаралды 460 М.
3.6 Dijkstra Algorithm - Single Source Shortest Path - Greedy Method
18:35
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 62 МЛН