Dam construction projects among the most extensive and most expensive projects are considered. It is always appropriate and optimal for such concrete structures to reduce the volume of concrete and consequently reduce construction costs is essential. In this study, invasive weed optimization software GNU octave, dimensions of concrete gravity dam Koyna located in India optimized stability constraints. For this purpose, a cross-section with a length unit consists of eight geometric parameters as input variables, and other geometric parameters were defined using these variables. The result showed that invasive weeds are well-optimized dimensions of the dam as the volume of concrete in the construction of the dam at the current level measures 3633 cubic meters that optimal dropped 3353 cubic meters, which is a mean of 7.7% of the value of the objective function (the volume of concrete in dams) is reduced. This amount of concrete decreased the construction of the dam, saving the cost and is more economical.