Question: WRITE C++ CODE Use the shortest path algorithm for resource planning Scenario description: This train lunch game has aroused great repercussions since it was held.

WRITE C++ CODE

Use the shortest path algorithm for resource planning

Scenario description: This train lunch game has aroused great repercussions since it was held. A W company has built souvenir shops in various places, where customers can buy goods and exchange games. The latest national competition is about to be held again, so W Enterprise launched a limited edition of souvenirs. As a result, it caused a panic buying trend and made various stores very distressed. The inventory of each branch can be monitored in real-time, so when branch A sells out souvenirs, the clerk of branch A should recommend customers to the nearest store that still has stock to buy. You are now a souvenir project manager. In order to solve this situation, you are responsible for calculating the shortest path between branches to help each branch recommend customers to other branches to buy.

Homework content: 1. The adjacency matrix is recorded in adjacency_matrix.txt, please make your own adjacency_matrix.txt for this matrix, and print the adjacency list on the execution screen. (0 means two points are not connected; 1 means two points are connected) Supplement: After the program is executed, adjacency_matrix.txt should be saved in the same folder (please use a relative path to save). 2. The distance between the point and the point is recorded in distance_matrix.txt, and it should be saved in the same folder after executing the program. (0 means that the two points are not connected; other numbers indicate the distance between the two points) . please make your own distance_matrix.txt 3. Please help each store find the shortest path to other branches using Floyds Shortest Paths Algorithm so that the store staff can input the starting point and ending point on the screen, and print out the recommended shortest path sequence and total path length.

WRITE C++ CODE Use the shortest path algorithm for resource planning Scenario

Scoring criteria: a total of 100 points (1) Correct adjacency_matrix.txt and print adjacency list (20 points) (2) Correct distance_matrix.txt (20 points) (3) Allow users to use Floyds Shortest Paths to print out the path and correct it (40 points) (4) Written report (10 points) (5) Indentation/program readabilityotes (10 points) Example output: 8*8 matrix, the picture shows a part of 4*4 example. In addition, the format of the printout of the execution screen is not limited, but the user experience should be appropriately designed.

description: This train lunch game has aroused great repercussions since it washeld. A W company has built souvenir shops in various places, where

= files; archieves; record

= edit

= form; pattern

= inspect

4 4 5 3 1 1 6 00 3 2 4 1 3 2 5 2 2 5 | adjacency_matrix.txt - (F) (E) (0) 0 1 0 1 1 0 1 0 0 1 0 1 1 1 0 OPOP distance_matrix.txt - (F) (E) (0) V) 2 0 5 2 0 1 0 1 0 5 0 3 0

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 Databases Questions!