The study aims to optimize the vehicle routing problem, considering infeasible routing, to minimize losses for the company. Firstly, a vehicle routing model with hard time windows and infeasible route constraints is established, considering both the minimization of total vehicle travel distance and the maximization of customer satisfaction. Subsequently, a Floyd-based improved genetic algorithm that incorporates local search is designed. Finally, the computational experiment demonstrates that compared with the classic genetic algorithm, the improved genetic algorithm reduced the average travel distance by 20.6% when focusing on travel distance and 18.4% when prioritizing customer satisfaction. In both scenarios, there was also a reduction of one in the average number of vehicles used. The proposed method effectively addresses the model introduced in this study, resulting in a reduction in total distance and an enhancement of customer satisfaction.