In recent years, the optimal design of pipeline systems has become increasingly important in the water industry. In this study, the two methods of genetic algorithm and mathematical optimization were employed for the optimal design of pipeline systems with the objective of avoiding the water hammer effect caused by valve closure. The problem of optimal design of a pipeline system is a constrained one which should be converted to an unconstrained optimization problem using an external penalty function approach in the mathematical programming method. The quality of the optimal solution greatly depends on the value of the penalty factor that is calculated by the iterative method during the optimization procedure such that the computational eff...