weighted graphs table edge pruning step number list unpruned edge list pruned edge (in priority queueduplicate removed from priority queue ab ad de dc db ab de bc dc be bc dc ef ec ef cf ab ad de dc ab dc be ef ec cf db (ab de (be )bc (dc bc (ec )dc (ec ef remember that an edge consists of letter for the source (startingvertex of the edgea letter for the destination (ending vertex)and number for the weight the second column in this table corresponds to the lists you kept when constructing the cable tv system it shows all edges from category vertices (those in the treeto category vertices (those with at least one known edge from category vertexthe third column is what you see in the priority queue when you run the graphw applet any edge with the same destination vertex as another edgeand which has greater weighthas been removed the fourth column shows the edges that have been removed andin parenthesesthe edge with the smaller weight that superseded it and remains in the queue remember that as you go from step to step the last entry on the list is always removed because this edge is added to the tree looking for duplicates in the priority queue how do we make sure there is only one edge per category vertexeach time we add an edge to the queuewe make sure there' no other edge going to the same destination if there iswe keep only the one with the smallest weight this necessitates looking through the priority queue item by itemto see if there' such duplicate edge priority queues are not designed for random accessso this is not an efficient activity howeverviolating the spirit of the priority queue is necessary in this situation java code the method that creates the minimum spanning tree for weighted graphmstw()follows the algorithm outlined earlier as in our other graph programsit assumes there' list of vertices in vertexlist[]and that it will start with the vertex at index the currentvert variable represents the vertex most recently added to the tree here' the code for mstw()