Introduction - If you have any usage issues, please Google them yourself
Using the undirected network to represent the campus map of the campus, the vertices in the map represent the main attractions, the number, name and profile of the scenic spots, etc.
The edge of the diagram shows the road between the scenic spots, storing the length of the path and so on. Request to be able to answer questions about scenic spot introduction, tour path and so on. swim
Visitors can be asked through the terminal:
(1) the shortest path from one scenic spot to another. (shortest path problem)
(2) visitors enter from the park and select the best route.
(3) make it possible for visitors to browse the scenic spots and return to the exit (the exit is next to the entrance).
[basic requirements]
(1) view the guide map as an undirected graph with power. The vertices represent the scenic spots of the park, and the road between each scenic spot is expressed as the right value of the edge
That's the distance. Select the appropriate data structure for this diagram.
(2) display all kinds of paths to tourists, and tourists choose to browse the route by themselves.
(3) draw the map of the scenic spots on the screen.
[implementation tips]
(1) construct an undirected graph and use adjacency matrix to store it.
(2) using the dijstra algorithm to calculate the shortest path between the starting point and each vertex in the two dimensional array p [I] [], the shortest path length
D [I] is used to store the degree. Range of I: 0 ~ 20.
(3) one-dimensional array have[] is used to record the order of vertex of shortest path.
(4) output shortest path and path length according to starting point and destination.
Packet : 61549827xiaoyuan.rar filelist
校园导游咨询.doc