Keywords

1 Introduction

The idea of distribution logistics is to ensure the availability of goods in places where there is a demand, while also putting emphasis on cost optimization of the process and the appropriate level of customer service. Guideline for all logistics activities is to provide a product to the right customer at the right time and place, in the required quality and quantity, at the right cost [1].

Many commercial and industrial enterprises face the challenge of a proper organization of the distribution of its products to a network of customers. In the field of operations research, this problem is known as the vehicle routing problem (VRP). A characteristic feature of transport routing problems is that using it enables one to formulate any problem, as opposed to actually finding its best solution. Therefore, these issues are of interest to many researchers, resulting in a large number of proposals for algorithms to find the best solutions.

2 Specificity of Distribution in the Pharmaceutical Industry

The literature reveals a number of distribution definitions. Basically, they can be classified into two main perspectives: marketing and logistics.

According to A. Czubała, distribution of products is referred to as “profit-oriented activities including planning, organization and control of how to deploy products and offer them for sale.”

According to H.Ch. Pfohl: “Distribution logistics is a part of logistics system, associated with the market. It combines the company’s production logistics with procurement logistics of the buyer. Distribution logistics covers all activities that are related to supplying a customer with finished goods.”

The purpose of the distribution is to provide purchasers of the final product desired by them to places where they want to buy them in the corresponding time on the agreed terms and the price accepted by them. This task requires the manufacturer to decide on a choice of distribution channels, as well as how to choose the physical movement of products. Distribution channels of appropriate capacity, structure and competitiveness should enable the manufacturer to estimate a planned sales volume, while the corresponding physical distribution organization must provide an adequate level of service to buyers while minimizing distribution costs. Figure 1 shows the structure of distribution [2].

Fig. 1
figure 1

Distribution processes structure

Supply medicines (manufactured and destined for sale) never coincide with demand (real demand). The main differences relate to, among other considerations, place, time of production and consumption, type and range of medicines, as well as the size of single batches of different supplies. Elimination of these differences is leading to increasingly important decisions regarding the development of distribution channels and physical processes of medications marketing [3].

Presenting characteristics of different distribution channels in the pharmaceutical market, diversity of intermediaries in the horizontal and vertical channels should be emphasized. The system shows all possible forms and types of mediation: pre-wholesale, wholesale, small brokers, retailers and patients as terminal buyers (Fig. 2—on the basis of [1]).

Fig. 2
figure 2

Schematic distribution channels in the pharmaceutical industry

In the pharmaceutical industry there is also the phenomenon of parallel imports of medicines. A scheme of this kind of trade is shown in Fig. 3 [4]. The main reason for the emergence of a form of commerce (a variety of territorial expansion) is the difference of prices of drugs that are on the markets of countries belonging to the European economic zone. The principle of free movement of medicines in force in the European Union allows the flow of medicines from countries with lower prices to countries where prices are at higher levels. Parallel trade in medicines on the circulation of goods protected by patents in a given market by third parties that distribute the goods to the territory of another country without the authorization of the rights of the manufacturer, often against his will, and regardless of the distribution channel. It is estimated that currently medicines derived from parallel trade constitute about 6 % of the total pharmaceutical market in the European Union [4].

Fig. 3
figure 3

Channel of medicines parallel import in the pharmaceutical market

This article focuses on activities related to bringing medicines to pharmacies. They are based on the so-called physical processes in distribution of the flow, and hence the selection of respiratory movement of goods and the type of cells that mediate the flow of goods from producer to consumer.

3 Example of Route Optimization of Medicines Physical Distribution

In the field of operations research, the problem of route optimization is called the Vehicle Routing Problem. A characteristic feature of the vehicle routing problem is the ease of problem formulation, as opposed to its solution. Therefore, these issues are of interest to many researchers, resulting in a large number of proposals for algorithms searching for the best solutions.

An exemplary case study was carried out on routes for the distribution of medicines in Bielsko-Biala. Along the route a driver has 29 points of receipt of goods (pharmacy). The place of loading is a pharmaceutical wholesaler “Medicare” located in Myslowice-Kosztowy. Wholesale is the thirtieth point in the analysis [5]. The current route is determined on the basis of the following limitations:

  • pharmacy opening hours,

  • designated prohibition time zones of entry (pedestrian, market),

  • distance between pharmacies.

Table 1 shows the order according to which the driver visits customers. It also includes distance and travel times between itinerary points, as well as the total length and travel time.

Table 1 Current system medicines distribution on the route Myslowice—Bielsko-Biala—Myslowice

