connectivity_metric function

Method to calculate the connectivity.