CommencerCommencer gratuitement

Unweighted Clustering Randomizations

We've seen that the bike graph has a very low connectivity relative to a random graph. This is unsurprising because we expect that a graph that represents geographic space should have some parts that are connected by small corridors, and therefore, it wouldn't take much to disconnect the graph. It follows that it's likely that there are geographic clusters that are highly connected to each other and less connected to other clusters. We can test this hypothesis by looking at the transitivity of the network, or the clustering coefficient, a concept introduced in our introductory lesson. Several types of clustering coefficients exist, but we'll be looking at the global definition (essentially the portion of fully closed triangles), which is the same one covered earlier. First, we will look at an unweighted version of the graph and compare it to a random graph.

To calculate the global transitivity of a network, you'll need to set type to "global" in your call to transitivity().

The bike trip network, trip_g_simp is available.

Cet exercice fait partie du cours

Case Studies: Network Analysis in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Calculate global transitivity
actual_global_trans <- transitivity(___, type = "___")

# See the result
actual_global_trans

# Calculate the order
n_nodes <- ___(___)

# Calculate the edge density
edge_dens <- ___(___)
Modifier et exécuter le code