Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use JAVA to code!! The adjacent matrix is attached above as well, if you cannot read the adjacent matrix here, please right-click it and

image text in transcribedimage text in transcribed

image text in transcribed

Please use JAVA to code!! The adjacent matrix is attached above as well, if you cannot read the adjacent matrix here, please right-click it and download it, it will be clear to view in jpg file. Thanks!

Part B: (10.0 marks) You are engaged to develop an application that helps a manager to determine the shortest route a delivery vehicle needs to use between cities. Having studied CSC1203 - Data Structure and Algorithms, you recognize that this is an application for Dijkstra's shortest path algorithm. To prepare for your proposal you decide to implement it on your computer. The requirements are listed below. Note that marks are also awarded for presentation of your program output. Requirement 1 - Representation of the map in Figure 1 Represent the city-distance information shown in the map in Figure 1 with a weighted graph using adjacency matrix or Imk-list. Sembawang Woodlands 5 9 5 OD Choa Chu Kang 14 15 18 22 5 Mndal 3 Punggol Nee Soon 11/15 16 6 16 Sakit Ang Mo Kio 18 16 Changi panjang 7 5 6 18 8 Serangoon 12 5 Ajoper 6/ 11 Thomson 16 Tampines Bukit Fimet 5 ki 25 5 9 10 10 Nga Payoh 16. Bedok Marina Bay Queenstown 16 Pasir 5 Panjang Outram 10 8 Bukit 6 Batak 15 16 19 226 5 19 Jurong el Vo, Clement 5 5 8 6 Soniusa Figure 1 Requirement 2 - Implementation Write an mteractive program that given the start and destination cities, will determine the shortest route between them and its total distance. It is all right to have 0 distance; ie., start and end at the same city. You can assume that the roads are all bi-direction; ie., vehicle can travel in both directions. The output of your program may look something similar as follow: Start from: Changi To: Choa Chu Kang Path: Changi -> Toa Payoh -> Bukit Timah -> Bukit Batok -> Choa Chu Kang Total distance: 39 Km Requirement 3 - Test run Test your program by determining the following routes: Changi to Choa Chu Kang Bedok to Bukit Batok Marma Bay to Woodlands . Sembawang to Bukit Timah Upper Thomson to Outram Bukit Batok to Tampines Requirement 4 - Program Complexity Derive the program running time complexity of your algorithm using Big-O notation. State clearly how you arrive at the Big-O notation. Partial marks will be awarded only for stating without showing the work in arriving at your conclusion. A D 1 Bedok E 2 Bukit Batok 18 F 3 Bukit Panjang 16 G 4 Bukit Timah H 5 Clement 1 1 6 Changi J 7 Choa Chu Kand 8 Jurong L 9 Mandai M 10 Marina Bay N 11 Nee Soon 6 O 12 Outram 60 16 P 13 Pasir Panjang Q 14 Punggol R 15 Queenstown S 16 Sembaw ang T 17 Sentosa 18 Serangoon 6 V 19 Tampines W 20 Toa Payoh 21 Tuas Y Z 22 23 Upper Thomsor Woodlands 5 16 20 DO 50 20 BC DO 1 2 2 3 4 5 6 7 DO DO DO 50 . C 16 DO 50 20 DC 5 DO 19 20 0 be 29 es DO DO es 50 6 4 22 5 6 .. 5 co 7 ce 5 13 20 ce be 16 ce 50 29 16 20 BG os -- 7 5 7 7 DS 6 DS 00 ES 22 30 50 30 DO 25 DS ce DS 7 0 DO 20 SC 15 -- ce 20 10 9 5 14 11 50 DO co 50 O be BS 50 DO DC BC BE 20 all 11 co 50 00 11 DO DO 20 DS 5 DS 16 be co BE 15 19 18 50 50 20 BG BE 50 BC DO BC be 20 6 19 4 be 15 DS 30 22 22 20 DO be be 20 25 60 20 20 ce 6 DO ce ce ES be 3 ce -- ce 2 50 BC DC 50 LE 20 B Index 0 To 1 From Ang Mo Kio Ang Mo Kio Bedok Bukit Batok 18 Bukit Panjang 16 Bukit Timah Clementi Changi Choa ChuKing Jurong es Mandai Marina Bay -- Nee Soon 6 Outram Pasir Panjang Punggol Queenstown Sembawang es Sentosa Serangoon 6 Tampines Toa Payoh . Tuas Upper Thomsor 5 Woodlands 0 be 20 3 es co SC ce 20 . BE 29 BE be 20 29 Index 0 1 2 3 4 5 6 7 8 9 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 be 10 E 8 es 9 os 50 BC DO ce SS 50 DS 16 ce 16 C co 16 20 20 DS 20 BE BE be 20 . 5 6 2 be be es 5. . DO es DO on & & & IN 6 8 8 . DO be C es 7 8 8 8 SC DO C DC be es 50 20 50 BE DO DC be 20 BE DO DO ES BC ce De 6 DC DS 8 be DO . 50 20 10 * * * * * * * * * * * * * DO DC BE 9 5. 30 DO DC 5 2 DO 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 DO DS BC be ce BE SS 30 De 5 10 .. DO BC DO BO 20 6 BC DO DS DO DC be DO 5 DO DO be DO 30 DO DC PA 6 8 30 10 DO DC SC 9 9 20 29 6 15 30 50 8 DO DC be DO BE . DO es DC DO DS es 12 DS DO 8 50 DO DO cs 16 5 18 20 DO DC DE DO DC ce es 12 6 5 13 30 es 10 BC be BE 10 BC 8 DO 9 es BC 15 BE 6 DO DO DC BS 16 es 09 ce 15 19 DC DO DC ce 30 BC DO es DO BE 30 ES 16 11 BE DS DO DO BC DO DO DO 10 20 8 14 11 DS 60 5. be SC 6 es DO DO DO 30 11 DO 8 DS 9 DO 50 co BC

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago