The context is online grocery shopping and the paper focuses on the optimization of the related transport logistics that can lead to important economic and environmental advantages. At the beginning of the day, each customer provides: a shopping list, defining the product typologies and the related quantities to be collected from the different shops, the delivery address and the related delivery time window. One vehicle is in charge of serving all the customers by collecting the products from the shops and by delivering them to the provided delivery addresses. The target is to find the shortest path that satisfies the customer's needs.The proposed routing algorithms could support also logistic processes in supermarket supply. Each supermarket defines the daily freight demand, in terms of product typologies and related quantities, to be collected from the different manufactures/distributors, the delivery address and the related delivery time window. One vehicle is in charge of collecting the products from manufactures/distributors and of delivering them to the provided delivery addresses.The faced problem is therefore a complex multi commodity pick-up and delivery traveling salesman problem. Many constraints could be taken into account, related, for instance, to ecology and customer satisfaction. One local and four global optimization algorithms are proposed; their advantages and limits are discussed. The algorithms are tested on a basic logistic example, the numerical results are reported. The proposed algorithms use effective and efficient optimization algorithms able to minimize the overall miles necessary to deliver the goods in order to increase business efficiency.