Question: have a direct connection ( be friends ) , the lowest cost path may take a different route. Here, Umar and Lema have a direct

have a direct connection (be friends), the lowest cost path may take a different route. Here, Umar and Lema have a direct connection of weight 7, but the lowest cost path is weight 4 and traverses 4 nodes.
```
Enter the starting name (x to quit): Umar
Enter the ending name (}\textrm{x}\mathrm{ to quit): Lema
The best path between these two people is:
Umar
Saim Shah Hamdani
Arwen
Sara
Lema
The cost of this path is: 4
Enter the starting name (}\textrm{x}\mathrm{ to quit): Tommy
Enter the ending name (}\textrm{x}\mathrm{ to quit): Amir
The best path between these two people is:
Tommy
Mohsin Khan
Dennis
Umar Patek
Amir
The cost of this path is: 5
Enter the starting name (}\textrm{x}\mathrm{ to quit): Gabriel
Enter the ending name (x to quit): Varga Melinda
There is NOT a path between these two people.
Enter the starting name (}\textrm{x}\mathrm{ to quit): x
Exiting...
```
have a direct connection ( be friends ) , the

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!