algorithm presentation

16

Click here to load reader

Upload: syed-ahmed-zaki

Post on 20-Jul-2015

175 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Algorithm Presentation

Welcome ToOur Presentation

Course:CSE 221/222 Summer 2014

1

Page 2: Algorithm Presentation

Course Teacher:

Nasrin Hakim MithilaLecturerDept. of Computer Science and Engineering(CSE)Faculty of Science & Information Technology (FSIT)Daffodil International University

2

Page 3: Algorithm Presentation

Members:

1. Syed Ahmed Zaki (ID:131-15-2169)

2. Md. Sazzad Hossain (ID:131-15-2368)

Our Group Name: Silent Hunter

3

Page 4: Algorithm Presentation

Project No. 1 in the project list

Question:There are n SMTP servers connected by network cables. Each of the m cables connects two computers and has a certain latency measured in milliseconds required to send an email message. What is the shortest time required to send a message from server S to server T along a sequence of cables? Assume that there is no delay incurred at any of the servers.

Our Topic

4

Page 5: Algorithm Presentation

InputThe first line of input gives the number of cases, N. N test cases follow. Each one starts with a line containing n(2<=n<20000), m (0<=m<50000), S (0<=S<n) and T(0<=T<n). S!=T. The next m lines will each contain 3 integers: 2 different servers (in the range [0, n-1]) that are connected by a bidirectional cable and the latency, w, along this cable (0<=w<=10000).

Input

5

Page 6: Algorithm Presentation

OutputFor each test case, output the line "Case #x:" followed by the number of milliseconds required to send a message from S to T. Print "unreachable" if there is no route from S to T.

Output

6

Page 7: Algorithm Presentation

Sample Input Sample Output

3

2 1 0 1

0 1 100

3 3 2 0

0 1 100

0 2 200

1 2 50

2 0 0 1

Case #1: 100

Case #2: 150

Case #3: unreachable

In console method representation

7

Page 8: Algorithm Presentation

Input:

N // N = Test Case Numbern m S T int int w

//n =SMTP servers on the network (2<=n<20000), m=cables connects two computers(0<=m<50000), S=Source server (0<=S<n) , T=Target Server (0<=T<n) (where S!=T)

//int=integer value, int=integer value, w=latency/weight of the bidirectional cable

Graphical Representation

8

Page 9: Algorithm Presentation

Case #1:

Graphical Representation

01w=100

S Tm

Case #2: 0 1w=100

S

Tm

2

Case # 3: unreachable

Output:

0

S

0

T

0 1

9

Page 10: Algorithm Presentation

As from the input description we have found that we have to iterate through all vertex but in minimum shortest path from one source.So that We have used Dijkstra algorithm here.As Dijkstra algorithm is single source shortest path algorithm.

Algorithm

10

Page 11: Algorithm Presentation

Dijkstra Algorithm

11

Page 12: Algorithm Presentation

Eclipse View

Code:

12

Page 13: Algorithm Presentation

UVA Submission

13

Page 14: Algorithm Presentation

We have a plan to make it more frequently and user friendly.

And will make available this code for open source community.

Future Plan

14

Page 15: Algorithm Presentation

We have to use here delimiter “[]+” in Java’s built in input/output system in BufferedReaderthrowsException() function to avoid unexpected integer or string error.

We will fix this bug in future version .

Bug/Error/Limitations

15

Page 16: Algorithm Presentation

Implementing and focusing on the code was our main objective and we tried our best.

Thank you Mam for staying with us.

Thank you all.

Conclusion

16