The problems of synthesizing the beam patterns of the linear antenna array (LAA) and the circular antenna array (CAA) are addressed. First, an optimization problem is formulated for reducing the maximum sidelobe level (SLL) of the beam patterns. Then, the formulated problem is solved by using the invasive weed optimization (IWO) algorithm. Various simulations are performed to evaluate the effectiveness of the IWO algorithm for the synthesis of the beam patterns of the LAA and the CAA. The results show that IWO has a better performance in terms of the accuracy, the convergence rate, and the stability compared with other algorithms for the SLL reductions. Moreover, the electromagnetic simulation results also show that IWO achieves the best performance for the beam pattern synthesis of the antenna arrays in practical conditions.