It is quite rare to find researches in the literature connecting neural networks to design challenges in civil engineering, particularly with regard to beam with large openings. Therefore, to ascertain the best cost design for such a beam, an optimization technique is developed, written using MATLAB functions, and verified in this study. Because of the efficiency and dependability of the iterative Particle Swarm Optimization (PSO) process, the ACI 318-19 code method is adopted via this algorithm. Using four beam design (decision) variables, which are: beam width b, longitudinal tension reinforcement area As, longitudinal compression reinforcement area A’s, and vertical shear reinforcement area Av; the objective is to minimize the overall beam cost function. The constraints for each of the 60 randomly chosen particles are handled using the self-adaptive penalty function technique, which is applied in all the 100 iterations for each of the four proposed beam design case studies with identical openings. For the developed method, completing all iterations serves as a stopping criterion. Comparative studies are conducted to demonstrate how the compressive strength of concrete and the live load scheme affect the optimal overall beam cost and the associated design variables. The relations between cost of beams and the four design variables, which are presented through graphs and tables, indicate that the beam’s cost is significantly impacted by the loading condition. This is shown by increasing the cost of beam B1, with no sustained live loads, from 722 US dollars to 984 US dollars for beam B4, which has concentrated and distributed sustained live loads. Future research is advised to include modern strengthening techniques for beams with openings, and apply this research to a PSO algorithm with several objectives.