A pipeline is to be built that will link six cities. The cost (in hundreds of millions of dollars) of constructing each potential link depends on distance and terrain and is shown in the weighted graph below. Find a system of pipelines to connect all the cities and yet minimize the total cost.
Find a system of pipelines to connect all the cities and yet minimize the total cost.
Given info:
A pipeline is to be built that will link six cities. The cost (in hundreds of millions of dollars) of constructing each potential link depends on distance and terrain and is shown in the weighted graph below:
Calculation:
Kruskal’s algorithm:
First iteration: The edge with the smallest weight is the edge between Cheyenne and Denver with weight 0.8, thus we add the edge
Added edge =
Second iteration: The edge with the smallest weight is the edge between Amarillo and Albuquerque with weight 1.1, thus we add the edge
Added edge =
Third iteration: The edge with the smallest weight is the edge between Phoenix and Albuquerque with weight 1.2, thus we add the edge
Added edge =
Fourth iteration: The edge with the smallest weight is the edge between Cheyenne and Salt Lake City with weight 1