Reduced access to shallow mineral resources, increased demand for minerals, and advances in technology have led to the development of deep underground mines. The location of the stopes and, finally, the determination of the mine layout is one of the problems in the design of any underground mine. In this study, a network flow algorithm was used to optimize the underground mine layout where sublevel stoping was chosen as the mining method. Due to the geomechanical constraints, the empirical Mining Rock Mass Rating classification system was used to determine the maximum stable width of the mineable stopes in the mine layout of each mining level. The model was run on a copper deposit and optimized for one mining level. The results obtained from running the model showed that 40 mineable stopes with a total recovery of 97% could be achieved. For validity check, the results were compared with those obtained from the algorithm of maximum value neighborhood. Application of the proposed model into the example block model revealed approximately 7% more economic value for the network flow algorithm than the maximum value neighborhood algorithm.