This paper covers few mathematical aspects of well location and related optimization problems. This problem is of great importance and covered by many authors. Some related studies are described in the paper. Current study formulates these problems in terms or integer programming. Optimal solutions formulate initial sets of cases and improve the efficiency of oil and gas recovery. Considered integer programming problems are extremely large-scale problems. The matrix structure, the number of feasible solutions, etc. have been taken into account. A new fast algorithm for the generalized non-square assignment (transportation) problem has been designed. It is reasonable to use the approach studied in this paper to design a set of appropriate initial cases for the small fields or fields with a complex geology. Presented workflow finds optimal well positions for a field or its part. A Brugge field has been taken as a test case. An improvement of production and NPV achieved the comparison between an initial and an optimal case presented.