How can I convert

Can anyone pls tell me how to convert the graph to a graph with minium edge as parent???

sorry it would be minimum vertex not edge…

Hey @soumakpoddar55
You just need to find connected components in graph
In your code start finding if a node is visited from 1 to N
The node which is unvisited from which you start dfs for a new component will always be minimum vertex of component