An optimization framework for global optimization of the cable layout topology for Offshore Wind Farm (OWF) is presented. The framework designs and compares closed-loop and radial layouts for the collection system of OWFs. For the former, a two-stage stochastic optimization program based on a Mixed Integer Linear Programming (MILP) model is developed, while for the latter, a hop-indexed full binary model is used. The purpose of the framework is to provide a common base for assessing both designs economically, using the same underlying contingency treatment. A discrete Markov model is implemented for calculating the cable failure probability, useful for estimating the time under contingency for multiple power generation scenarios. The objective function supports simultaneous optimization of: (i) initial investment (network topology and cable sizing), (ii) total electrical power losses costs, and (iii) operation costs due to energy curtailment from cables failures. Constraints are added accounting for common engineering aspects. The applicability of the full method is demonstrated by tackling three differently sized real-world OWFs. Results show that: (i) the profitability of either topology type depends strongly on the project size and wind turbine rating. Closed-loop may be a competitive solution for large-scale projects where large amounts of energy are potentially curtailed. (ii) The stochastic model presents low tractability to tackle large-scale instances, increasing the required computing time and memory resources. (iii) Strategies must be adopted in order to apply stochastic optimization for modern OWFs, intending analytically or numerically simplification of mathematical models.