The goods collection and delivery process often relates to distribution logistics problems. The task is to deliver goods from warehouses to customers under specific circumstances. Efforts to optimize the process are largely aimed at reducing overall costs of goods transportation. Among the prominent algorithms for solving the basic type of the delivery (or collection) problem, which includes a single depot and a homogeneous vehicle fleet, is the algorithm developed by Clarke and Wright in 1964. This algorithm minimizes transportation costs by maximizing the savings achieved through merging multiple routes into one. This paper primarily aims to solve the pickup and delivery problem where the goods must be delivered and empty packaging collected in a single process. The request of a customer can be routed from the depot or from another customer. Similarly, the destination of the request may be the depot or another customer. Unlike the original version of the Clarke and Wright algorithm, the initial routes are created to satisfy delivery orders, and therefore, the same customer can occur in multiple routes. Consequently, a situation may arise in which two routes containing one or more common vertices must be combined during the calculation. Furthermore, these vertices need not be the outermost vertices of the routes. This situation cannot be addressed by using the original version of the Clarke and Wright algorithm, and that is why we propose its modification. Merging routes through inner vertices means that the cost savings depend on the configurations of the routes, and therefore, they cannot be calculated a priori. Instead, the dynamic savings matrix must be used.