I am facing a problem which I can't seem to resolve. I'm no mathematician, so maybe I am missing something obvious.
My problem is defined as follows: I have a list of 10 nodes (0,1,2,3,4,5,6,7,8,9), which all have to be connected to each other. A connection can be specified by stating for example (0) -> (1), which connects the nodes 0 and 1. Multiple connections can be defined in a single line as well: e.g. (0,1,2,3,4) -> (5,6,7,8,9). This last statement defines that every single node in the first set is connected to each node of the second set. Both sets can have a maximum of 5 elements each. Also, a node cannot be in the first set and second set on the SAME line. So (1,2,3) -> (2,4,5) is not permitted. Lastly, a line only defines a connection in a single direction; so (0) -> (1) only connects 0 to 1 and another statement has to be defined to connect 1 to 0 (by entering the line (1) -> (0) for example)
My configuration now is:
(0,1,2,3,4) -> (5,6,7,8,9);
(5,6,7,8,9) -> (0,1,2,3,4);
(0) -> (1,2,3,4);
(1) -> (0,2,3,4);
(2) -> (0,1,3,4);
(3) -> (0,1,2,4);
(4) -> (0,1,2,3);
(5) -> (6,7,8,9);
(6) -> (5,7,8,9);
(7) -> (5,6,8,9);
(8) -> (5,6,7,9);
(9) -> (5,6,7,8);
This way there are 12 lines needed to connect every node to each other in both directions. However, it seems like this is not the most optimal solution, because the last 10 lines don't use the full allowed maximum of 5 nodes per set.
Is there any way I can find an optimal solution regarding this problem? Any help is greatly appreciated!
Thank you in advance