find the optimal combination
If I understand you correctly, the order of the inputs to function F does not
influence the output W, so order is not important.
I'm deducing this from the three possible subsets in your example  at the top
where K = 2 and N = 3.

For a set of N elements, and a function F taking K inputs where order of
inputs does not matter, the complexity to
find all possible W outputs I don't think is O(N ** K). I'm using ** as to the
power of.

I would think it is  the same problem as finding the number of ways to choose
K elements from a set of N elements disregarding order. I think one could also
say the number of partitions of K elements over a set of N elements.

The number of ways to choose K elements from a set of N elements is:

N // since you are choosing from a set of N elements
* (N - 1)  // since next you are choosing from a set of N - 1 elements
* (N - 2)  // same reasoning as above
...
* (N - (K - 1))  // just before you have chosen K elements
* (N - K)  // you have chosen the K-th element

Sort of like factorial, but from N -  K + 1 up to N, which is the same as N! / (N - K)!.

Lastly,   we have to disregard order of the elements, and there is K! ways to
order K elemetns, which brings us to:

N! / (N - K)! / K!

As each W is calculated you can simply keep the highest yealding inputs, and
when you have tried all inputs you will be guaranteed   to have found the
right set of inputs.

So, supposing the above is correct (it worked for small mental verification of K = 2,
N = 4 and K = 3, N = 4 and K = 3, N = 5) then I suppose the complexity
analysis is O(N! / (N - K)! / K!) and not O(N ** K).

If you know F then you could optimise it, to get a linear improvement, or
maybe find inputs that could be omitted to get an even bigger speedup.

Without knowing F you are stuck with trying everything. 

One other thing you could do is employ memoization to avoid having to evaluate
F for similar inputs.