2. Course Teacher:
Nasrin Hakim Mithila
Lecturer
Dept. of Computer Science and Engineering(CSE)
Faculty of Science & Information Technology (FSIT)
Daffodil International University
2
3. Our Group Name: Silent Hunter
Members:
1. Syed Ahmed Zaki (ID:131-15-2169)
2. Md. Sazzad Hossain (ID:131-15-2368)
3
4. Our Topic
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.
4
5. Input
Input
The 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).
5
6. Output
Output
For 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.
6
8. Input:
Graphical Representation
N // N = Test Case Number
n 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
8
9. Graphical Representation
Case #1:
1 0
w=100
m
S T
w=100
Case #2: 0 1
S
m T
2
Case # 3: unreachable
Output:
0
0 1
S
0
T
9
10. Algorithm
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.
10
14. Future Plan
We have a plan to make it more frequently and user
friendly.
And will make available this code for open source
community.
14
15. Bug/Error/Limitations
We have to use here delimiter “[]+” in Java’s built in
input/output system in BufferedReader
throwsException() function to avoid unexpected
integer or string error.
We will fix this bug in future version .
15
16. 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