algorithm presentation
TRANSCRIPT
Welcome ToOur Presentation
Course:CSE 221/222 Summer 2014
1
Course Teacher:
Nasrin Hakim MithilaLecturerDept. of Computer Science and Engineering(CSE)Faculty of Science & Information Technology (FSIT)Daffodil International University
2
Members:
1. Syed Ahmed Zaki (ID:131-15-2169)
2. Md. Sazzad Hossain (ID:131-15-2368)
Our Group Name: Silent Hunter
3
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
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
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
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
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
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
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
Dijkstra Algorithm
11
Eclipse View
Code:
12
UVA Submission
13
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
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
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