According to the problem of large amount of carbon emissions during the cold chain distribution process, a cold chain distribution route optimization method for fresh agricultural products under the carbon tax mechanism was proposed. Firstly, with the goal of minimizing carbon emission cost and comprehensive cost, quantitative analysis of carbon tax mechanism is introduced, considering the demand quantity, demand time and unloading time constraints, a mathematical model of the problem is established. In addition, an improved quantum bacterial foraging optimization algorithm is put forward, which uses the bacterial optimization algorithm information update strategy to maintain group memory, and uses the carbon tax cost as the decision variable of the improved algorithm. Through experimental simulation, comparative analysis of the shortest distribution path, uninitialized pheromone bacterial foraging optimization algorithm and quantum bacterial foraging optimization algorithm on the last selected study model, the method proposed in this thesis can effectively optimize the distribution path, reduce carbon tax cost and comprehensive cost.