Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Algo labpresentation a_group

application of dijkstra algorithm

  • Login to see the comments

  • Be the first to like this

Algo labpresentation a_group

  1. 1. WELCOME
  2. 2. Contents Introduction How it works Algorithm & simulation Problem discussion Simulation of problem Screen shot of Output
  3. 3. Presented by Anika Ohab ID:142-15-3568 Abul Hasnath ID:142-15-3532 Umme Habiba ID: 142-15-3677 Shahinur Rahman ID: 142-15-3606
  4. 4. Introduction • Dijkstra's Algorithm derived by a Dutch computer scientist ‘Edsger Dijkstra’ in 1956 and published in 1959. • It’s a graph search algorithm that solves the single-source shortest path problem for a graph with nonnegative edge path costs, producing a shortest path tree. • This algorithm is often used in routing and as a subroutine in other graph algorithms.
  5. 5. How it works ? • This algorithm finds the path with lowest cost (i.e. the shortest path) between that vertex and every other vertex. For example, if the vertices of the graph represent cities and edge path costs represent driving distances between pairs of cities connected by a direct road, Dijkstra's algorithm can be used to find the shortest route between one city and all other cities. • According to this algorithm, to solve a given problem, we need to solve different parts of problems.
  6. 6. • What is shortest path ?  shortest length between two vertices for an unweighted graph:  smallest cost between two vertices for a weighted graph:B D C A E B D C A E 200 60 130 190 450 210 weighted graph unweighted graph Shortest Path Problems
  7. 7. 7 How Dijkstra Works 0     10 1 5 2 s t x y z 2 3 9 7 4 6 0     10 1 5 2 s t x y z 2 3 9 7 4 6 10 5 1. INITIALIZE-SINGLE-SOURCE(V, s) 2. S ←  3. Q ← V[G] 4. while Q   5. do u ← EXTRACT-MIN(Q) 6. S ← S  {u} 7. for each vertex v  Adj[u] 8. do RELAX(u, v, w)
  8. 8. 8 Example 0 10  5  10 1 5 2 s t x y z 2 3 9 7 4 6 8 14 7 0 8 14 5 7 10 1 5 2 s t x y z 2 3 9 7 4 6 13 0 8 13 5 7 10 1 5 2 s t x y z 2 3 9 7 4 6 9 0 8 9 5 7 10 1 5 2 s t x y z 2 3 9 7 4 6
  9. 9. Problem :- Out Computers are connected to global through Internet connection. The internet connection has a lots routers for routing their packet data. Suppose I wants to send a packet to my USA server computer.A router can forward a packet to its destination in a shortest path. So we can program router for finding shortest path for sending data to it’s destination using Dijkstra Algorithm.
  10. 10. Graph Algorithm • In this interconnected ‘Vertex’ we’ll use ‘Dijkstra’s Algorithm’. • To use this algorithm in this network we have to start from a decided vertex and then continue to others.
  11. 11. Simulation Of Our problem So, for the calculation give infinite value to all Vertex. And start with ‘A’ using this table:
  12. 12. Graph Algorithm
  13. 13. Graph Algorithm
  14. 14. Graph Algorithm
  15. 15. Graph Algorithm
  16. 16. Graph Algorithm
  17. 17. Graph Algorithm
  18. 18. Graph Algorithm
  19. 19. Graph Algorithm • So with this ‘Graph Algorithm’ we found our best lowest cost route in this interconnected Vertex. • And the best lowest cost path is given below: A B F C D G • So total cost from ‘A’ to ‘G’ vertex is ‘70’ which is lowest cost from other Vertex.
  20. 20. Implementation Output
  21. 21. Implementation Output
  22. 22. Implementation Output
  23. 23. Implementation Output
  24. 24. http://bit.ly/Video-On-BFS
  25. 25. Hassnainjamil42@gmail.com Twitter.com/HassnainJamil

×