cohesionclass function

Calculate the cohesion of samples for each network