Quantifying clustering in a network