Question: Write a c + + program to find the shortest route in an airline network from a given start city to a given destination city

Write a c++ program to find the shortest route in an airline network from a given start city to a given destination city using Depth First Search.
Should be three files: airline.h, airline.cpp and airlineMain.cpp
An unweighted digraph represented by its adjacency list is used for the network, and the information needed to construct is below.
Network file content:
Los_Angeles
3346
San_Francisco
3134
Denver
3127
Chicago
238
Boston
246
New_York
3478
Miami
3835
New_Orleans
217
The order of cities are arranged from LA(1), SAN(2), DEN(3), CHI(4), BOS(5), NYK(6), MIA(7), NOL(8).First digit is the number of out-degrees; other digits are the destinations of out-degrees.
Example: New Orleans -217: New Orleans connects to LA (1) and MIA (7).
Sample Output with airline map
Number of start city? 1
Number of destination? 2
Shortest path from Los Angeles to San Francisco is:
1 Los_Angeles
|
v
3 Denver
I
v
2 San_Francisco
More (Y or N)?Y
Number of start city? 6
Number of destination? 4
Shortest path from New York to Chicago is:
6 New_York
I
v
4 Chicago
More (Y or N)?y
Write a c + + program to find the shortest route

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!