Question: 2. Write a program that finds the number of connected components of an unordered graph G and also assigns a component number to each
2. Write a program that finds the number of connected components of an unordered graph G and also assigns a component number to each of its nodes. Assume G is input by its set V of nodes and its set E of 1 (undirected) edges. Test the program using the nodes A, B, C, D, X, Y, Z, S and T and the edges: a. [A,X], [B,T], [Y, C], [S, Z], [D, T], [A, S], [Z, A], [D, B] and [X,S]. b. [Z,C], [D, B], [A, X], [S, C], [D, T], [X, S], [Y, B], [T, B] and [S, Z]. [3+1.5+1.5]
Step by Step Solution
There are 3 Steps involved in it
The question youve provided asks for a program that can find the number of connected components in an undirected graph and assign a component number t... View full answer
Get step-by-step solutions from verified subject matter experts
