cluster subjects to find out relationship between classes