Optimal portfolio with only n assets (with n less than total assets)

Given a time series of a set of N assets (let's say 100), how can I find the optimal portfolio, with the constraint that only n<N assets (let's say 10) can be in the portfolio? With 'optimal portfolio' I mean the 'efficient portfolio' (so minimum variance for a given return, or maximum return for a given variance). Within the modern portfolio theory framework one can find the weights for all the N assets, but what if I want n<N assets only?

• I believe this is a difficult problem, mathematically speaking. And trying all possible subsets of assets would be very slow. But I am not aware of a more clever method. Commented Jun 5, 2021 at 20:32
• I think you need an integer programming formulation to do that. Search for some related threads because I wrote something a month or so ago when someone asked a pretty similar question. Unfortunately, I don't remember what the title of the question. I'll check if it's in my users answers list ? Commented Jun 6, 2021 at 2:20
• I found it. It's not exactly the same question and it didn't get a check ( it got a 1 but i'm not sure what that means ). but it makes sense to me. I think you could use the same idea with your question. quant.stackexchange.com/questions/64047/… Commented Jun 6, 2021 at 2:23
• Besides @markleeds Ansatz, you could try LASSO methods with a decreasing penalty parameter until a sufficient number of investment-optimal sets with exactly $n$ has been produced. Commented Jun 6, 2021 at 5:12
• Do you have more details/references where LASSO method was used? Commented Jun 8, 2021 at 18:27

This is generally considered a hard problem to solve because it is an example of a Mixed Integer Non-Linear Programming problem, and would typically require access to a commercial optimisation routine to solve. The problem requires the addition of N variables ($$v_i, i=1,N$$) to the general Markowitz optimization problem. $$v_i$$ can take the value 0 or 1 depending on whether an asset is included in the final portfolio. Each asset has modified variable bounds $$= l_iv_i < x_i < u_iv_i$$, and we have a final constraint on the number of total variables $$\Sigma_i v_i <= n$$.