# Which model should I choose to maximise reward of having chosen two numbers from a list?

I am looking for a technique to train a machine learning model to choose two items from a list.

So, given a list $$x=[x_1, x_2, x_3, x_4, \dots, x_n]$$, the model needs to choose two elements $$(x_i, x_j)$$. I have a function $$R(x, x_i, x_j)$$, which will output the reward of choosing $$(x_i, x_j)$$ given $$x$$.

What type of models should I use, and how should I train it to maximize the reward?

I've tried using deep reinforcement learning, but I ran into the following problems with implementing the Q-Network:

1. Variable-length inputs (fixed by using RNN, I think)
2. The output size grows factorially (for an input set of n elements, there are n choose 2 ways to pick 2 elements, so the network needs to output n choose 2 expected rewards)