Graph Theory - Dijkstra Algorithm (Arabic)

Поділитися
Вставка
  • Опубліковано 29 гру 2024

КОМЕНТАРІ • 22

  • @abdelrhman_sasalh3522
    @abdelrhman_sasalh3522 4 роки тому +1

    how do i add the value in "adjMax" that we are supposed to use "vector" not -> "vector adjMax". min 13:52

  • @fadysamy1542
    @fadysamy1542 4 роки тому

    Can you write the equality which used to calculate order of Dijkstra2() ,which is O(Elog V)?

    • @ArabicCompetitiveProgramming
      @ArabicCompetitiveProgramming  4 роки тому +2

      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

  • @zaidrj7374
    @zaidrj7374 3 роки тому

    أنا بستخدم جافا بالبرمجة , لكن مع ذلك بفهم الفكرة الأساسية منك بطريقة تمكني من الاستغناء عن فهم الكود بال C++ بشكل جزئي ,سواء بهاد الدرس أو بغيره, من قلبي بحب أقلك الله يجزيك الخير.

  • @hossamahmed4936
    @hossamahmed4936 Рік тому

    Good explanation but your code works on -ve edges also not as you said in the start of the video

  • @yahyaadel6933
    @yahyaadel6933 4 роки тому

    Dropbox link is 404 , is there any update on the content hosting ?

  • @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 років тому +1

      +aya saber
      intialize whole array with some flag (say 10000000)
      read each line
      then
      adj[src][dest] = weight

  • @MsAmrsamy
    @MsAmrsamy 5 років тому

    what about if there are many shortest path from source to destination, how can i get them all?

  • @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 ;)))

  • @mohamedhany9561
    @mohamedhany9561 5 років тому

    Good work\

  • @moazeldfrawy7733
    @moazeldfrawy7733 10 років тому

    thanks a lot