<p indent=0mm>The layout optimization of oil-gas gathering and transportation system is to minimize the total construction investment of oil-gas pipeline network by using optimization theory. In the process of optimization, it is necessary to collaboratively determine the optimal location and quantity of stations, the connection relationship among the various stations, the path and specification of pipelines. The layout optimization of oil-gas gathering and transportation system is essentially a kind of constrained three-dimensional network topology optimization problem, which belongs to the NP-hard problems in combinatorial optimization. It is of practical significance to solve such problems for reducing the investment of oilfield construction, equivalently enhancing oil recovery and promoting the development of applied optimization theory. However, the existing layout optimization theories and methods of oil-gas gathering and transportation system are mainly for plain oil and gas fields, which could not be applied to the oil and gas fields with undulating terrain. On the basis of accurately characterizing the three-dimensional terrain, it is urgent to establish the optimization model with comprehensive factors and propose the efficient solution methods. In order to deal with the difficulties of seeking the optimal layout of oil-gas pipeline network in spatial scale, such as the huge amount of terrain data, the large number of decision variables and the complex constraints, a series of studies have been carried out. Firstly, from the perspective of generality and comprehensiveness, considering the constraints of random terrain, the layout feasibility of stations, and the gathering and transportation processes, a mathematical model for the layout optimization of oil-gas gathering and transportation systems in the constrained three-dimensional space is established. Secondly, based on digital elevation model (DEM) and weighted digraph in graph theory, the breadth first search algorithm is applied innovatively. Based on the idea of simultaneous search in two opposite directions and the optimality of breadth-first search, the two-way breadth first search algorithm for pipeline path is proposed, and its efficiency is analyzed theoretically. Finally, according to the proposed pipeline path optimization algorithm, the hybrid particle swarm-fireworks optimization (PS-FW) algorithm with global search ability is effectively integrated. By comprehensively applying the PS-FW algorithm and the two-way breadth-first pipeline path search algorithm, the spatial layout of the oil-gas gathering pipeline network and the pipeline path are respectively solved, and the hybrid intelligent optimization method is proposed. According to the convergence theorem of the stochastic optimization algorithm, the global convergence of the hybrid intelligent optimization method is proved. The results show that, compared with the existing theoretical methods, the optimization model established in this paper has more comprehensive consideration and better generality. The proposed two-way breadth-first pipeline path optimization algorithm can save at least 7/9 of the time and space complexity, and improve the solution efficiency significantly. The performance of the hybrid intelligent optimization method is very well, and it can converge to the global optimal solution with probability 1. The optimization model and solution methods proposed in this paper are not only effective for the layout optimization of three-dimensional oil-gas gathering and transportation system, but also have reference value for the multi-level location planning, shortest path, and high-dimensional optimization problems.