This article deals with the knapsack problem, where, under real-world conditions, the wholesale prices for the day are not known, and the sales of vegetable products exhibit seasonal patterns. Therefore, this article utilizes an LSTM neural network model to predict the daily wholesale prices. Subsequently, the top 60 projects with the highest profits are selected to create a histogram, and available projects are chosen from these 60.Initially, this article identifies five factors that impact profit and transforms them into positive indicators. Weight allocation is done using the entropy weight method and fuzzy comprehensive evaluation method. The TOPSIS method is employed to obtain composite score indicators for the 60 projects. A linear programming objective function is established, and the results are solved using the Grey Wolf Optimization (GWO) algorithm.