Because a matrix is the best way to visualise table settings, I developped a program in Excel. See the demonstrations on YouTube.
(figure above). After input of number participants, preferences, exemptions, max.nr. of guests each can accommodate at home and the preferred roulation (either individual or as a couple), the program first calculates if there is a chance to a solution in which nobody meets twice. The chance to that is equally increasing with the Q (see formula in first column). If Q<1 no solution is found, caused by too little hosts and/or too many exemptions.
When Q>1 the search for a solution is highly dependant on the way the different courses are distributed amongs the participants. Therefore ...
See figure on top of column 2: there a solution is found for 14 couples and 1 individual. The latter (name3) is exempted from a course, as are also name5 and name10. These two are exempted because they respectively take care of the drinks (B) at the start and the coffee (K) at the end of the Rdinner. Name1 had a preference for a starter (V). Names coloured green are exempted from a course.