Question: In this problem you are to find the minimum spanning tree for a graph that consists of 128 cities. The file cities.pdf contains the map
In this problem you are to find the minimum spanning tree for a graph that consists of 128 cities. The file cities.pdf contains the map of the cities. In the graph, each pair of cities is connected by an undirected edge and its weight is given by the number of miles between the two cities. The minimum spanning tree for this graph will represent 127 roads between cities that allow all cities to be connected to each other. There are many such sets of 127 roads (spanning trees); you are to find the set that uses the minimum asphalt (hence, minimum spanning tree).
The complete data set is in the miles.dat file. The format of the data file is as follows: 1. The first four lines are commentary. 2. Each of the 128 cities is represented as: 1. The name of the city (with state), on a separate line. You can ignore everything after the opening brace (those numbers represent latitude, longitude, and maybe population). 2. A series of zero or more lines, that contains the distance, in miles, to each of the previous cities in the list, in the reverse order of those cities. 3. The last line is a comment also. Algorithm: You can use either Prims or Kruskals algorithm. Your output should give the total cost of the minimum spanning tree and then list the (127) edges in the minimum spanning tree, starting with Youngstown, OH. In the following format: Youngstown, OH Yankton, SD Yankton, SD Yakima, WA Yakima, WA - (Note that this example is only for formatting purposes and is not in fact part of the MST) Implementation: Implement your code in C++.
cities.pdf

ReginSA Winnipeg, MB Vancouver, BC Williston, ND Senttle, WA Spokane, WA Taromn, WA Wenatehee, WA Vallay City, ND Ynkimn, WA Walla Wullu, WA Snint Claud, MN Sheridan, WY Saint Pal, MN Wausau, WI Salem, o Watertow, SD TraverM Cily,MI Sliut Julia bury, V' Rochwuter, MN Stevens Point, WI Taranta, ON Watertown, NY Sioux Palla, SD Yankton, SDWuturla IA Wuk Rutland, VT Saglaaw, iI Roehexter IL Wiuconin Dell, WI Twin Falls, ID Syracuse , NY Schenectady. uth Bend, IN Toledo, ON Warren Sandusky, OH. .Worcester, MA Spriogfield, MA Scott t bluf, NB Sioux City, IA ,' Saint Joseph, MI .PA Serantan Weed, CA Rock Spring, WY Waterbury, CT Ae Havenna, oqwn teubenville,OH Sterlins, CO burg, PA Red Bluff, CA nlt T.nke City, UT H Reading, PA Trantan, NI NV Saint Joseph, Mo. Springfield IL Springfield, Terre Haute, I Sacramento, CA 5ulida, CO Winchentef, .Wuhingtan, Dc Santa Roan, CA . San Francisco, CA Richfield, UT neennes,IN Sedalia, MO Saint Laui MO Salisbury, MD Stockton, CA WillinnStaunton, VA Wichita, KS Richmond, VA *San Jos, CA pringfield, MO Salinas, CA Tulea, OK Winston-Snlem, NC Rocky Meunt, NC Santn Fe, NM Seminole, OK Santa Barharn, CA Tupelo, MS Wilminston, NC San Bernardino, CA Wichita Falls, TX Santa Ana, CA Texarkana, TX Tuenloons, A. umter, 50 Shreveport, LA Swain boro, GA San Diego, CA Tylur, TX. Savannah, GA Vick burs, MS Selma AL San Angelo, TX Waso, TX Valdota, GA Saint Augu stine, FL Snn Antanin, TX. Vietoria, TX Tunps, FL Sarasota, FL West Pnlm Beach, FL ReginSA Winnipeg, MB Vancouver, BC Williston, ND Senttle, WA Spokane, WA Taromn, WA Wenatehee, WA Vallay City, ND Ynkimn, WA Walla Wullu, WA Snint Claud, MN Sheridan, WY Saint Pal, MN Wausau, WI Salem, o Watertow, SD TraverM Cily,MI Sliut Julia bury, V' Rochwuter, MN Stevens Point, WI Taranta, ON Watertown, NY Sioux Palla, SD Yankton, SDWuturla IA Wuk Rutland, VT Saglaaw, iI Roehexter IL Wiuconin Dell, WI Twin Falls, ID Syracuse , NY Schenectady. uth Bend, IN Toledo, ON Warren Sandusky, OH. .Worcester, MA Spriogfield, MA Scott t bluf, NB Sioux City, IA ,' Saint Joseph, MI .PA Serantan Weed, CA Rock Spring, WY Waterbury, CT Ae Havenna, oqwn teubenville,OH Sterlins, CO burg, PA Red Bluff, CA nlt T.nke City, UT H Reading, PA Trantan, NI NV Saint Joseph, Mo. Springfield IL Springfield, Terre Haute, I Sacramento, CA 5ulida, CO Winchentef, .Wuhingtan, Dc Santa Roan, CA . San Francisco, CA Richfield, UT neennes,IN Sedalia, MO Saint Laui MO Salisbury, MD Stockton, CA WillinnStaunton, VA Wichita, KS Richmond, VA *San Jos, CA pringfield, MO Salinas, CA Tulea, OK Winston-Snlem, NC Rocky Meunt, NC Santn Fe, NM Seminole, OK Santa Barharn, CA Tupelo, MS Wilminston, NC San Bernardino, CA Wichita Falls, TX Santa Ana, CA Texarkana, TX Tuenloons, A. umter, 50 Shreveport, LA Swain boro, GA San Diego, CA Tylur, TX. Savannah, GA Vick burs, MS Selma AL San Angelo, TX Waso, TX Valdota, GA Saint Augu stine, FL Snn Antanin, TX. Vietoria, TX Tunps, FL Sarasota, FL West Pnlm Beach, FL
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
