weighted graphs building the erizo-colina link from erizo the surveyors report back costs of million dollars to colina and to flor the danza-erizo link from the previous list must be removed because erizo is now connected town your new list is erizo-colina$ million erizo-flor$ million danza-colina$ million bordo-colina$ million the cheapest of these links is erizo-colinaso you build this link and install an office in colina andfinallythe colina-flor link the choices are narrowing after you remove already-linked townsyour list now shows only colina-flor$ million erizo-flor$ million you install the last link of cable from colina to florbuild an office in florand you're done you know you're done because there' now an office in every town you've constructed the cable route ajo-danzaajo-bordobordo-erizoerizo-colinaand colina-floras shown earlier in figure this is the cheapest possible route linking the six towns of magnaguena creating the algorithm using the somewhat fanciful idea of installing cable tv systemwe've shown the main ideas behind the minimum spanning tree for weighted graphs now let' see how we' go about creating the algorithm for this process the priority queue the key activity in carrying out the algorithmas described in the cable tv examplewas maintaining list of the costs of links between pairs of cities we decided where to build the next link by selecting the minimum of these costs list in which we repeatedly select the minimum value suggests priority queue as an appropriate data structureand in fact this turns out to be an efficient way to handle the minimum spanning tree problem instead of list or arraywe use