I wrote a solver for finding maximal groups of companions and used it on the NE:WB companions. The information for the companions is from
http://forums.taleworlds.com/index.php/topic,176395.msg4234744.html#msg4234744. Here are my results.
All of these groups are such that there are no dislikes between any members unless otherwise stated.
Simple maximal groupsThe maximum group size is 8. There are four such groups:
- xerina nizar tismanu klethi katrin aragorn deshavi vorian
- xerina klethi aragorn erevan deshavi vorian bahestur achilles
- thorgrim jinnai kelemvor erevan kana bahestur alyssa achilles
- thorgrim nizar jinnai tismanu kelemvor katrin kana alyssa
If we have to have Jinnai, the only companion with engineering, then only the two latter groups apply.
Also note that there are no groups with Jinnai and one of the companions with surgery, Aragorn or Xerina. Because both Aragorn and Xerina dislike Jinnai there are no such groups at all.
Groups with high level compaionsThere are four level 30 companions: Achilles, Alyssa, Kelemvor and Xerina. You can have at most 3 of them in one group and there is only one such group with a total of 8 companions: thorgrim jinnai kelemvor erevan kana bahestur alyssa achilles.
Other useful groupsHere is the only group of 8 companions that has Jinnai (engineering), Tismanu (good potential for surgery) and at least two high level companions: tismanu jinnai thorgrim nizar kelemvor katrin kana alyssa.
Unstable companionsI'll call a companion who has one like and one dislike "unstable". If we allow unstable companions then we get larger groups. You need to allow at least 4 unstable companions to get any improvement. The maximum group size with an unlimited number of unstable companions is 10. The only such group is: xerina thorgrim nizar jinnai katrin vorian kana bahestur alyssa achilles.
The maximum group size (with unstable companions) which includes all high level companions is 9. There are three such groups:
- xerina thorgrim kelemvor aragorn erevan kana bahestur alyssa achilles
- xerina thorgrim kelemvor klethi erevan deshavi bahestur alyssa achilles
- xerina thorgrim tismanu kelemvor aragorn erevan kana alyssa achilles
The solverThe solver is written in answer set programming (ASP), which is an extension of logic programming that uses stable model semantics. Here is the solver:
% To run this program run do: lparse <filename> | clasp --number=0
% Domains for the variables we use
#domain companion(C).
#domain companion(C1).
#domain companion(C2).
% Hide all but selections
#hide companion(C).
#hide dislike(C1,C2).
#hide like(C1,C2).
% Define the companions
companion(achilles).
companion(alyssa).
companion(bahestur).
companion(kana).
companion(vorian).
companion(deshavi).
companion(erevan).
companion(aragorn).
companion(katrin).
companion(klethi).
companion(kelemvor).
companion(tismanu).
companion(jinnai).
companion(nizar).
companion(thorgrim).
companion(xerina).
% Define the dislikes
dislike(achilles, tismanu).
dislike(achilles, nizar).
dislike(alyssa, aragorn).
dislike(alyssa, klethi).
dislike(bahestur, katrin).
dislike(bahestur, tismanu).
dislike(kana, deshavi).
dislike(kana, klethi).
dislike(vorian, kelemvor).
dislike(vorian, thorgrim).
dislike(deshavi, thorgrim).
dislike(erevan, nizar).
dislike(erevan, katrin).
dislike(aragorn, jinnai).
dislike(kelemvor, xerina).
dislike(jinnai, xerina).
% Define the likes
like(achilles, xerina).
like(alyssa, kelemvor).
like(bahestur, thorgrim).
like(kana, tismanu).
like(vorian, katrin).
like(deshavi, klethi).
like(erevan, aragorn).
like(jinnai, nizar).
% Give support for selection
{ sel(C) } :- companion(C).
%==============================================================================
% Group constraints
%==============================================================================
% Use only one, comment the other one out.
% Use this to forbid all dislikes in your group
:- dislike(C1,C2), sel(C1), sel(C2).
% OR
% A companion is "unstable" if it has one like and one dislike. Use this to
% allow groups to have "unstable" companions.
%#const max_unstable = 16.
%activelike(C1,C2) :- like(C1,C2), sel(C1), sel(C2).
%activelike(C2,C1) :- activelike(C1,C2).
%activedislike(C1,C2) :- dislike(C1,C2), sel(C1), sel(C2).
%activedislike(C2,C1) :- activedislike(C1,C2).
%satisfied(C1) :- 1 { activelike(C1,X):companion(X) }, sel(C1).
%:- 1 { activedislike(C1,X):companion(X) }, not satisfied(C1), sel(C1).
%unstable(C1) :- 1 { activedislike(C1,X):companion(X) }, satisfied(C1), sel(C1).
%:- 2 { activedislike(C1,X):companion(X) }, sel(C1).
%:- max_unstable + 1 { unstable(X):companion(X) }.
%#hide activelike(C1,C2).
%#hide activedislike(C1,C2).
%#hide satisfied(C1).
%#hide unstable(C1).
%==============================================================================
% What to compute
%==============================================================================
% Use only one, comment the other one out.
% Use this to find out the max group size
maximize { sel(C):companion(C) }.
% OR
% Use this to find all maximal groups. The number should be the maximum minus
% one.
%:- { sel(C):companion(C) } 7.
% OR
% To foremost maximize the number of a fixed list of companions and then take
% as many additional companions as you can fit use this.
%maximize { sel(C):companion(C) }.
%maximize { sel(achilles), sel(alyssa), sel(kelemvor), sel(xerina) }.
% OR
% As before use this form to find all maximal groups.
%:- { sel(C):companion(C) } 7.
%:- { sel(achilles), sel(alyssa), sel(kelemvor), sel(xerina) } 1.
% Finally to force some selections just add them as facts. For example to
% always have Xerina in your group add the line:
%sel(xerina).
%==============================================================================
% Some useful constraints
%==============================================================================
% Force Jinnai, who has engineering.
%sel(jinnai).
% Force one of the companions who have more than 1 surgery.
%1 { sel(aragorn), sel(xerina) }.
It uses the lparse parser and the clasp solver. I realize this is a somewhat esoteric language. If you wish to modify the solver then the lparse manual will serve as a good introduction.
Also if there are groups with some other (simplish) constraints you would like to have then just ask and I'll do the modifications and solving.