Using prim minimum spanning tree to see Wuhan's central position

Wuhan is known as the thoroughfare of nine provinces and is a national or even global transportation hub. Then, let's use the prim minimum spanning tree to test Wuhan's central position.

The so-called minimum spanning tree, given n points, connect these points with n-1 edges to form a spanning tree, and to minimize the sum of the distances (weights) of these n-1 edges, It is the minimum spanning tree.

The algorithm of the minimum spanning tree, the most common are the prim algorithm and the Kruskal algorithm. The prim algorithm first selects the first point, and then takes the shortest side connecting this point. At this time, there are two selected points, and then Then select the shortest side connecting these two points from the remaining sides, and so on. The Kruskal algorithm first selects the shortest edge, then selects the second short edge, and so on, until all nodes can be visited. In a nutshell, the former uses points to select edges, while the latter uses edges to select points.

We first selected 36 large cities across the country for the experiment, and the final result is shown in the figure below.
Insert picture description here

Judging from the above picture, Wuhan is at the center of Central China, and it has close ties with East China, North China and Northwest China, and it is not far away from South China.

Then we used four hundred cities across the country to do repeated experiments and found some changes in the shape, but the conclusions were basically the same. The ones that are more closely related to Wuhan are East China, North China, South China, Northwest China, and Southwest China. It's less.
Insert picture description here

Guess you like

Origin blog.csdn.net/esa72ya/article/details/105211160