I'm trying to generate first class cubic graphs, to do so I need to choose a perfect matching, which is basically a partition of [|1, n|] with pairs (Each number should be in exactly one pair).
For example, for n = 8, I could choose (1, 7), (2, 4), (3, 6), (5, 8).
I want to use a neural net to do so, but I don't know at all how to do this properly, because my net need to know which numbers are available at each step. My first idea was to try to generate a permutation and then take the numbers two by two, but I don't know how to do this with a neural network. Any ideas ?