Measuring the compactness of gerrymandered districts