Automatic detection of interaction groups