Group theoretical and combinatorial analysis of histocompatibility and switching algebra