In this paper, an approach based on a genetic algorithm is presented in order to optimize the connection topology of an offshore wind farm network. The main objective is to introduce a technique of coding a network topology to a binary string. The first advantage is that the optimal connections of both middleand high-voltage alternating-current grids are considered, i.e., the radial clustering of wind turbines, the number and locations of the offshore electrical substations, and the number of high-voltage cables. The second improvement consists of removing infeasible network configurations as designs with crossing cables and thereby reduces the search space of solutions.Index Terms-Genetic algorithm (GA), network planning, offshore wind farm (OWF), optimization, Prim's algorithm.