Complex networks approach for studying polarization in different social groups