The current drive is carried out daily on the route Myslowice—Bielsko-Biala—Myslowice and is 172.2 km. The loading operations include invoice scanning and loading of goods. The scanning time of invoices is about 15 min and the cargo loading time is about 45 min. The average service time at each point of reception is 5 min. Unloading of empty containers after returning to the warehouse is about 15 min. The total work time is approximately 442 min.

3.1 The Mathematical Model of the Traveling Salesman Problem

The driver leaves the warehouse, which is a loading place, to visit a number of its customers (pharmacies). All pharmacies must be visited exactly once and then the truck is returned to the warehouse (place of loading). The order of visits to each customer is free, but the driver’s aim is to make the route as short as possible. Such a task is a special case of VRP and is called the traveling salesman problem (TSP).

A convenient tool for description of the traveling salesman problem is to provide, in the form of a graph, a network of routes that the van may possibly pass through. Such a graph is a mixed graph Γ = (V, E, A), where V is a non-empty set of vertices, and E is the set of edges—two-element subsets of vertices V, and A is the set of arcs, which are elements of the Cartesian product: V × V = {(a, b): a ϵ V, b ϵ V}, where a is the initial vertex, and b is the end vertex. Graph vertices frequently correspond to the crossroads. Sections of two-way traffic between the intersections are the edges, and sections of one-way streets are the arches directed according to the direction of travel. Weighting of the edges and arcs in the example shown will be equal to the lengths of the respective sections of roads, and transit times. Figure 4 shows a map section of Bielsko-Biala with selected pharmacies and a graph representing a route network that is possible to pass by all relevant customers. A solution to the Travelling Salesman Problem is equivalent to finding a Hamiltonian cycle in the graph.

Fig. 4
figure 4

Channel of medicines parallel import in the pharmaceutical market

But to find such a cycle, you should make sure that the relevant graph is of Hamiltonian type. One of the fundamental statements about this issue is Ore’s theorem [6] which states that if a graph G is an undirected graph with n vertices, where n ≥ 3, and for each pair of non-ordered vertices a and b, the sum ρ(a) + ρ(b) ≥ n, where ρ is the degree of the vertex [7]. The graph considered in this article has 30 vertices. But as it can be easily seen in Fig. 4, no vertices have a degree higher than 6. So the condition of the Ore theorem cannot be met. A possible solution is to extend the route network graph to a complete graph. The degree of each vertex of the complete graph is equal to n − 1. A complete graph is Hamiltonian type and is designed to determine the (n − 1)! Hamilton cycles. This is a NP complete problem. Bringing graph Γ to the G complete graph is performed as follows: for any two vertices in the graph, the shortest distances are determined using Dijkstra’s algorithm. Any two vertices were combined with an edge or an arc length corresponding to the shortest path from one vertex to another. The results are summarized in Table 2.

Table 2 Distance matrix between wholesale customers

The analysis presents the Traveling Salesman Problem for one of the 43 routes of suppliers from “Medicare” pharmaceutical wholesalers.

As already mentioned above, the TSP presented is of the combinatorial nature and belongs to the NP-complete problems. Despite a very simple formulation of the Traveling Salesman Problem, finding the optimal solution (the shortest route) with a large number of customers, all of which the driver has to visit, it is extremely time-consuming. Therefore, methods used are less accurate, but gives a good enough solution in a relatively short period of time.

This paper presents two methods to solve the problem: the branch and bound method and an artificial immune system.

3.2 Route Selection with Branch and Bound Method

First the problem was solved with the branch and bound method usually used for discrete and combinatorial optimization problems or general real-valued problems. The algorithm of this method consists of the set of solutions which is thought of as forming a rooted tree with the full set at the root. The algorithm explores branches of this tree, which represent subsets of the solution set.

For the calculation with branch and bound method, the TSPSG program was used [8]. On the input there are the number of cities (points) and the distances between them in the form of a matrix of distances between wholesale clients (Table 2). The analysis of the transport route included 29 clients (points) and place of loading which is the pharmaceutical wholesaler.

After performing the calculations, a new order of carriage made in the TSPSG program can be presented as shown in Table 3. The length of the route designated by the program is 163.60 km. There are also given the distances between points and travel time. At the end of the array is given the sum of the distance and the driver travel time.

Table 3 Route order determined with branch and bound method using TSPSG program

Total travel time is about 44 min shorter and had less complete combustion of 1.28 l/100 km. Theoretical calculations show that the route designated by the program TSPSG is shorter and more economical than the present, but due to limitations in practice, this route is sub-optimal for the journey. A TSPSG program does not include such restrictions as pharmacy opening hours, resulting in longer runs. For example, the opening time difference between the second, and third point generated by the program is 75 min. The biggest problem for the established order of the transport route is the delivery delay of drugs to pharmacies opened in earlier hours. An example is the point 29 Pharmacy “Sw. Anny”, which in the current route is supplied as fifth.

