Fuzzy logic can be applied in various areas of business. Some examples of its application are in air and water traffic [
22], for regulating traffic lights [
22], for determining the justification of investment in the vehicle fleet [
23], etc. The purpose of this chapter is to apply fuzzy logic to the described distribution pricing problem to solve it. In other words, fuzzy logic will be used to create a model that will calculate the cost of distribution. First of all, it should be noted that fuzzy logic is a branch of logic that is intended for modeling indistinctive or imprecise statements. Fuzzy logic tries to create a model that will imitate the way a person makes decisions in certain situations. It is suitable for application in situations where there are not enough data, when these data are not precise enough, or when something cannot be described deterministically. Fuzzy logic is defined as logic that uses the degree of belonging of an element to a set, instead of determining whether an element belongs or does not belong to a set [
22]. The literature used to create a fuzzy logic system, starting from the definition of variables, through the rule base, and up to the defuzzification of one value from the output variable, is the book [
22] and the paper [
24]. Mat lab and Fuzzy Toolbox will be used to create and implement a fuzzy logic system. The basic elements of the fuzzy logic system, as well as the process of creating that system, are shown in
Figure 4.
In the beginning, it should be noted that the fuzzy logic will be used to calculate the variable part of the distribution price, while the fixed part will depend only on the distance and the price per kilometer traveled, which can be seen from the scheme shown in
Figure 5. The variable part determined by the fuzzy logic depends on four criteria: inaccessibility of the client’s location, driving time, quantity of goods, and unloading time. The idea is that the fixed part of the distribution price is determined before the distribution is realized, and that the additional value calculated using fuzzy logic is added only after the service has been realized. The reason for this is that, for example, the driving time may vary depending on the road conditions, so it will not always be the same for the same delivery. Also, the loading and unloading time depends on the number of pallets being transported, as well as the weight of those pallets, the sensitivity of the goods, etc. so that is also a criterion that cannot be determined in advance. The reason for taking this criterion into account is that the model is formed to determine the price of distribution to vehicles equipped with an unloading crane. In the case of using vehicles that do not have the possibility of unloading, this criterion can be neutralized by setting the value for the unloading time to 0. Customer availability is a criterion that can only be determined after the delivery has been made and is evaluated by the driver. The criterion of the quantity of goods is the only criterion from the fuzzy logic model that can be determined before the realization of the service. The model created in this way is suitable for application today due to the COVID-19 pandemic, the war in Ukraine, and other events in the world that affect the instability of the market. Nowadays, the price of fuel changes on a daily basis, so the idea of this model is that the fixed part of the base allows for a simple correction of the price of transportation due to an increase or decrease in the price of fuel. In this way, both the fixed and variable parts of the distribution price base achieve great flexibility and adaptability to newly emerging situations on the market, as well as during the realization of the distribution service.
3.1. Input Variables
The first step in applying fuzzy logic is to define the input and output variables for the defined problem. The cost of distribution can be affected by numerous factors, some of them having a greater and some smaller influence. The biggest influence on the cost of distribution, in addition to the distance traveled, are the factors chosen as input variables, already mentioned at the beginning of this chapter:
Figure 6 shows what the defined fuzzy logic system for determining the price of the distribution service looks like. From the figure, it can be seen that the four input variables listed above are defined, which determine the variable part of the distribution price base, which is the output variable.
In
Figure 7 (below), all four input variables are shown. The model was tested on triangular and trapezoidal fuzzy numbers. Testing on examples from practice led to the conclusion that the model works better when triangular fuzzy numbers are used. In case the model is applied in practice, the model can be updated by introducing a greater number of membership functions to make the model work better. For the purposes of this paper, during testing, the model proved to be good enough with three membership functions for each of the variables. The first input variable is the inaccessibility of the client’s location. The inaccessibility of the client’s location depends on whether he is in the city center or on the outskirts, in a hilly area or the plains. The domain of the first input variable ranges from 0% to 100%, where 100% indicates high inaccessibility to the client location and 0% indicates low. Due to the inaccessibility of the client’s location, when distributing goods, their price also increases. The main reason for this is the fact that vehicles in the central parts of the city move following the “start-stop” principle, and in this way, besides consuming more fuel, depreciation is also higher. The situation is similar when the client is on a hill or mountain, so the vehicle consumes more fuel due to the climb, as well as the brakes when braking. The location of the client as an input variable is represented by three triangular fuzzy numbers. The domain of the first input variable is divided into three intervals. The first fuzzy number is represented by the membership function called “low inaccessibility” and it is defined on the interval from 0% to 40%. The highest degree of belonging to the membership function “low inaccessibility” occurs if the distribution is made to a client whose location is rated with low inaccessibility of 0% (client on the outskirts of the city in the plain) and then it amounts to one. The membership function “medium inaccessibility” is defined on the interval from 10% to 90%. The degree of belonging to the “medium inaccessibility” function is one if the distribution is made to a client whose location is rated as 50% inaccessibility. The third membership function “high inaccessibility” is defined on the interval from 60% to 100%.
The second input variable is driving time and its domain ranges from 0 to 540 min. The driving time, i.e., the duration of the distribution, can be affected by numerous factors and it can very often be longer than planned. This happens in case of congestion, when the delivery is made in the so-called “peak hours”, when the vehicle breaks down, or in a similar situation. The longer the distribution process, the higher the distribution price, given that the driver’s working hours are longer and that the given vehicle is occupied (that is, it is not free for other clients). From
Figure 7b, it can be seen that the driving time as the second input variable is represented by three triangular fuzzy numbers, the same as in the case of the previously described variable. The domain of this variable is also divided into three intervals. The first fuzzy number is represented by the membership function called “short time” and it is defined on the interval from 0 to 216 min. The membership function “mean time” is defined on the interval from 55 to 486 min. If the distribution lasts 270 min, the degree of belonging to the “mean time” function is one. The third membership function “long time” is defined on the interval from 320 to 540 min.
The third input variable is the amount of goods and its domain ranges between 0 and 25 tons, according to the maximum carrying capacity of the semi-truck. This variable depends exclusively on the client and his need for a certain amount of goods. The higher the quantity of goods, the higher the cost of distribution. The reason for this is, first of all, that a larger quantity requires vehicles with a higher load capacity, and these vehicles cause higher costs (they consume more fuel, and the costs of maintenance and registration are higher). Also, a larger quantity of goods for one client decreases the capacity of the cargo space, therefore decreasing the possibility to transport goods for some other clients in the same tour. This is another reason why the price increases as the quantity increases. Like the previous two input variables, the quantity of goods is also represented by three membership functions that have a triangular shape, which can be seen in
Figure 7c. The first fuzzy number is represented by the membership function called “small amount” and it is defined on the interval from 0 to 10 t. The membership function “medium amount” is defined on the interval from 2.5 to 22.5 t. If 12.5 t of goods are transported, the degree of belonging to the “medium quantity” function is one. The third membership function, “large quantity”, is defined on the interval from 15 to 25 t.
The fourth input variable is the time it takes for the goods to be loaded or unloaded at the end user’s place. This time depends on several factors. First of all, it depends on the amount of goods, but also on the equipment used, the type of goods, the position of the place where the goods are unloaded, etc. This variable is important because longer loading/unloading times increase the cost of distribution. This is a consequence of the fact that the longer unloading or loading takes, the longer the vehicle and equipment are occupied, and the driver’s working hours are longer. The domain of this input variable ranges from 0 to 120 min. From
Figure 7d, it can be seen that the input variable, loading/unloading time, is represented by three triangular membership functions. The first membership function “short time” is defined on the interval from 0 to 48 min. The second membership function is “mean time”, and it is defined on an interval from 12 to 108 min, and the highest degree of belonging to this function is if the loading/unloading time is 60 min when it has a value of one. The third membership function is defined on the interval from 72 to 120 min and is called “long time”.
3.4. Additional Factors Affecting the Cost of Distribution
In addition to the mentioned input variables, three more factors cannot be represented by a fuzzy number and must be considered when determining the distribution price. These are the type of vehicle used to transport the goods, the service quality, and the type of goods being transported. These parameters will be considered through a coefficient defined according to the importance and impact of a given parameter on the distribution price. All the coefficients from
Table 1 were defined by experts, based on the experience of employees in company “X”. The idea is to multiply the corresponding coefficient with the calculated basis of the distribution price according to expression (1). The resulting value is added to (or subtracted from) the calculated base, to obtain the final price of the distribution service.
Table 1 shows the factors, the groups formed within those factors, and the coefficients belonging to them.
The first factor that is very important and should have an impact on the distribution price is the type of vehicle. The reason for this is that the type of vehicle used for distribution directly affects fuel consumption, and therefore should also affect the price of distribution. With this factor, it is defined that from the base, that is, from the price calculated after adding the variable part given by the model, it is necessary to subtract the value obtained by multiplying the base with the coefficient. This is defined due to the assumption that the base is calculated for distribution carried out by semi-trucks. In such a situation, when a semi-truck is used, the coefficient is 0 and there will be no basis reduction. However, when smaller vehicles are used, fuel consumption is also lower, so the cost of distribution should be lower. For this reason, the coefficient is 0.65 for vans and 0.35 for trucks. The coefficients are defined proportionally with the consumption of vehicles of that type, and if it is considered that the truck consumes 35% less fuel compared to the semi-truck, then the basis must be reduced by the amount of the basis*0.35. It should be noted that this factor considers the driver’s labor costs, as well as vehicle maintenance costs. Namely, driving larger vehicles such as a semi-truck requires more qualified drivers compared to vans and solo trucks, so the distribution price should be different. Likewise, the maintenance of semi-trucks and solo trucks is much more expensive compared to vans in terms of more expensive equipment (tires and other parts), more expensive vehicle registration, more expensive repairs, and the like.
An essential part of the distribution price should be the quality of the service. Quality should be included in the price in such a way that if the distributor does his job properly, he will be rewarded for it, or if he is not, he will be punished. For example, if the distributor respects the client’s time windows, delivers the right goods to the right place, or in some way increases the value of the service to the end user, then he should be rewarded by increasing the distribution price. Conversely, if there is a delay in delivery, if the goods are damaged in transit, or if the distributors deliver the wrong goods, then they should bear the consequences by reducing the cost of distribution. Accordingly, the service quality factor can be rated from 1 to 9. The customer is obliged to rate the quality of the service after each realized distribution service. In this way, the distributor receives an average rating for the quality of his services, based on which he has the right to charge more or less for his service. If his average score is less than 5, the distributor will be obliged to charge less for his service, and if his service has an average score higher than 5, he has the right to increase the total price of the distribution of goods. The final price of the distribution service is obtained when the calculated value is increased or decreased by the corresponding percentage from
Table 1, depending on the average score that the distributor has on the quality account.
The quality of the service will be included in the price of distribution and through penalties that distributors pay in the case of deviations. This approach is most often used in practice, and that is why, in the case of some irregularities, the quality factor is best considered through the aforementioned penalties [
1]. The proposal is that in the case of certain defects, the distribution price is reduced by 10–30%. The percentage of the price reduction depends on how much the deviation affects the client and his further workflow. Some of the deviations are delivery delays, damage during delivery, lack of documentation, and the like. On the other hand, if the distributor does not deliver the goods to the client, the client is not obliged to pay the distribution contractor, i.e., the penalty is 100%. The most common penalties that reduce the cost of distribution by 10–30% are [
25]: unjustified delay to the place of loading more than 60 min, unjustified delay to the place of loading more than 30 min (when it comes to a meat, fruit, and vegetables warehouse), failure to arrive at the place of loading, late invoicing or incorrect invoice, non-delivery of route documentation by the service provider, behavior of the driver deviating from the contractual obligations, delay in returning packaging for meat-containers and ships by 7:00 p.m., non-receipt of return packaging at the facility-pallets, ships, and others, non-compliance with transport conditions related to HACCP regulations
When it comes to the factor of the type of goods, for the developed model, three categories of goods will be considered: perishable goods, goods that require special handling, and goods sensitive to moisture. Perishable goods include foods such as milk, meat, eggs, fish, and the like. The mentioned goods are transported in refrigerators that provide them with the appropriate temperature regime. Refrigerators belong to a type of vehicle that is very expensive from the distributor’s point of view in terms of fuel consumption, but also maintenance. Refrigerators for the transport of perishable goods must work non-stop and maintain the temperature during transport, so the fuel consumption is much higher compared to classic vehicles, and therefore the cost of distribution. Namely, even when the driver takes a break of 11 h, the refrigerator must work for all 11 h, so that the product does not spoil. In the case when the transport of perishable goods takes up to 9 h, then the distribution price must be increased by using a coefficient of 0.2. On the contrary, if the transport lasts more than 9 h and includes the mentioned break of 11 h, then the distribution price needs to be additionally increased by the amount of the costs of operating the cold store during those 11 h.
As for goods that require special handling, this includes dangerous, expensive, and breakable goods. Unlike the previous one, ordinary vehicles are used in this category, so the distribution price does not need to be increased due to fuel consumption. The main reason for the increase in the distribution price for this category of goods is the greater responsibility of the transport company. There are much greater risks when transporting the mentioned types of goods than in the case of ordinary goods. If some expensive goods are being transported, there must be adequate protection in the form of an alarm to prevent theft, and this requires additional costs for the carrier. Also, if some dangerous goods are being transported, it requires special caution and a way of handling them so that there are no explosions and other unwanted consequences. Due to the aforementioned facts, the coefficient 0.1 will be used for goods that require special treatment to increase the distribution price.
The third category includes goods that are sensitive to moisture, such as building materials, wheat, barley, and corn. These types of goods do not require a special temperature regime, but only to protect the goods from weather conditions by placing a tarpaulin. In that case, putting a tarpaulin increases the weight of the vehicle, and thus the fuel consumption, so it is necessary to increase the cost of distribution. Given that the consumption is much lower compared to a refrigerator, and the risk is much lower compared to goods that require special treatment, then for goods that are sensitive to moisture, a coefficient of 0.05 should be used to increase the distribution price.
It should be noted that the aforementioned division into three categories was made for the developed model for calculating the distribution price. Since there are many different types of goods, it is possible to make a much more detailed and precise classification in the case of developing some more complex models for calculating the distribution price. As before, the distribution price in the case of a certain type of goods is increased by adding to the base the amount obtained by multiplying the base and the corresponding coefficient.