In order to solve the problem of replenishment and pricing decisions in superstores, we analyzed the relationship between the total sales volume and cost-plus pricing of each vegetable category, which provides a basis for superstores to make reasonable replenishment and pricing decisions. Due to the seasonality of agricultural products and the specificity of the forecasting unit, the data were preprocessed and then the ARIMA time-series forecasting model was used to forecast different individual products and categories. After that, we introduced the demand elasticity pricing model to make replenishment and pricing decisions and built a planning model to optimize the decisions using the relationship between the elasticity coefficient, revenues and costs, taking into account the competitive environment in which the superstore is located and the inconsistency of the elasticity of supply and demand. For this, we used black hole algorithm and particle swarm algorithm to optimize the objective function respectively. By comparing the results, we found that the particle swarm algorithm is significantly better than the black hole algorithm in terms of optimization finding results. The total amount of replenishment as well as the pricing strategy were obtained from the particle swarm algorithm.