3.3 Route Selection with Artificial Immune System

An artificial immune system is used for the calculation methods of artificial intelligence and imitates the human immune system [9]. The natural immune system responds to attacks by antigens—foreign objects invading the body. There are several barriers that protect the body: skin, which protects not only mechanically, but for example chemically through sweat, or enzymes on the skin. The immune system is activated when the previously described defense mechanisms fail.

The body produces billions of antibodies. Many of them are mutated with the purpose of generating those that fit snugly against the antigen. This allows destruction of the antigen and removal of it from the body. After finding such an antibody, it takes a rapid proliferation of cells that produce best fitted antibodies. These cells are released into the bloodstream. After removing antigens follows suppression. The number of antibodies directed against a specific antigen is reduced considerably. In the next attack on the same antigens, the immune system will work faster. The cycle seeking a better and better antibody is called a clonal selection (Fig. 5).

Fig. 5
figure 5

Clonal selection

The paradigm of clonal selection is used to optimize. The clonal selection algorithm proceeds as follows:

  1. 1.

    Initialization

    Strings of numbers (2) are randomly generated, for which a fitting value is determined.

  2. 2.

    Cloning

    The solutions of the highest fitting values are repeatedly cloned.

  3. 3.

    Mutation

    Most of the clones obtained are subjected to mutation operators to change the order of the numbers in the sequence.

  4. 4.

    Suppression

    The number of antibodies is limited to the number of primary population. A variety of solutions are maintained.

In the model of an artificial immune system, the antibody is a string of numbers representing the vertices, that is, in this example, the numbers of pharmacies listed in order of their supply:

$$[{\text{k}}_{ 1} ,{\text{k}}_{ 2} , \ldots ,{\text{k}}_{\text{n}} ]$$
(1)

where:

n:

number of delivery points,

ki :

the next delivery points, i = 1, …, n

Mutating is to change the order of the vertices. For the objective function in the distance traveled optimization, and for an affinity function the inverse of the objective function is assumed. In this way, the function matches the higher value of the distance length for the specified route that is less [10].

For the calculations the following objective function was adopted:

$${\text{f}} = {\text{w}}_{ 1} \frac{{\sum\nolimits_{{{\text{i}} = 1}}^{\text{n}} {{\text{d}}_{{{\text{k}}_{\text{i}} {\text{k}}_{{{\text{i}} + 1}} }} } }}{{{\text{d}}_{ \hbox{max} } }} + {\text{w}}_{ 2} \frac{{\sum\nolimits_{{{\text{i}} = 1}}^{\text{n}} {{\text{t}}_{{{\text{k}}_{\text{i}} {\text{k}}_{{{\text{i}} + 1}} }} } + {\text{t}}_{\text{dt}} }}{{{\text{t}}_{ \hbox{max} } }}$$
(2)

where:

n:

number of delivery points,

ki, kj :

the next delivery points; ki, kj∈[k1, k2, …, kn]

dki,kj :

distance from point ki to kj,

tki,kj :

travel time from point ki to kj,

w1, w2 :

weight coefficients,

dmax :

maximum path,

tmax :

maximum travel time,

tdt :

total delay time.

The total delay time is the sum of all delays. For example time windows in which another pharmacy is supposed to be supplied, are taken into account in such a way that if delay occurs the penalty for that is added to, and in case of supplier’s earlier arrival to the point, it is assumed that the driver is waiting for the time of scheduled opening time of pharmacy. Service time is calculated only from the opening time of each pharmacy. The restrictions were taken into account in the form of a penalty function, which is the size beyond the limits which are multiplied by coefficients of large numerical values.

The results of calculations are presented in Table 4. The shortest received route is a fourth route with a length of 157.2 km. The calculations do not take into account the restrictions on time windows for individual pharmacies but the algorithm, which was used to calculate, copes well with such problems.

Table 4 Transport routes determined with artificial immune system

4 Conclusions

Table 5 presents the final comparison of the current state with the propositions to distribute medicines in the distribution channel of case study, determined with the branch and bound method (using TSPSG application) and using an artificial immune system (own program).

Table 5 Comparative analysis of routes determined with artificial immune system

The values shown in previous table indicate the following conclusions:

  • best results were obtained using an artificial immune system,

  • total distance of the best result is reduced by 15 km as compared to the status quo and 6.4 km resulting from the branch and bound method.