25
WELCOME

Algo labpresentation a_group

Embed Size (px)

Citation preview

Page 1: Algo labpresentation a_group

WELCOME

Page 2: Algo labpresentation a_group

ContentsIntroduction

How it works

Algorithm & simulation

Problem discussion

Simulation of problem

Screen shot of Output

Page 3: Algo labpresentation a_group

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

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

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

• 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

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

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

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

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

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

Graph Algorithm

Page 13: Algo labpresentation a_group

Graph Algorithm

Page 14: Algo labpresentation a_group

Graph Algorithm

Page 15: Algo labpresentation a_group

Graph Algorithm

Page 16: Algo labpresentation a_group

Graph Algorithm

Page 17: Algo labpresentation a_group

Graph Algorithm

Page 18: Algo labpresentation a_group

Graph Algorithm

Page 19: Algo labpresentation a_group

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

Implementation Output

Page 21: Algo labpresentation a_group

Implementation Output

Page 22: Algo labpresentation a_group

Implementation Output

Page 23: Algo labpresentation a_group

Implementation Output

Page 24: Algo labpresentation a_group

http://bit.ly/Video-On-BFS

Page 25: Algo labpresentation a_group

[email protected] Twitter.com/HassnainJamil