CN116227773A - Distribution path optimization method based on ant colony algorithm - Google Patents

Distribution path optimization method based on ant colony algorithm Download PDF

Info

Publication number
CN116227773A
CN116227773A CN202310239120.6A CN202310239120A CN116227773A CN 116227773 A CN116227773 A CN 116227773A CN 202310239120 A CN202310239120 A CN 202310239120A CN 116227773 A CN116227773 A CN 116227773A
Authority
CN
China
Prior art keywords
vehicle
points
point
pheromone
demand
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310239120.6A
Other languages
Chinese (zh)
Inventor
李春晖
马仲能
吴志刚
韩卫民
马志刚
谭韵
黄林泽
周松涛
梁展鸿
梁远星
叶润森
赖莉敏
高子弋
望明明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Power Supply Bureau of Guangdong Power Grid Co Ltd
Original Assignee
Guangzhou Power Supply Bureau of Guangdong Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Power Supply Bureau of Guangdong Power Grid Co Ltd filed Critical Guangzhou Power Supply Bureau of Guangdong Power Grid Co Ltd
Priority to CN202310239120.6A priority Critical patent/CN116227773A/en
Publication of CN116227773A publication Critical patent/CN116227773A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G06Q10/047Optimisation of routes or paths, e.g. travelling salesman problem
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/067Enterprise or organisation modelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Physics & Mathematics (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Game Theory and Decision Science (AREA)
  • Educational Administration (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to the field of path optimization algorithms, in particular to a distribution path optimization method based on an ant colony algorithm, which comprises the following specific implementation steps: setting up a mathematical model, setting parameters and decision variables of the model, and making objective functions and constraint conditions; improving the design of an ant colony algorithm, initializing parameters of the ant colony algorithm, setting starting points of artificial ants, and selecting a next to-go customer demand point; after all ants walk through all customer demand points, calculating path length and cost, storing the path length and cost, and carrying out next global pheromone update through pheromone update regulation; and searching the optimal solution space, and outputting the shortest path length and the optimal path. According to the invention, the vehicle for distribution is planned in advance, the vehicle loading rate is improved through scientific quantitative calculation, unnecessary cost and mileage of vehicle distribution are reduced, the distribution speed is further improved, the transportation cost is reduced, and the high benefit of the distribution link is realized.

Description

Distribution path optimization method based on ant colony algorithm
Technical Field
The invention relates to the field of path optimization algorithms, in particular to a distribution path optimization method based on an ant colony algorithm.
Background
The transportation business of the electric materials in the warehouse at present is mainly divided into two types, one is the distribution of the conventional materials, namely, the distribution business in a distribution list is often mentioned; the other is the distribution of first-aid kit services. The two businesses are responsible by different logistics companies, different charging modes exist, the distribution charging mode of conventional electric materials is simple, the conventional electric materials are not calculated according to the running mileage of a vehicle, a batch of goods are taken from a warehouse according to the number of times, the goods are respectively sent to different places for one time, and the materials distributed by a dispatcher according to the needs are randomly arranged. The delivery date and delivery location of the first-aid kit service are fixed, the fee is charged according to the mileage of delivery, the path of the delivery process is random, and the first-aid kit service is delivered within a specified time.
In the transportation and delivery link, the transportation cost and the labor cost of the vehicle occupy a large proportion in the total cost, and on the premise of meeting the requirements of the end user, the high-benefit management of the transportation link is beneficial to saving the cost and improving the transportation efficiency. However, at present, the distribution links in the warehouse are not reasonably processed, the charging standards of various distribution businesses are different, and the time for transporting materials is uncertain, so that the conditions of low loading rate of distribution vehicles, low space utilization rate of vehicles and non-optimal vehicle distribution paths are caused, and the unnecessary transportation cost is increased. Therefore, the vehicle loading rate can be improved through scientific quantitative calculation, and the mileage of vehicle delivery is reduced, so that the high benefit of the delivery link is realized.
The most important and key technical problems in the current research are that a vehicle for arranging delivery is not planned in advance in a specific and reasonable way, the delivery path is not selected properly, unnecessary cost is caused, meanwhile, the loading rate of the vehicle is not evaluated in a related way when conventional materials are delivered, and the loading rate of the vehicle is low. Therefore, on the premise of being based on various cost conditions, an improved ant colony algorithm is provided for establishing a distribution path optimization model, and the factors such as the carrying capacity, the length and width of the carrier vehicles, the number of the carrier vehicles and the traffic jam coefficient are comprehensively considered to solve the problems, so that the maximum distribution tasks, the minimum use of vehicles and the improvement of the distribution speed are realized, and the aims of reducing the transport capacity cost and providing the transport efficiency are achieved.
It should be noted that the information disclosed in the foregoing background section is only for enhancement of understanding of the background of the invention.
Disclosure of Invention
The invention aims to provide a distribution path optimization method based on an ant colony algorithm, so that the aims of achieving the maximum distribution tasks, using the minimum vehicles and improving the distribution speed, thereby reducing the transport capacity cost and providing the transport efficiency are fulfilled.
The technical scheme of the invention is as follows: a distribution path optimization method based on an ant colony algorithm comprises the following steps:
setting up a mathematical model, setting parameters and decision variables of the model, and making objective functions and constraint conditions;
the mathematical model is used for improving the design of the ant colony algorithm, initializing the parameters of the ant colony algorithm and setting the starting points of artificial ants, and selecting the next to-be-sent customer demand point according to the design transition probability;
after all ants walk through all customer demand points, calculating path length and cost, storing the path length and cost, and carrying out next global pheromone update through pheromone update regulation;
and searching the optimal solution space through pheromone updating, and finally outputting the shortest path length and the optimal path.
Based on the scheme, the situation that the vehicle is distributed to the customer demand points is simulated by using the walking path behaviors of the artificial ants.
Based on the foregoing solution, the method for building a mathematical model includes:
s11: a model is assumed, wherein the contents of the model assumptions include, but are not limited to:
the method comprises the steps that a plurality of warehouses, demand points and geographic position information are provided, and the path distance between any two points is known;
the warehouse has known material information and vehicles;
the transport vehicle has a plurality of transport vehicles which are mutually different and have unique numbers, the transport weight and the length, width and height of a container are known, and the transport vehicle can meet the demand of transport tasks;
each order distribution information, the warehouse point for storing the materials, the corresponding demand point information, the weight, length and width of the demand materials are known;
the fixed cost per delivery vehicle is known;
the travel speed and the maximum operating time period of each vehicle are known.
S12: setting parameters and decision variables of a model, wherein the contents of the model parameters and decision variables include but are not limited to:
p warehouses O p N distribution demand points O P+N Demand materials G of each demand point n The number of kinds is n, and the demand of each material is c 1 、c 2 、……c n Length of supplies l n Width f of material n Height h of supplies n Number S of vehicles owned by warehouse i i Load-bearing capacity of the kth carrier vehicle corresponding to the p-th warehouse
Figure BDA0004123424660000031
Length of the cargo box of the kth carrier vehicle corresponding to the p-th warehouse +.>
Figure BDA0004123424660000032
Width->
Figure BDA0004123424660000033
Height->
Figure BDA0004123424660000034
From O i To O j Is a transport distance d of (2) ij Fixed costs (including labor costs, depreciation costs, management costs, etc.) r of the carrier vehicle 1 From O i To O j Traffic jam coefficient W due to environmental weather or the like on the path of (a) ij
Figure BDA0004123424660000035
Respectively represent the point O from which the vehicle k is driven i Travel to point O j The materials of the warehouse p are transported by a vehicle k, the materials of the demand point p are transported by the vehicle k, and the N-th demand point is transported by the vehicle k, wherein each mass is c n Is a material of the (a) and (b).
S13: formulating an objective function, wherein the model takes the minimum mileage and the minimum total cost as the objective function:
Figure BDA0004123424660000041
minZ 2 =R 1 +R 2
minZ 1 minimum mileage represented, minZ 2 Representing the lowest cost, R 1 For fixed cost, R 2 Is a transportation cost.
S14: formulating constraints, wherein the constraints of the model include:
condition a:
Figure BDA0004123424660000042
condition b:
Figure BDA0004123424660000043
Figure BDA0004123424660000044
Figure BDA0004123424660000045
condition c:
Figure BDA0004123424660000046
condition a indicates that the total demand for delivery of each vehicle cannot exceed its load carrying capacity; condition b indicates that the length, width and height of each device in the material distribution of each vehicle cannot exceed the length, width and height limit of the carrier vehicle; condition c indicates that the number of vehicles from the delivery point and returning is equal and cannot exceed the number of vehicles it owns.
Based on the foregoing, the fixed cost of the model objective function total cost is proportional to the number of vehicles dispatched, and the transportation cost is proportional to the number of mileage.
The fixed cost function expression is:
Figure BDA0004123424660000047
the transportation cost function expression is:
Figure BDA0004123424660000048
based on the foregoing, the above method for improving the design of the ant colony algorithm includes, but is not limited to:
initializing parameters of an ant colony algorithm, numbering customer demand points from 0, and recording the total number customer_number of the customer demand points;
setting the departure point of the vehicle k as a distribution center, wherein the position number of the distribution center is 0, and the departure points of all vehicles are 0;
vehicle k selects the next customer demand point to go by calculating the probability of transition between demand points after departure from the departure point and then using roulette.
Based on the above scheme, the vehicle k introduces a traffic jam coefficient after starting at the starting point to calculate the transition probability between the demand points, and the calculation formula of the transition probability is as follows:
Figure BDA0004123424660000051
aggregate allowed k To store customer demand points that the vehicle k has not reached after reaching customer demand point i; alpha is the importance factor of pheromone, tau ij(t) The pheromone content between the customer demand points ij; beta is a heuristic importance factor; heuristic function of eta ij (t)=1/d ij ;W ij (t) is traffic jam coefficient, and different from general calculation, the traffic jam coefficient W is added in this scheme ij The distribution efficiency is improved. The traffic jam coefficients have more influencing elements, such as ambient weather, vehicle type, etc., and the metrics thereof are different. In the scheme, the time measurement required by running at every two client demand points is queried in real time according to the map APP, and the smaller the required time is, the smaller the traffic jam coefficient is. Assuming that the vehicle is at the departure point and the time from the departure point to the other customer demand point is known, the traffic congestion factor between the two customer demand points is the time taken from the departure point to the point and the time taken from the departure point to the other customer demand pointThe ratio of the sum of the time from the departure point to the other customer demand points is 0 for the diagonal elements of the traffic congestion coefficient matrix. The smaller the traffic congestion factor, the greater the probability of being selected.
Based on the foregoing scheme, the vehicle k selects the next customer demand point to be sent by using the roulette method after calculating the transition probability, generates a random number between (0, 1), and selects the customer demand point corresponding to the selected probability that is greater than the random number and closest to the random number as the next customer demand point to be sent. When the probability of being selected is not met, a path is randomly generated at the non-accessed client demand point and is used as the next client demand point, so that the randomness of path selection is increased while solution is ensured.
Based on the scheme, the pheromone updating adopts the ant week model with global updating to solve the pheromone increment.
Based on the foregoing scheme, the pheromone update protocol is: when all ants walk all the customer demand points, m paths are formed, the total amount of the pheromone between any two points is updated and modified, and the total amount of the pheromone between the two points is calculated according to the following formula: τ ij(t+1) =(1-ρ)τ ij(t) +Δτ ij Wherein (1- ρ) τ ij(t) For the remaining information of the last iteration, Δτ ij And adding information for the iteration.
Based on the foregoing scheme, the above-mentioned calculation process of the pheromone between any two points is a calculation process of the pheromone between any two customer demand points ij: pheromone Q/L of kth ant added between jth city and (j+1) th city k The sum of the pheromones added by all ants between the jth city and the (j+1) th city obtains the pheromones added between the jth city and the (j+1) th city of the iteration, and the calculation formula is as follows:
Figure BDA0004123424660000061
Figure BDA0004123424660000062
q is a pheromone constant, and represents the total amount of the pheromone released by ants after circulation once, L k The total length of the path traversed by the current iteration is the kth ant.
Based on the above scheme, the specific steps of the design of the improved ant colony algorithm are as follows:
s220: setting an algorithm initial value;
s221: setting a departure point of a vehicle k, wherein a Zhong Cun warehouse is a distribution center, the position number is 0, and all the departure points of the vehicles are started at the position 0; setting the number m of the artificial ants to be 1.5 times of the client demand point; each complete iteration generates m complete paths for ants to walk, and all client demand points are required to be accessed;
s222: setting iteration times iter_begin=iter_begin+1, and executing each step;
s223: calculating the transition probability of m ants according to a transition probability formula, and randomly generating one client demand point serving as the next client demand point of the path when the selected probability is not met, wherein the vehicle meets constraint conditions in the delivery process;
s224: when m ants visit all client points, calculating distribution cost and storing paths;
s225: updating the pheromone;
s226: judging the iteration times, stopping iteration if the preset maximum iteration times are reached, outputting an optimal result, and otherwise, turning to step S33.
The beneficial effects of the invention are as follows:
on one hand, the invention provides a distribution path optimization method based on an improved ant colony algorithm, and a multi-objective model is built by integrating various distribution costs, vehicle loading rates and vehicle space utilization rates aiming at less consideration of the influence of traffic conditions on distribution in the current research, so that the transportation cost is reduced, the transportation efficiency is provided as a target to design the improved ant colony algorithm, and a related theoretical basis is provided for the transportation distribution research field of electric power logistics.
On the other hand, the traffic jam coefficient is introduced in the node selection process of the traditional ant colony algorithm to adjust the calculation formula of the transfer probability function, so that the method is closer to the actual running condition of the vehicle to a certain extent, and the transportation efficiency is improved.
In the last aspect, when the transition probability is calculated and the selected probability is not satisfied, the method randomly generates one client demand point serving as the next client demand point of the path at the client demand point which is not accessed, and increases the randomness of the path selection while guaranteeing the solution, thereby realizing the high benefit of the distribution link.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a distribution path optimization method based on an ant colony algorithm;
FIG. 2 is a schematic flow chart of a method of digital modeling in an embodiment of the invention;
FIG. 3 is a schematic diagram of position coordinates of 5 customer demand points according to an embodiment of the present invention;
FIG. 4 is a Euclidean distance calculated for 5 customer demand points in an embodiment of the present invention;
FIG. 5 is a schematic diagram of Euclidean distance matrix coordinates of 5 customer demand points according to an embodiment of the present invention;
fig. 6 is a flow chart of the improved ant colony algorithm of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is specifically noted that the following examples are only for illustrating the present invention, but do not limit the scope of the present invention. Likewise, the following examples are only some, but not all, of the examples of the present invention, and all other examples, which a person of ordinary skill in the art would obtain without making any inventive effort, are within the scope of the present invention.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
First, the terms in the present invention will be explained:
the ant colony algorithm (ant colony optimization, ACO) is a probabilistic algorithm for searching for an optimized path, and is a bionic optimization algorithm based on real ant colony foraging behavior in nature. Each ant forges and leaves a substance called pheromone on the way through, and the ants transmit information by sensing the concentration of the substance. Ants always tend to move towards the direction of high information cable concentration when selecting paths, but more ants walk on paths with short distance, more pheromones remain, and the larger the probability that the subsequent ants select the ants; pheromones on other paths are volatilized continuously along with the time; the ant search process is continuously converged, the optimal solution is finally approximated, and the whole ant colony is gathered on the shortest path. This creates a positive feedback mechanism. The ant algorithm is an intelligent algorithm, and the intelligent behavior of the ant colony is shown by individuals without intelligence or with slight intelligence through mutual cooperation, so that a new method is provided for solving the complex problem. The algorithm has the characteristics of distributed calculation, information positive feedback and heuristic search, and is essentially a heuristic global optimization algorithm in the evolutionary algorithm.
Roulette selection (roulette wheel selection) is proposed to prevent individuals with smaller fitness values from being directly eliminated, in which method the concept of "fitness" and "cumulative probability" is introduced, wherein the probability that each part is selected is proportional to its fitness value, the greater the fitness, the greater the probability of selection. The selection of individuals in practice in making roulette selections is often not based on the individual's probability of selection, but rather on a "cumulative probability". The cumulative probability represents the sum of the selection probabilities of all individuals before each individual, which corresponds to the "span" on the carousel, the larger the "span" the easier it is to select.
The invention is further described below in connection with specific embodiments.
Example 1
As shown in fig. 1, the present embodiment provides a distribution path optimization method based on an ant colony algorithm, and the method includes the steps of:
s1: setting up a mathematical model, setting parameters and decision variables of the model, and making objective functions and constraint conditions;
s2: the mathematical model is used for improving the design of the ant colony algorithm, initializing the parameters of the ant colony algorithm, setting the starting points of artificial ants, and selecting the next client demand point;
in this embodiment, the walking path behavior of the artificial ants simulates the situation of the vehicle delivering to the customer demand point.
S21: initializing parameters of an ant colony algorithm, numbering customer demand points from 0, and recording the total number customer_number of the customer demand points;
in this embodiment, preferably, when initializing parameters, the positions of customer demand points (i.e. power generation stations for carrying first-aid kits to each area) to which the vehicle needs to go are obtained according to the materials loaded by the vehicle, the customer demand points are numbered from 0, and the positions of the customer demand points in the position matrix are the numbers corresponding to the customer demand points, and in this embodiment, the position coordinate data of 5 customer demand points are exemplarily shown, and are respectively: [68.0,153.0],[468.0,868.0],[651.0,750.0],[913.0,578.0],[362.0,651.0].
In this embodiment, fig. 3 preferably illustrates a position coordinate diagram of 5 customer demand points.
S22: setting the departure point of the vehicle k as a distribution center, wherein the position number of the distribution center is 0, and the departure points of all vehicles are 0;
in this embodiment, preferably, the distance that can be walked before two points of the client demand point is queried through the map APP, or the euclidean distance matrix between any two points is obtained by calculating using the position coordinates of each client demand point, and the euclidean distance matrix is in kilometers.
Specifically, in the euclidean distance matrix, the i-th row represents the distance from the i-th customer demand point to other points, where the element of the diagonal is 0. In this embodiment, FIG. 4 illustrates an exemplary distance matrix of 5 customer demand points.
Further, in the present embodiment, fig. 5 exemplarily shows a schematic diagram of euclidean distance matrix coordinates of 5 client demand points.
In this embodiment, it is preferable to set all vehicle departure points to start at position 0, with only one distribution center having position number 0. Further, the number m of the artificial ants is set to be 1.5 times of the customer demand point, and the artificial ants are rounded up. Each iteration produces m complete paths for ants to walk, requiring access to all customer demand points. Furthermore, the number m of the set artificial ants is 1.5 times of the customer demand point, if the number m is set too large, the pheromones on each path tend to calm, the positive feedback effect of the ant colony algorithm is weakened, and therefore the algorithm convergence speed is weakened; if the number is set too small, it may result in some never-explored path pheromone concentration decreasing to 0, resulting in premature algorithm convergence and reduced global optimality of the solution.
S23: vehicle k selects the next customer demand point to go by calculating the probability of transition between demand points after departure from the departure point and then using roulette.
In this embodiment, the transition probability between the customer demand points indicates the probability of the vehicle k from the customer demand point i to the customer demand point j, the value of which is related to the distance between the two points and the pheromone concentration, and setting the relevant parameters can change the magnitude of the transition probability, and the value has a decisive effect on the selection of the path.
The calculation formula of the transition probability is as follows:
Figure BDA0004123424660000111
in the present embodiment, it is preferable that,τ ij(t) Is the pheromone content between the customer demand points ij.
Aggregate allowed k To store a customer demand point that the vehicle k has not reached after reaching customer demand point i, allowed is advanced over time k Continuously reducing the elements in the system until the system is empty, and indicating that all client demand points are accessed.
Alpha is a factor of importance degree of pheromone, reflects the relative importance degree of the amount of the pheromone accumulated on the path in the moving process of the ant in knowing the ant colony search, and the larger the value is, the greater the possibility that the ant selects the path is, and the greater the influence on the concentration of the pheromone on the path selection is; the smaller the value, the further the selection range of the next step of the ant colony is, and the easy sinking into the local optimum, in this embodiment, the value α takes 3.
Beta is a heuristic function importance factor, reflects the relative importance degree of heuristic information in guiding ant colony search, and the larger the value of the factor is, the larger the influence of the heuristic function on the transition probability is, the larger the convergence speed of an algorithm is, and the higher the convergence speed is, but the local optimum is easy to fall into; the smaller the value is, the smaller the influence of the heuristic function on the transition probability is, the smaller the convergence rate of the algorithm is, the ant colony is easy to fall into pure random search, and the optimal solution is difficult to find.
In the present embodiment, the heuristic function η ij (t)=1/d ij The expected degree of the vehicle from the demand point i to the demand point j is shown, the size of the expected degree is the reciprocal of the path distance between the two points i and j, and the shorter the distance between the customer demand point and the point is, the larger the probability of going to the vehicle is.
Specifically, the probability of the vehicle selecting the next-to-go customer demand point is primarily determined by τ ij(t) And eta ij (t) related, τ ij(t) And eta ij The pheromone importance factor alpha and the heuristic importance factor beta on (t) only determine the pheromone concentration and the contribution degree of the heuristic function to the possibility of the ant k/vehicle k from the demand point i to the demand point j.
After calculating the transition probability, if the selection directly depends on the transition probability, the global searching capability of the path is not strong, in this embodiment, the vehicle k preferably selects the next to-be-sent customer demand point by using a roulette manner. The span occupied by each customer demand point in the turntable is the probability of being selected, and the transition probability is taken as the probability of being selected. Further, a random number is generated between (0, 1), and a customer demand point which is larger than the random number and is closest to the random number and corresponds to the selected probability is selected as the next customer demand point. When the demand points are fewer, the probability of being selected without meeting the conditions is high, if 1 is added as the next customer demand point according to the number of the customer demand points in sequence, when the last access point is the maximum number, the next customer demand point cannot be found. Thus, in the present embodiment, when the probability of being selected is not satisfied, a path is randomly generated at the client demand point that is not accessed, as the next client demand point, and the randomness of the path selection is increased while ensuring the solution.
In this embodiment, there are preferably 5 customer demand points, and the vehicle departure point has been determined, and the transition probability for a certain iteration is: the values in the matrix are the transition probabilities from the start point to the other four customer demand points 0.183835230.173995570.119467880.52270132.
In the present embodiment, it is preferable to introduce the traffic jam coefficient W ij (t) inquiring the time measurement required by traveling at two client demand points in real time according to the map APP, wherein the smaller the required time is, the smaller the traffic jam coefficient is. Specifically, assuming that the vehicle is located at a departure point, the time from the departure point to other client demand points is known, and then the traffic congestion coefficient between the two client demand points is the ratio of the time taken from the departure point to the sum of the time taken from the departure point to the other client demand points, and the diagonal elements of the traffic congestion coefficient matrix are all 0. The smaller the traffic congestion factor, the greater the probability of being selected.
S3: after all ants walk through all customer demand points, calculating path length and cost, storing the path length and cost, and carrying out next global pheromone update through pheromone update regulation;
the pheromone updating adopts a globally updated ant week model to solve the pheromone increment.
S4: and searching the optimal solution space through pheromone updating, and finally outputting the shortest path length and the optimal path.
In this embodiment, the pheromone update protocol is: when all ants walk all the customer demand points, m paths are formed, the total amount of the pheromone between any two points is updated and modified, and the total amount of the pheromone between the two points is calculated according to the following formula: τ ij(t+1) =(1-ρ)τ ij(t) +Δτ ij Wherein (1- ρ) τ ij(t) The remaining information for the last iteration; Δτ ij For the information added in the iteration, the concentration of pheromones released by all ants on the connecting path of the demand point i and the demand point j is represented; ρ is a volatilization factor, namely the volatilization speed of the pheromone, reflects the vanishing level of the pheromone, is set too large, volatilizes the pheromone fast, has large difference of the content of the pheromone on each path, enlarges the ant searching range, accelerates the convergence speed of an algorithm, and increases the possibility of sinking into a local optimal solution; the volatilization factors are set to be too small, the pheromone volatilizes slowly, the pheromone content difference on each path is small, the overall optimal solution can be found, the convergence speed of the algorithm is slowed down, and in the embodiment, rho takes a value of 0.2.
The calculation process of the pheromone between any two client demand points ij comprises the following steps: pheromone Q/L of kth ant added between jth city and (j+1) th city k The sum of the pheromones added by all ants between the jth city and the (j+1) th city obtains the pheromones added between the jth city and the (j+1) th city of the iteration, and the calculation formula is as follows:
Figure BDA0004123424660000131
Figure BDA0004123424660000132
specifically, Q is a pheromone constant, which represents the total amount of pheromone released by ants in one cycle, and is taken in this embodimentValue 50, L k The total length of the path traversed by the current iteration is the kth ant.
And constructing a model design algorithm according to the steps of the method to solve the problem of optimizing the distribution paths of multiple demand points, and solving the vehicle distribution path with the shortest distance and the lowest cost by considering the traffic jam of the transportation vehicle and the limitation of the path length.
Example 2
Based on example 1, as shown in fig. 2, a method for constructing a mathematical model is provided, which includes the steps of:
s11: assuming a mathematical model;
in this embodiment: the method comprises the steps that a plurality of warehouses, demand points and geographic position information are provided, and the path distance between any two points is known;
the warehouse has known material information and vehicles;
the transport vehicle has a plurality of transport vehicles which are mutually different and have unique numbers, the transport weight and the length, width and height of a container are known, and the transport vehicle can meet the demand of transport tasks;
each order distribution information, the warehouse point for storing the materials, the corresponding demand point information, the weight, length and width of the demand materials are known;
the fixed cost per delivery vehicle is known;
the travel speed and the maximum operating time period of each vehicle are known.
S12: setting parameters and decision variables of a model;
in the present embodiment, it is preferable to set the model parameters: o (O) p 、O P+N 、G n 、c n 、l n 、f n 、h n 、S i 、C p k 、L p k 、F p k 、H p k 、d ij 、r 1 、W ij
This example illustrates model parameter meaning data, as shown in table 1:
TABLE 1
Figure BDA0004123424660000141
Figure BDA0004123424660000151
In particular the number of the elements to be processed,
Figure BDA0004123424660000152
respectively represent the point O from which the vehicle k is driven i Steering point O j The materials of the warehouse p are transported by a vehicle k, the materials of the demand point p are transported by the vehicle k, and the N-th demand point is transported by the vehicle k, wherein each mass is c n Is a material of the (a) and (b).
S13: formulating an objective function, wherein the objective function is as follows:
Figure BDA0004123424660000153
minZ 2 =R 1 +R 2
specifically, the model takes the minimum mileage and the minimum total cost as the objective function. MinZ 1 Minimum mileage represented, minZ 2 Representing the lowest cost, R 1 For fixed cost, R 2 Is a transportation cost.
S14: formulating constraints, wherein the constraints of the model include:
condition a:
Figure BDA0004123424660000154
condition b:
Figure BDA0004123424660000155
Figure BDA0004123424660000156
Figure BDA0004123424660000157
condition c:
Figure BDA0004123424660000158
specifically, condition a indicates that the total demand of delivery of each vehicle cannot exceed its carrying capacity, condition b indicates that the length, width and height of each device in the delivered material of each vehicle cannot exceed the length, width and height limit of the carrier vehicle, and condition c indicates that the number of vehicles from the delivery point and returning from the delivery point is equal and cannot exceed the number of vehicles owned by the vehicle.
Example 3
Based on embodiment 2, as shown in fig. 6, the present embodiment provides a method for improving the design of the ant colony algorithm, which specifically includes the steps of:
s220: setting an algorithm initial value;
s221: setting the departure point of the vehicle k as a distribution center, wherein the position number is 0, and starting all the departure points of the vehicles at the position 0; setting the number m of the artificial ants to be 1.5 times of the client demand point; each complete iteration generates m complete paths for ants to walk, and all client demand points are required to be accessed;
s222: setting iteration times iter_begin=iter_begin+1, and executing each step;
s223: calculating the transition probability of m ants according to a transition probability formula, and randomly generating a path at an unaccessed customer demand point as a next customer demand point when the selected probability is not met, wherein the vehicle meets constraint conditions in the delivery process;
s224: when m ants visit all client points, calculating distribution cost and storing paths;
in this embodiment, each time an ant iterates, the shortest path length and path trend generated by one iteration are recorded.
S225: updating the pheromone;
s226: judging the iteration times, stopping iteration if the preset maximum iteration times are reached, outputting an optimal result, and otherwise, turning to step S222.
In the embodiment, the termination condition is that iterBegin is equal to or greater than the iteration, i.e. the maximum iteration number is reached. And taking the minimum value of the shortest path length generated by each iteration and the path trend thereof as the output of the final result.
In summary, compared with the conventional path planning using the ant colony algorithm, the distribution path optimization algorithm based on the ant colony algorithm mainly considers the traffic jam and the limitation of the path length of the transportation vehicle, adjusts the calculation formula of the transfer probability function, increases the randomness of the path selection under the condition of ensuring solutions, and simultaneously adjusts the vehicle loading rate in a related manner, so that the distribution path optimization algorithm is closer to the actual form of the vehicle, thereby improving the distribution efficiency and reducing the transportation cost.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims. It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A distribution path optimization method based on an ant colony algorithm, the method comprising:
setting up a mathematical model, setting parameters and decision variables of the model, and making objective functions and constraint conditions;
the mathematical model is used for improving the design of the ant colony algorithm, initializing the parameters of the ant colony algorithm, setting the starting points of artificial ants, and selecting the next client demand point;
after all ants walk through all customer demand points, calculating path length and cost, storing the path length and cost, and carrying out next global pheromone update through pheromone update regulation;
and searching the optimal solution space through pheromone updating, and finally outputting the shortest path length and the optimal path.
2. The ant colony algorithm-based distribution path optimization method according to claim 1, wherein: the behavior of the walking path of the artificial ants is used for simulating the distribution of the vehicles to the customer demand points.
3. The ant colony algorithm-based distribution path optimization method according to claim 1 or 2, characterized in that: the method for constructing the mathematical model comprises the following steps:
s11: a model is assumed, wherein the contents of the model assumptions include, but are not limited to:
the method comprises the steps that a plurality of warehouses, demand points and geographic position information are provided, and the path distance between any two points is known;
the warehouse has known material information and vehicles;
the transport vehicle has a plurality of transport vehicles which are mutually different and have unique numbers, the transport weight and the length, width and height of a container are known, and the transport vehicle can meet the demand of transport tasks;
each order distribution information, the warehouse point for storing the materials, the corresponding demand point information, the weight, length and width of the demand materials are known;
the fixed cost per delivery vehicle is known;
the travel speed and the maximum operating time period of each vehicle are known.
S12: setting parameters and decision variables of a model, wherein the contents of the model parameters and decision variables include but are not limited to:
p warehouses O p N distribution demand points O P+N Demand materials G of each demand point n The number of kinds is n, and the demand of each material is c 1 、c 2 、……c n Length of supplies l n Object(s)Resource width f n Height h of supplies n Number S of vehicles owned by warehouse i i Load-bearing capacity of the kth carrier vehicle corresponding to the p-th warehouse
Figure FDA0004123424650000021
Length of the cargo box of the kth carrier vehicle corresponding to the p-th warehouse +.>
Figure FDA0004123424650000022
Width of (L)
Figure FDA0004123424650000023
Height->
Figure FDA0004123424650000024
From O i To O j Is a transport distance d of (2) ij Fixed costs (including labor costs, depreciation costs, management costs, etc.) r of the carrier vehicle 1 From O i To O j Traffic jam coefficient W due to environmental weather or the like on the path of (a) ij
Figure FDA0004123424650000025
Respectively represent the point O from which the vehicle k is driven i Travel to point O j The materials of the warehouse p are transported by a vehicle k, the materials of the demand point p are transported by the vehicle k, and the N-th demand point is transported by the vehicle k, wherein each mass is c n Is a material of the (a) and (b).
S13: formulating an objective function, wherein the model takes the minimum mileage and the minimum total cost as the objective function:
Figure FDA0004123424650000026
minZ 2 =R 1 +R 2
minZ 1 minimum mileage represented, minZ 2 Representing the lowest cost, R 1 For fixed cost, R 2 Is a transportation cost.
S14: formulating constraints, wherein the constraints of the model include:
condition a:
Figure FDA0004123424650000027
/>
condition b:
Figure FDA0004123424650000028
Figure FDA0004123424650000029
Figure FDA00041234246500000210
condition c:
Figure FDA00041234246500000211
condition a indicates that the total demand for delivery of each vehicle cannot exceed its load carrying capacity; condition b indicates that the length, width and height of each device in the material distribution of each vehicle cannot exceed the length, width and height limit of the carrier vehicle; condition c indicates that the number of vehicles from the delivery point and returning is equal and cannot exceed the number of vehicles it owns.
4. A distribution path optimizing method based on ant colony algorithm according to claim 3, characterized in that: the fixed cost of the model objective function total cost is proportional to the number of vehicles dispatched, and the transportation cost is proportional to the mileage.
The fixed cost function expression is:
Figure FDA0004123424650000031
the transportation cost function expression is:
Figure FDA0004123424650000032
5. the ant colony algorithm-based distribution path optimization method according to claim 1 or 2, characterized in that: the methods of improving the design of the ant colony algorithm include, but are not limited to:
initializing parameters of an ant colony algorithm, numbering customer demand points from 0, and recording the total number customer_number of the customer demand points;
setting the departure point of the vehicle k as a distribution center, wherein the position number of the distribution center is 0, and the departure points of all vehicles are 0;
vehicle k selects the next customer demand point to go by calculating the probability of transition between demand points after departure from the departure point and then using roulette.
6. The ant colony algorithm-based distribution path optimization method according to claim 5, wherein the vehicle k introduces a transition probability between traffic jam coefficient calculation demand points after departure from a departure point, and the calculation formula of the transition probability is:
Figure FDA0004123424650000033
aggregate allowed k To store customer demand points that the vehicle k has not reached after reaching customer demand point i; alpha is the importance factor of pheromone, tau ij(t) The pheromone content between the customer demand points ij; beta is a heuristic importance factor; heuristic function of eta ij (t)=1/d ij ;W ij And (t) is a traffic jam coefficient.
7. The ant colony algorithm-based distribution route optimization method according to claim 5, wherein the vehicle k selects a next-going customer demand point by roulette after calculating the transition probability, generates a random number between (0, 1), selects a customer demand point corresponding to the selected probability that is larger than the random number and closest to the random number as the next-going customer demand point, and randomly generates a route at the non-accessed customer demand point as the next customer demand point when the selected probability is not satisfied.
8. The ant colony algorithm-based distribution path optimization method according to claim 1, wherein the pheromone update adopts a globally updated ant week model to solve for an pheromone increment, and the pheromone update rule is as follows: when all ants walk all the customer demand points, m paths are formed, the total amount of the pheromone between any two points is updated and modified, and the total amount of the pheromone between the two points is calculated according to the following formula: τ ij(t+1) =(1-ρ)τ ij(t) +Δτ ij Wherein (1- ρ) τ ij(t) For the remaining information of the last iteration, Δτ ij And adding information for the iteration.
9. The ant colony algorithm-based distribution path optimization method according to claim 8, wherein the calculation process of the pheromone between any two points is a calculation process of the pheromone between any two customer demand points ij: pheromone Q/L of kth ant added between jth city and (j+1) th city k The sum of the pheromones added by all ants between the jth city and the (j+1) th city obtains the pheromones added between the jth city and the (j+1) th city of the iteration, and the calculation formula is as follows:
Figure FDA0004123424650000041
Figure FDA0004123424650000042
q is pheromoneConstant, which represents the total amount of pheromone released once by ant circulation, L k The total length of the path traversed by the current iteration is the kth ant.
10. The ant colony algorithm-based distribution path optimization method according to claim 1 or 2, characterized in that: the specific steps of the design of the improved ant colony algorithm are as follows:
s220: setting an algorithm initial value;
s221: setting the departure point of the vehicle k as a distribution center, wherein the position number is 0, and starting all the departure points of the vehicles at the position 0; setting the number m of the artificial ants to be 1.5 times of the client demand point; each complete iteration generates m complete paths for ants to walk, and all client demand points are required to be accessed;
s222: setting iteration times iter_begin=iter_begin+1, and executing each step;
s223: calculating the transition probability of m ants according to a transition probability formula, and randomly generating a path at an unaccessed customer demand point as a next customer demand point when the selected probability is not met, wherein the vehicle meets constraint conditions in the delivery process;
s224: when m ants visit all client points, calculating distribution cost and storing paths;
s225: updating the pheromone;
s226: judging the iteration times, stopping iteration if the preset maximum iteration times are reached, outputting an optimal result, and otherwise, turning to step S222.
CN202310239120.6A 2023-03-14 2023-03-14 Distribution path optimization method based on ant colony algorithm Pending CN116227773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310239120.6A CN116227773A (en) 2023-03-14 2023-03-14 Distribution path optimization method based on ant colony algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310239120.6A CN116227773A (en) 2023-03-14 2023-03-14 Distribution path optimization method based on ant colony algorithm

Publications (1)

Publication Number Publication Date
CN116227773A true CN116227773A (en) 2023-06-06

Family

ID=86584299

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310239120.6A Pending CN116227773A (en) 2023-03-14 2023-03-14 Distribution path optimization method based on ant colony algorithm

Country Status (1)

Country Link
CN (1) CN116227773A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117151321A (en) * 2023-10-31 2023-12-01 临沂慧商物流信息技术有限公司 Logistics transportation management method based on optimization algorithm
CN117522088A (en) * 2024-01-05 2024-02-06 南京信息工程大学 Multi-electric logistics vehicle scheduling method integrating charging constraint and capacity constraint

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117151321A (en) * 2023-10-31 2023-12-01 临沂慧商物流信息技术有限公司 Logistics transportation management method based on optimization algorithm
CN117522088A (en) * 2024-01-05 2024-02-06 南京信息工程大学 Multi-electric logistics vehicle scheduling method integrating charging constraint and capacity constraint
CN117522088B (en) * 2024-01-05 2024-03-29 南京信息工程大学 Multi-electric logistics vehicle scheduling method integrating charging constraint and capacity constraint

Similar Documents

Publication Publication Date Title
CN111860754B (en) AGV scheduling method based on ant colony and genetic algorithm
CN116227773A (en) Distribution path optimization method based on ant colony algorithm
WO2022262469A1 (en) Industrial park logistics scheduling method and system based on game theory
CN104700251B (en) The improvement minimax ant colony optimization method and system of a kind of vehicle dispatching problem
US20220156693A1 (en) Computerized system and method for developing optimized cargo transportation solutions
WO2022188388A1 (en) Smart city dynamic cold-chain logistics scheduling method based on ant colony optimization algorithm
CN110782086B (en) Rescue vehicle distribution path optimization method and system with unmanned aerial vehicle
Liu et al. Novel multi-objective resource allocation and activity scheduling for fourth party logistics
CN113222463B (en) Data-driven neural network agent-assisted strip mine unmanned truck scheduling method
CN109345091A (en) Complete vehicle logistics dispatching method and device, storage medium, terminal based on ant group algorithm
CN109214756A (en) Based on ant group algorithm and the complete vehicle logistics dispatching method and device of hierarchy optimization, storage medium, terminal
CN115953104B (en) Hybrid fleet scheduling method based on dung beetle optimization algorithm
CN112183812A (en) Finished cigarette logistics vehicle scheduling method considering short-time and low-cost
Ren et al. Improved ant colony optimization for the vehicle routing problem with split pickup and split delivery
CN113326993A (en) Shared bicycle scheduling method based on deep reinforcement learning
CN111445084A (en) Logistics distribution path optimization method considering traffic conditions and double time windows
CN114048924A (en) Multi-distribution center site selection-distribution path planning method based on hybrid genetic algorithm
CN113496313A (en) General assembly workshop material demand prediction method
CN115759917A (en) Logistics path planning method based on improved mixed ant colony algorithm
CN109359771A (en) A kind of line haul vehicle and goods matching algorithm based on big data
CN115578038A (en) Electric energy meter logistics scheduling method and system for large-scale batch rotation tasks
CN110210666B (en) Intelligent recommendation method, system and storage medium based on vehicle and goods matching
Wang et al. Optimization of ride-sharing with passenger transfer via deep reinforcement learning
CN115860289A (en) Route planning method, device, equipment and storage medium based on carbon emission
El Bouzekri El Idrissi et al. Evolutionary algorithm for the bi-objective green vehicle routing problem

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination