Let's say we have a teacher student relation. On one side, we have a list of teachers and on the other, we have a list of students. What is the best way (visually appealing as well) to inform the user about the students taught by a particular teacher and the teachers that a particular student has signed up for. Hover is not an option, as this information has to be presented as soon as a user lands on this page. The assumption that can be made is there will be a maximum of 30 teachers and about 40 students. The subjects don't matter in this scenario. I only want the many to many relationship between a student and teachers mapped.
Using a tabular format you could have the students down one side and teachers across the top (or vice versa, a view switcher option?)
Students can find their name down the left, scan across to see their subjects and scan up from these to see their teacher. Also the cells could be split into multiple subjects if a teacher teaches more than one subject. (see teacher A, Student 3, relationship below).
The table could be filtered to show specific student rows or teacher columns, e.g. if a teacher only wants to see the students they teach they could filter the rows to that criteria.
Following on from André Kleinschmidt's improved more minimal version of my matrix, you could rotate it 45 degrees so both axis' labels ca be read horizontally. Could be another user option to change the view of it if desired.
You could try a co-occurrence matrix with the teachers and the students as dimensions. If the subjects doesn't matter a cross/dot will decently show the connection and saves display space.
There is a nice example visualization of a co-occurence matrix, that shows the character co-occurrences in Victor Hugo’s Les Misérables. (See image below if the page became unavailable)
In opposite to the example you would not match persons with themselves and obviously end up with a rectangular matrix.
Additionally you could provide a sort by teacher or student relying on the number of connections (filled cells per row/column). With numbering the cols/rows one could easily count how many students a teacher is in charge or vice versa with how many different teachers a single student has to deal.
Instead of a simple marker (dot, cross, etc.) you could fill the cells with the number of classes one teacher conducts to a corresponding student. Summing up this counters makes visible the teaching load per row/column.