Show that we can use a depth-first search of an undirected graph G to identify the connected components of G, and that the depth-first forest contains as many trees as G has connected components. More precisely, show how to modify depth-first search so that it assigns to each vertex an integer label v.cc between 1 and k, where k is the number of connected components of G, such that u.cc = v.cc if and only if u and are in the same connected component.
Step 11 of 3
Take a look at the algorithm. The key observation here is that we are in an undirected graph so each time the function is called in , it will discover all connected vertices, that is, it will discover of the graph. That is where we can sneak in our label that identifies all the components of the graph. The algorithm is as follows:
Recommended textbook solutions
Consider inserting the keys 10, 22, 31, 4, 15, 28, 17, 88, 59 into a hash table of length m = 11 using open addressing with the auxiliary hash function h'(k) = k. Illustrate the result of inserting these keys using linear probing, using quadratic probing with
, and using double hashing with
An article in Concrete Research [“Near Surface Characteristics of Concrete: Intrinsic Permeability” (1989, Vol. 41)] presented data on compressive strength x and intrinsic permeability y of various concrete mixes and cures. Summary quantities are n = 14,
. Assume that the two variables are related according to the simple linear regression model. a. Calculate the least squares estimates of the slope and intercept. Estimate σ². Graph the regression line. b. Use the equation of the fitted line to predict what permeability would be observed when the compressive strength is x = 4.3. c. Give a point estimate of the mean permeability when compressive strength is x = 3.7. d. Suppose that the observed value of permeability at x = 3.7 is y = 46.1. Calculate the value of the corresponding residual.