Question: C + + AND PLEASE ADD COMMENTS IN THE CODE, THANKS! Objectives: Find the shortest path in the Airline Network program using DFS algorithm An
C AND PLEASE ADD COMMENTS IN THE CODE, THANKS!
Objectives: Find the shortest path in the Airline Network program using DFS algorithm
An unweighted digraph represented by its adjacency list is used for the network, and the information needed to construct is read from a network file.
Network file content:
LosAngeles
SanFrancisco
Denver
Chicago
Boston
NewYork
Miami
NewOrleans
Network file details
The order of cities are arranged from LA SAN DEN CHI BOS NYK MIA NOL
First digit is the number of outdegrees; other digits are the destinations of outdegrees.
Sample outputAirline Map
Enter name of network file: c:
etworkfile.txt
The Digraph's AdjacencyList Representation:
: LosAngeles
: SanFrancisco
: Denver
: Chicago
: Boston
: NewYork
: Miami
: NewOrleans
Number of start city?
Number of destination?
Shortest path from Los Angeles to San Francisco is:
LosAngeles
v
Denver
v
SanFrancisco
More Y or NY
Number of start city?
Number of destination?
Shortest path from New York to Chicago is:
NewYork
v
Chicago
More Y or Ny
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
