As an important component of high-rise buildings, the rationality of the design of the water supply and drainage system is directly related to the use of building function and safety. In this paper, the water supply and drainage system of high-rise buildings is digitally modeled through three-dimensional digital technology and constructed as a three-dimensional raster model according to a certain transformation ratio. Improve the A* algorithm, put forward the high-rise building water supply and drainage pipe path optimization algorithm, construct the directed connectivity graph structure, and determine and output the optimal path of the pipeline through the valuation function. Based on the green new energy fire protection program, the high-rise building water supply and drainage pipeline path optimization and simulation experiments are carried out. The application of this paper highrise building drainage pipe path optimization algorithm automatically arranged by the shortest length of high-rise drainage pipe, and the number of elbows to reach the minimum, the average running time is faster than the traditional A * algorithm 0.0736s, basically achieved the desired layout effect.