makeset()definition:
makeset() generates singleton collections holding all value of the parameter argument. Its meaning of makeset may be found on page 132 of something like the textbook () .
union()definition:
To join the sets involving two outcomes for passing arguments, utilize union(). This definition term union may be stated on page 133 of both the textbook () .
find()definition:
find() is often used to explore each combination to nodes on until necessary sets are found. The definition of discover may be found on page 132 of the textbook() .
Explanation:
While in thinnest spanning tree method described previously,• Construct the graph with the vertex and edge .
• Obtain the minimal spanning tree for just a graph using the Kruskal's approach..
• Where there is no minimal spanning tree, then thinnest spanning tree can indeed be built..
• Generate any edge collection inside the name of the smallest spanning tree if one exists .
• Using for each read all the vertices “U”.
• Using the function make set() sort the weight of the edges.
Using for loop read the order of weight in increasing order.
• Using if condition, check whether find of vertex“u” is not equal to find of vertex“v”.
• If the above condition is true, then add edges to the tree.
• Invoke the union() function by passing the vertex u and v.
• Otherwise, exit the loop.
Finally, return the constructed tree .