This Excel spreadsheet demonstrates the classic mean-variance approach for portfolio optimization, but includes the added complication of transaction costs.
Equities often have different characteristics. For example, some are more volatile but offer a potentially greater return, while other equities increase in value when the wider market goes down.
By carefully constructing a portfolio with equities with different characteristics, risk is minimized while maintaining a superior return.