Closest multiplication tables of groups

Suppose that all groups of order n are defined on the same set G of cardinality n, and let the distance of two groups of order n be the number of pairs (a,b) in G × G where the two group operations differ. Given a group G(.) of order n, we find all groups of order n, up to isomorphism, that are closest to G(.).