As you already know, transaction costs are a hugely important thing to think about. Can you do anything to mitigate transaction costs and the optimization problem itself? Well, you know you want to minimize transaction costs. Can you just plop some quantity that measures transaction costs somehow into the objective function? That sounds like a seemingly satisfying solution. The problem with this is that in practice, it’s extremely difficult to know how to represent those costs. To know the transaction costs, you must know what the trade is, but the whole reason to do the optimization is to know what the traders. In general, transaction cost is a function of trade size. But the problem is even an infinitesimally small trade will incur non-trivial transaction costs. That is, transaction cost is a discontinuous function of trade size. This is because there are lower bounds on bid ask spreads and Trade Commission’s. This means that a transaction cost term can’t be included in the objective function easily. One possibility is to impose a turnover constraint. Again, simply limiting the net change in weight on each asset relative to the weights in the previous portfolio. In general, turnover is directly proportional to transaction cost. So, you might limit turnover to say 20 percent. The problem with doing this is you can easily get to an infeasible situation. It’s very possible that you can have a situation where through market movements, the portfolio gets pushed into a certain scenario where to have all the constraints satisfied, the turnover constraint must be violated. For example, market movements may have pushed the size of a stock’s position beyond the maximum allowed by the individual weight constraint, but the trade required to reduce that weight may be more than allowed by the turnover constraint. There are two potential solutions. The first is to put that turnover constraint into a penalty term in the objective function so that instead of a hard cap, you have a scaling term that penalizes turnover. The second solution is to put the whole optimization problem inside a loop. You can impose a hard turnover constraint, and if the problem is infeasible, you can progressively relax the turnover constraint and rerun the optimization until the problem becomes feasible.