Effective group formation in agent societies