algo labpresentation a_group
TRANSCRIPT
![Page 1: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/1.jpg)
WELCOME
![Page 2: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/2.jpg)
ContentsIntroduction
How it works
Algorithm & simulation
Problem discussion
Simulation of problem
Screen shot of Output
![Page 3: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/3.jpg)
Presented by
Anika OhabID:142-15-3568
Abul HasnathID:142-15-3532
Umme HabibaID: 142-15-3677
Shahinur Rahman ID: 142-15-3606
![Page 4: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/4.jpg)
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.
![Page 5: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/5.jpg)
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.
![Page 6: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/6.jpg)
• 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
190450
210
weighted graph
unweighted graph
\
Shortest Path Problems
![Page 7: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/7.jpg)
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)
![Page 8: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/8.jpg)
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
![Page 9: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/9.jpg)
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.
![Page 10: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/10.jpg)
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.
![Page 11: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/11.jpg)
Simulation Of Our problemSo, for the calculation give infinite value to all Vertex. And start with ‘A’ using this table:
![Page 12: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/12.jpg)
Graph Algorithm
![Page 13: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/13.jpg)
Graph Algorithm
![Page 14: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/14.jpg)
Graph Algorithm
![Page 15: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/15.jpg)
Graph Algorithm
![Page 16: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/16.jpg)
Graph Algorithm
![Page 17: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/17.jpg)
Graph Algorithm
![Page 18: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/18.jpg)
Graph Algorithm
![Page 19: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/19.jpg)
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.
![Page 20: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/20.jpg)
Implementation Output
![Page 21: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/21.jpg)
Implementation Output
![Page 22: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/22.jpg)
Implementation Output
![Page 23: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/23.jpg)
Implementation Output
![Page 24: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/24.jpg)
http://bit.ly/Video-On-BFS
![Page 25: Algo labpresentation a_group](https://reader035.vdocuments.net/reader035/viewer/2022081514/58d140241a28ab455d8b59c1/html5/thumbnails/25.jpg)
[email protected] Twitter.com/HassnainJamil