Question: Please use Python. Thanks!!! Implement an algorithm for the Connected Components Problem for undirected graphs. The algorithm should take as input an undirected graph, and
Please use Python. Thanks!!!
Implement an algorithm for the Connected Components Problem for undirected graphs. The algorithm should take as input an undirected graph, and identify the connected components. The vertices should be labeled by which component they belong to. If there are d connected components, you should name the components 1, 2, ..., d. You will need to determine the size of each connected component. Using the random graph generator from problem 4, experiment with the the connected component structure of random graphs. For a fixed n, look at what happens as you vary the value of p. You should use a moderately large value of n, at least n = 1,000 or even n = 10,000. (You should not choose an n so large that it takes a long time to generate the graphs, or you run into into overflow issues.) The two outputs that will be interesting to look at are the number of connected components and the size of the connected components. The "interesting" values of p will be small, for example, with n = 10,000 the range of interest for p is 0.0002
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
