CN1790398A - Particle swarm optimization method for open vehicle routing problem with time windows - Google Patents
Particle swarm optimization method for open vehicle routing problem with time windows Download PDFInfo
- Publication number
- CN1790398A CN1790398A CNA200510062308XA CN200510062308A CN1790398A CN 1790398 A CN1790398 A CN 1790398A CN A200510062308X A CNA200510062308X A CN A200510062308XA CN 200510062308 A CN200510062308 A CN 200510062308A CN 1790398 A CN1790398 A CN 1790398A
- Authority
- CN
- China
- Prior art keywords
- customer
- particle
- algorithm
- customers
- insert
- 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
Links
- 239000002245 particle Substances 0.000 title claims abstract description 82
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000005457 optimization Methods 0.000 title claims description 30
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 67
- 238000004364 calculation method Methods 0.000 claims abstract description 12
- 238000009826 distribution Methods 0.000 claims description 27
- 239000013598 vector Substances 0.000 claims description 14
- 230000008569 process Effects 0.000 claims description 11
- 238000003780 insertion Methods 0.000 claims description 7
- 230000037431 insertion Effects 0.000 claims description 7
- 230000001133 acceleration Effects 0.000 claims description 2
- 230000006870 function Effects 0.000 description 8
- 239000000446 fuel Substances 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000013178 mathematical model Methods 0.000 description 2
- 238000010845 search algorithm Methods 0.000 description 2
- 238000003915 air pollution Methods 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 244000144992 flock Species 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000011664 nicotinic acid Substances 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 230000011273 social behavior Effects 0.000 description 1
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
(一)技术领域(1) Technical field
本发明涉及有时间窗的开放式车辆调度问题的粒子群优化方法。The invention relates to a particle swarm optimization method for an open vehicle scheduling problem with a time window.
(二)背景技术(2) Background technology
车辆调度是实施社会化物流的关键技术,优化车辆行驶路线,提升企业竞争力,降低企业成本,解决城市交通拥挤、能源短缺、大气污染等问题,实现交通在效率、资源、环境和价值观念各方面的内在统一,保证物流产业的可持续发展。但目前大多数企业所使用的车辆调度软件更多意义上是一个管理软件,缺少对资源的优化配置功能,还主要依靠具有丰富实践经验的管理人员和调度人员借助于会议、电话、报表等进行管理和调度的人工作业方式,显然不能满足快节奏的现代化生产和市场激烈竞争的需要。随着计算机及计算机网络引进企业,基于信息集成而发展起来的优化车辆调度正在兴起。Vehicle dispatching is a key technology for the implementation of socialized logistics. It optimizes vehicle routes, enhances corporate competitiveness, reduces corporate costs, solves problems such as urban traffic congestion, energy shortages, and air pollution, and realizes traffic in all aspects of efficiency, resources, environment, and values. The internal unity of all aspects ensures the sustainable development of the logistics industry. However, the vehicle scheduling software currently used by most enterprises is more of a management software, which lacks the function of optimizing the allocation of resources, and mainly relies on managers and dispatchers with rich practical experience to conduct meetings, telephone calls, reports, etc. The manual operation method of management and scheduling obviously cannot meet the needs of fast-paced modern production and fierce competition in the market. With the introduction of computers and computer networks into enterprises, optimized vehicle scheduling based on information integration is emerging.
有时间窗的开放式车辆调度问题OVRPTW(Open Vehicle Routing Problemwith Time Windows)的定义为:在物流服务网络中,已知客户和配送中心的位置,在满足车辆最大负载、客户需求(货物需求,交货时间需求)的前提下,设计车辆路径,配送客户,达到车辆最少,路程最短,时间最少等目标。车辆在访问完所有的客户后,不需要返回配送中心。OVRPTW (Open Vehicle Routing Problem with Time Windows) is defined as: in the logistics service network, the location of the customer and the distribution center are known, and the maximum load of the vehicle, customer demand (cargo demand, delivery Under the premise of the delivery time requirement), the vehicle route is designed to deliver customers, so as to achieve the goals of the least number of vehicles, the shortest distance, and the least time. After the vehicle has visited all customers, it does not need to return to the distribution center.
有时间窗的开放式车辆调度问题的数学模型如下所示:假设每辆车依然回到虚拟的配送中心,客户与配送中心间的距离为0,及ci0=0(i=1,2…L)。此处我们给出开放式车辆路径问题的三下标数学模型:假定配送中心最多可以用K(k=1,2…K)辆车对个L(i=1,2…L)客户进行运输配送,i=0表示仓库。每个车辆载重为bk(k=1,2,…K),每个客户的需求为di(i=1,2,…L),客户i到客户j的运输成本为cij(可以是距离,时间,费用等)。定义如下变量:The mathematical model of the open vehicle scheduling problem with a time window is as follows: Assume that each vehicle still returns to the virtual distribution center, the distance between the customer and the distribution center is 0, and c i0 =0 (i=1, 2... L). Here we give the three-subscript mathematical model of the open vehicle routing problem: Assume that the distribution center can use K (k=1, 2...K) vehicles to transport L (i=1, 2...L) customers at most Delivery, i=0 means warehouse. The load of each vehicle is b k (k=1, 2, ... K), the demand of each customer is d i (i = 1, 2, ... L), and the transportation cost from customer i to customer j is c ij (can is the distance, time, cost, etc.). Define the following variables:
tj≥ti+si+tij-T*(1-xijk) (7)t j ≥t i +s i +t ij -T*(1-x ijk ) (7)
tj=max{Ej,ti+si+tij} (8)t j =max{E j ,t i +s i +t ij } (8)
tj<Lj (9)t j <L j (9)
xijk=0或1 i,j,k (10)x ijk = 0 or 1 i, j, k (10)
yik=0或1 i,k (11) yik = 0 or 1 i, k (11)
约束(2)保证每辆车的能力约束。约束(3)保证每个客户都被服务。约束(4)(5)保证客户是仅被一辆车访问。约束(6)消除子回路。约束(7)-(9)保证了客户在时间窗内被服务,(10)(11)表示变量的取值范围。Constraint (2) guarantees the capacity constraints of each vehicle. Constraint (3) guarantees that every client is served. Constraints (4)(5) ensure that a client is accessed by only one vehicle. Constraint (6) eliminates subloops. Constraints (7)-(9) ensure that customers are served within the time window, and (10)(11) represent the value range of variables.
有时间窗的开放式车辆调度问题在现实生活中有许多实例,如物流公司从节约成本考虑,很多情况下所用车辆并不是自有车辆,而是社会车辆,一方面可以节约物流成本,令一方面可以整合社会资源。这种情况下,车辆不需要返回配送中心。类似的情况还出现在公司、学校的班车服务中。在有时间窗的开放式车辆调度问题中,每一条线路都是哈密尔顿路径(Hamiltonian Path),而在车辆调度问题(VRP)中是哈密尔顿圈(Hamiltonian Cycle)。虽然求解VRP的算法很多,但不能直接求解OVRPTW。There are many examples of open vehicle scheduling problems with time windows in real life. For example, logistics companies use social vehicles instead of self-owned vehicles in order to save costs. On the one hand, it can save logistics costs and make a company On the one hand, social resources can be integrated. In this case, the vehicle does not need to return to the distribution center. A similar situation also occurs in the shuttle services of companies and schools. In the open vehicle scheduling problem with a time window, each route is a Hamiltonian Path (Hamiltonian Path), while in the Vehicle Scheduling Problem (VRP), it is a Hamiltonian Cycle (Hamiltonian Cycle). Although there are many algorithms for solving VRP, they cannot directly solve OVRPTW.
目前求解有时间窗的开放式车辆路径问题的方法比较少,主要使用禁忌搜索算法和最邻近启发式算法等方法。禁忌搜索算法对初始解的依赖性较强,算法中的领域搜索算子设计复杂,算法虽然能得到比较好的解,单计算时间长。最邻近启发式算法实现简单,计算迅速,但所得结果与最优值有较大的差距。At present, there are relatively few methods for solving open vehicle routing problems with time windows, and methods such as tabu search algorithm and nearest neighbor heuristic algorithm are mainly used. The tabu search algorithm has a strong dependence on the initial solution, and the design of the domain search operator in the algorithm is complicated. Although the algorithm can obtain a better solution, the single calculation time is long. The nearest neighbor heuristic algorithm is simple to implement and fast to calculate, but there is a large gap between the obtained result and the optimal value.
(三)发明内容(3) Contents of the invention
为了克服已有的有时间窗的开放式车辆调度方法的算法复杂、计算速度与算法精度不协调的不足,本发明提供一种算法简单、同时具备较快的计算速度和较高的算法精度的有时间窗的开放式车辆调度问题的粒子群优化方法。In order to overcome the disadvantages of the existing open vehicle scheduling method with time windows, such as complex algorithm, uncoordinated calculation speed and algorithm precision, the present invention provides a simple algorithm, fast calculation speed and high algorithm precision. A Particle Swarm Optimization Method for Open Vehicle Scheduling Problems with Time Window.
本发明解决其技术问题所采用的技术方案是:The technical solution adopted by the present invention to solve its technical problems is:
一种有时间窗的开放式车辆调度问题的粒子群优化方法,所述的方法主要包括以下步骤:A particle swarm optimization method for an open vehicle scheduling problem with a time window, the method mainly includes the following steps:
(1)、从委托单中得到配送信息,所述的配送信息包括:客户名称、客户需求的货物的总数量、总重量、总体积、卸货地址、要求的到货时间;(1) Obtain delivery information from the entrustment form. The delivery information includes: customer name, total quantity, total weight, total volume, unloading address, and required arrival time of the goods required by the customer;
(2)、从委运单得到的客户名称,从地址数据库中查询出客户的地址信息,包括客户的具体地址,客户间的距离;(2) The customer's name obtained from the consignment note, and the customer's address information is queried from the address database, including the customer's specific address and the distance between customers;
(3)、设定粒子群算法的参数,所述的参数包括种群规模、迭代次数,所述的种群规模表示初始配送方案的数量,迭代次数表示在众多的配送方案空间中的搜索次数;(3), the parameter of particle swarm optimization algorithm is set, and described parameter comprises population scale, number of iterations, and described population scale represents the quantity of initial distribution scheme, and number of iterations represents the number of searches in numerous distribution scheme spaces;
(4)、将上述的配送信息、客户的地址信息读入粒子群算法中;(4), read the above-mentioned delivery information and the customer's address information into the particle swarm optimization algorithm;
(5)、根据客户的数目,计算所需要的车辆数,对各个配送方案进行编码;(5) According to the number of customers, calculate the number of vehicles required, and code each delivery plan;
(6)、使用解码算法进行解码;(6), use the decoding algorithm to decode;
(7)、使用改进的廉价插入启发式算法(Cheapest Insert Algorithm)优化车辆内客户的顺序;(7), use the improved cheap insert heuristic algorithm (Cheapest Insert Algorithm) to optimize the order of customers in the vehicle;
(7.1)、建立改进的廉价插入启发式算法(Cheapest Insert Algorithm)模型:将客户u插入客户i和j之间的费用可以按照下面式子的定义计算:(7.1) Establish an improved Cheapest Insert Algorithm (Cheapest Insert Algorithm) model: the cost of inserting customer u between customer i and j can be calculated according to the definition of the following formula:
c1(i,u,j)=diu+duj-dij (12)c 1 (i,u,j)=d iu +d uj -d ij (12)
c2(i,u,j)=bju-bj (13)c 2 (i,u,j)=b ju -b j (13)
c3=Tu-T (14)c 3 =T u -T (14)
c4(i,u,j)=α1c1(i,u,j)+α2c2(i,u,j)+α3(i,u,j) (15)c 4 (i, u, j) = α 1 c 1 (i, u, j) + α 2 c 2 (i, u, j) + α 3 (i, u, j) (15)
上式中,dij(i,j ∈1,2…n)表示两个客户间的举例,bi(i∈1,2…n)表示在此客户的开始服务的时间,T表示线路总的等待时间;c1(i,u,j)表示插入u后,距离的增量;c2(i,u,j)表示插入u后,到达j客户的时间推迟量;c3表示插入u后,线路总的等待时间的增加量;c4(i,u,j)表示在客户i和j之间插入u的费用,是c1,c2,c3的加权和;In the above formula, d ij (i, j ∈ 1, 2...n) represents an example between two customers, b i (i ∈ 1, 2... n) represents the service start time of this customer, T represents the total number of lines c 1 (i, u, j) represents the increment of distance after inserting u; c 2 (i, u, j) represents the delay in reaching customer j after inserting u; c 3 represents the amount of time delay for inserting u After that, the increase of the total waiting time of the line; c 4 (i, u, j) represents the cost of inserting u between customers i and j, which is the weighted sum of c 1 , c 2 and c 3 ;
(7.2)、如果所有的客户都已经分配给车辆,则算法停止;否则选择当前开始服务时间最晚的客户初始化一条线路。(7.2) If all customers have been assigned to vehicles, the algorithm stops; otherwise, select the customer whose service start time is the latest to initialize a line.
(7.2)、对于当前未分配的每个客户,将其插入当前线路中每个可行位置,按照(4)式计算插入费用,选取所有值中最小的值,将此客户插入相应的位置;(7.2), for each customer that is not currently allocated, insert it into each feasible position in the current line, calculate the insertion fee according to formula (4), select the smallest value among all values, and insert this customer into the corresponding position;
(7.3)、重复第二步过程,直到此线路满足车辆的约束或者没有客户可以插入,则转第一步;(7.3), repeat the second step until the line meets the constraints of the vehicle or no customer can insert, then go to the first step;
(8)、根据配送成本计算方案,计算访问所有客户的线路长度或者时间或访问所有客户的费用,粒子的适应度定义为成本的倒数;(8) According to the distribution cost calculation scheme, calculate the line length or time to visit all customers or the cost of visiting all customers, and the fitness of the particle is defined as the reciprocal of the cost;
(9)、比较粒子的适应度,找出种群中适应度最高的粒子保存,同时每个粒子和自身以前计算的适应度比较,保存自身最好的适应度;(9), compare the fitness of the particles, find out the particle with the highest fitness in the population and save it, and compare each particle with the fitness calculated before itself, and save the best fitness of itself;
(10)、对粒子所代表的配送方案进行调整,根据如下的公式(16)进行粒子状态的更新:(10), adjust the distribution plan represented by the particle, and update the state of the particle according to the following formula (16):
上式中,Xi=(xi1,xi2,…xiD)表示第i个粒子的状态,每个粒子表示D维空间的一个解,Vi=(vi1,vi2,…viD)表示每个粒子的速度向量,且Vi满足:Vi≤最大速度Vmax;Pi表示每个粒子经历过的最优状态,Pg表示群体经历过的最优状态,c1是惯性权重,c2,c3是加速度常数。粒子的状态在具体的应用中代表不同的含义,在本发明的应用中,粒子的状态表示车辆调度的配送方案,即客户由那辆车配送,和客户在配送中的顺序。粒子的速度表示配送方案间的差异,即同一客户所在车辆的不同,客户在配送中的顺序不同。In the above formula, Xi=(x i1 , x i2 ,...x iD ) represents the state of the i-th particle, each particle represents a solution in D-dimensional space, and Vi=(v i1 , v i2 ,...v iD ) represents The velocity vector of each particle, and Vi satisfies: Vi≤maximum velocity V max ; P i represents the optimal state experienced by each particle, P g represents the optimal state experienced by the group, c 1 is the inertia weight, c 2 , c3 is the acceleration constant. The state of the particle represents different meanings in specific applications. In the application of the present invention, the state of the particle represents the delivery plan of the vehicle dispatch, that is, which vehicle the customer is delivered by, and the order of the customer in the delivery. The speed of the particles represents the difference between the delivery schemes, that is, the order of the customers in the delivery is different according to the different vehicles of the same customer.
(11)、随机的选择一些粒子进行交叉操作,对各个粒子表示的配送方案进行调整;(11), randomly select some particles to carry out crossover operation, and adjust the distribution scheme represented by each particle;
(12)、重复(6)~(11),对可能的配送方案进行搜索,达到预定的迭代次数后,输出粒子群算法寻找到的配送方案。(12) Repeat (6) to (11) to search for possible distribution schemes, and output the distribution scheme found by the particle swarm optimization algorithm after reaching the predetermined number of iterations.
进一步,所述的(7)中,所有的客户都已经分配给车辆后,再使用重新插入算法(Re-Insert)优化车辆的使用数量,重新插入算法的步骤为:Further, in the above (7), after all customers have been assigned to the vehicle, the re-insert algorithm (Re-Insert) is used to optimize the number of vehicles used. The steps of the re-insert algorithm are:
第一步:找出所有线路中客户最少的线路,将此线路删除;Step 1: find out the line with the fewest customers among all lines, and delete this line;
第二步:对于每一个未分配车辆的客户,将其尝试插入以后的所有线路中的每个位置,如果能插入,则将其插入;Step 2: For each customer who has not allocated a vehicle, try to insert it into each position in all future lines, if it can be inserted, then insert it;
第三步:如果所有未分配的客户都已分配,则算结束;否则,使用改进的廉价插入启发式算法新生成一条线路。Step 3: If all unassigned customers have been assigned, then end; otherwise, use the improved cheap insertion heuristic algorithm to generate a new line.
再进一步,所述的(5)中,编码方式采用基于实数向量的编码方式:对于有L个客户的配送方案,使用L维的实数向量X表示粒子的状态;对于向量的每一维,其整数部分表示所在的车辆,如整数部分相同的,表示在同一辆车中;小数部分表示在车辆中配送的次序,按照大小顺序;Further, in the described (5), the coding method adopts the coding method based on the real number vector: for the delivery scheme with L customers, the real number vector X of L dimension is used to represent the state of the particle; for each dimension of the vector, its The integer part indicates the vehicle where the vehicle is located. If the integer part is the same, it means that it is in the same vehicle; the decimal part indicates the order of distribution in the vehicle, in order of size;
所述的(6)中,解码的过程为:In said (6), the process of decoding is:
(6.1)对于粒子的状态的每一维,进行[X]操作;(6.1) For each dimension of the state of the particle, perform [X] operation;
(6.2)根据[X]值进行分组,形成客户分组;(6.2) Grouping according to [X] value to form customer grouping;
(6.3)在分组内,对粒子进行{X}操作;(6.3) In the group, perform {X} operation on the particles;
(6.4)根据{X}的大小进行排列,形成客户的访问顺序。(6.4) Arrange according to the size of {X} to form the customer's access sequence.
本发明的工作原理是:粒子群算法是由Kennedy和Eberhart等于1995年提出的一种演化计算技术。其核心思想是对生物社会性行为的模拟。其最初设想是模拟鸟群捕食的过程,在研究过程中,将其应用于各种问题的优化取得了良好效果。假设一群鸟在捕食,其中的一只发现了食物,则其他一些鸟会跟随这只鸟飞向食物处,而令一些会去寻找更好的食物源。在捕食的整个过程中,鸟会利用自身的经验和群体的信息来寻找食物。粒子群算法从鸟群的这种行为得到启示,并将其用于优化问题的求解。在粒子群算法中,每个问题的解都被看作搜索空间中的一只鸟,我们称为“粒子”。粒子的状态好坏,用由被优化问题决定的适应值表示。每个粒子有一个速度表示粒子飞行的距离和方向。粒子追随当前的最优粒子在解空间进行搜索。当求解一个问题的时候,将该问题采用一定的编码方法编码成粒子,然后按照粒子群算法的机理进行迭代运算。The working principle of the present invention is: the particle swarm algorithm is an evolutionary computing technique proposed by Kennedy and Eberhart et al. in 1995. Its core idea is the simulation of biological social behavior. Its original idea is to simulate the process of bird predation. During the research process, it has been applied to the optimization of various problems and achieved good results. Suppose a flock of birds is hunting, and one of them finds food, some other birds will follow the bird to the food, and some will look for a better food source. Throughout the predation process, birds use their own experience and group information to find food. The particle swarm optimization algorithm draws inspiration from this behavior of birds and uses it to solve optimization problems. In PSO, the solution to each problem is viewed as a bird in the search space, which we call a "particle". The state of the particle is good or bad, expressed by the fitness value determined by the optimized problem. Each particle has a velocity that indicates how far and in what direction the particle is flying. Particles follow the current optimal particle to search in the solution space. When solving a problem, the problem is coded into particles using a certain coding method, and then iterative operations are performed according to the mechanism of the particle swarm algorithm.
求解有时间窗的开放式车辆调度问题的可行性分析:有时间窗的开放式车辆调度问题是NP问题,采用传统的方法求解,存在求解问题规模小,解的质量不高等问题。粒子群算法是一种新型的仿生智能优化算法。具有求解速度快,解的质量高等有点。粒子群在神经网络优化,电气参数设计优化等领域都取得了成功应用。在求解旅行商问题,任务分配问题等NP方面也取得了良好效果。Feasibility analysis of solving the open vehicle scheduling problem with time window: the open vehicle scheduling problem with time window is an NP problem, and the traditional method is used to solve the problems, such as the small scale of the solution problem and the low quality of the solution. Particle swarm optimization algorithm is a new type of bionic intelligent optimization algorithm. It has the advantages of fast solution speed and high solution quality. Particle swarm optimization has been successfully applied in the fields of neural network optimization and electrical parameter design optimization. It has also achieved good results in solving NP problems such as traveling salesman problems and task assignment problems.
有时间窗的开放式车辆调度问题是非常复杂的问题。通常是多约束、多目标、随机不确定优化问题。求解过程的计算量随问题的规模呈指数增长,已被证明是NP完全问题。很多研究表明,寻找车辆调度问题的最优解是非常困难的,最有工程意义的求解算法是放弃寻找最优解的目标,转而试图在合理、有限的时间内寻找到一个近似的、有用的解。The open vehicle scheduling problem with time windows is a very complicated problem. Usually it is a multi-constraint, multi-objective, stochastic uncertain optimization problem. The calculation amount of the solution process increases exponentially with the scale of the problem, which has been proved to be an NP-complete problem. Many studies have shown that it is very difficult to find the optimal solution to the vehicle scheduling problem. The most engineering solution algorithm is to give up the goal of finding the optimal solution and try to find an approximate and useful solution in a reasonable and limited time. solution.
本发明提出一种基于实数向量的编码方式,此方法区别于现有的编码方法的关键在于在不增加维数的前提下,将车辆和车辆线路中的客户排序在编码表示出来。对于有L个客户的OVRPTW问题,使用L维的实数向量表示粒子的状态。对于向量的每一维,其整数部分表示所在的车辆,整数部分相同的,表示在同一辆车中。小数部分表示在车辆中配送的次序。The present invention proposes a coding method based on real number vectors. The key difference between this method and the existing coding method is to express the sequence of customers in the vehicle and the vehicle line in code without increasing the dimension. For the OVRPTW problem with L clients, use an L-dimensional real vector to represent the state of the particle. For each dimension of the vector, its integer part represents the vehicle it is in, and if the integer part is the same, it represents the same vehicle. The decimal part indicates the order of delivery in the vehicle.
本发明的有益效果主要表现在:1、算法简单;2、同时具备较快的计算速度和较高的算法精度;3、在合理、有限的时间内寻找到一个有用的解。The beneficial effects of the present invention are mainly manifested in: 1. Simple algorithm; 2. Fast calculation speed and high algorithm precision; 3. Find a useful solution within a reasonable and limited time.
(四)附图说明(4) Description of drawings
图1是有时间窗的开放式车辆调度的粒子群优化方法的流程图。Figure 1 is a flow chart of the particle swarm optimization method for open vehicle scheduling with time windows.
图2是有时间窗的开放式车辆调度的系统结构图。Figure 2 is a system structure diagram of open vehicle scheduling with time windows.
(五)具体实施方式(5) Specific implementation methods
下面结合附图对本发明作进一步描述。The present invention will be further described below in conjunction with the accompanying drawings.
参照图1,一种有时间窗的开放式车辆调度问题的粒子群优化方法,包括以下步骤:Referring to Figure 1, a particle swarm optimization method for an open vehicle scheduling problem with a time window, including the following steps:
第一步:从委运单得到配送信息。这些信息包括:客户名称,客户需求货物的总数量,总重量,总体积,卸货地址,要求的到货时间,估计需要的卸货时间。Step 1: Obtain delivery information from the consignment note. This information includes: customer name, total quantity of goods required by the customer, total weight, total volume, unloading address, required arrival time, and estimated required unloading time.
第二步:根据从委运单得到的客户名称,从数据库中查询出客户的地址信息,包括客户的具体地址,客户间的距离(或者运行时间)。Step 2: According to the customer name obtained from the consignment note, query the customer's address information from the database, including the customer's specific address, the distance between customers (or the running time).
第三步:算法参数,粒子群算法的参数包括种群规模,此处代表有多少个初始配送方案。迭代次数,表示在众多的配送方案空间中,不停的搜索,搜索的次数,根据客户的数目,客户越多,算法迭代的次数越多,种群规模越大。Step 3: Algorithm parameters. The parameters of the particle swarm optimization algorithm include the population size, which represents how many initial distribution schemes there are. The number of iterations refers to the number of times of non-stop searching in the space of numerous distribution solutions. According to the number of customers, the more customers, the more times the algorithm iterates, and the larger the population size.
第四步:将上述所述的数据信息读入算法中。Step 4: Read the above-mentioned data information into the algorithm.
第五步:根据客户的数目,预估计的所需要的车辆数,按照本文设计的编码方式进行编码。所谓编码,及将一个配送方案用粒子算法所能理解的方式表达出来。Step 5: According to the number of customers, the estimated number of vehicles required is coded according to the coding method designed in this paper. The so-called encoding refers to expressing a delivery plan in a way that the particle algorithm can understand.
基于实数向量的编码方式,此方法区别于上述的方法的关键在于在不增加维数的前提下,将车辆和车辆线路中的客户排序在编码表示出来。对于有L个客户的OVRPTW问题,使用L维的实数向量表示粒子的状态。对于向量的每一维,其整数部分表示所在的车辆,整数部分相同的,表示在同一辆车中。小数部分表示在车辆中配送的次序。Based on the encoding method of real number vector, the key difference between this method and the above-mentioned method is to express the sequence of customers in vehicles and vehicle lines in code without increasing the number of dimensions. For the OVRPTW problem with L clients, use an L-dimensional real vector to represent the state of the particle. For each dimension of the vector, its integer part represents the vehicle it is in, and if the integer part is the same, it represents the same vehicle. The decimal part indicates the order of delivery in the vehicle.
定义:[X]表示对x取整数部分,{X}表示对X取小数部分,每个粒子整数部分相同的表示相应的客户在一辆车上服务,小数部分的排列表示服务的顺序。Definition: [X] means to take the integer part of x, {X} means to take the decimal part of X, the same integer part of each particle means that the corresponding customer is served in a car, and the arrangement of the decimal part means the order of the service.
解码的过程:The decoding process:
(1)对于粒子的状态的每一维,进行[X]操作。(1) For each dimension of the particle's state, perform the [X] operation.
(2)根据[X]值进行分组,形成客户分组。(2) Group according to the value of [X] to form customer groups.
(3)在分组内,对粒子进行{X}操作。(3) In the group, perform {X} operation on the particles.
(4)根据{X}的大小进行排列,形成客户的访问顺序。(4) Arrange according to the size of {X} to form the customer's access sequence.
假设7个客户的OVRPTW问题,需要的车辆数为3,对于这个问题的,将配送方案采用此种编码方式编码,得到如下结果:Assuming the OVRPTW problem of 7 customers, the number of vehicles required is 3. For this problem, the distribution plan is encoded using this coding method, and the following results are obtained:
客户编号:1 2 3 4 5 6 7Customer number: 1 2 3 3 4 5 6 7
X: 4.1 1.86 1.53 1.12 1.24 3.29 3.05X: 4.1 1.86 1.53 1.12 1.24 3.29 3.05
这组编码对应的解的路径是:The path to the solution corresponding to this set of codes is:
第一条线路:0-1First line: 0-1
第二条线路:0-4-5-3-2Second line: 0-4-5-3-2
第三条线路:0-7-6Third line: 0-7-6
这种表示方法,维数和客户数目相当,进行粒子状态更新操作简单,能发挥粒子群算法的固有优点。This representation method has the same dimension as the number of customers, and the operation of particle state update is simple, which can play the inherent advantages of the particle swarm optimization algorithm.
第六步:根据上述解码方法将粒子的状态解码为客户的分组及排列,及车辆调度的方案。Step 6: According to the above decoding method, the state of the particles is decoded into the grouping and arrangement of customers, and the scheme of vehicle scheduling.
第七步:使用改进的廉价插入启发式算法和重新插入算法等方法调整线路间和线路内的次序,及对生成的配送方案进行再优化:Step 7: Use the improved cheap insertion heuristic algorithm and reinsertion algorithm to adjust the order between lines and within lines, and re-optimize the generated distribution plan:
(7.1)、建立改进的廉价插入启发式算法(Cheapest Insert Algorithm)模型,将客户u插入客户i和j之间的费用可以按照下面式子的定义计算:(7.1) Establish an improved Cheapest Insert Algorithm (Cheapest Insert Algorithm) model, the cost of inserting customer u between customer i and j can be calculated according to the definition of the following formula:
c1(i,u,j)=diu+duj-dij (12)c 1 (i,u,j)=d iu +d uj -d ij (12)
c2(i,u,j)=bju-bj (13)c 2 (i,u,j)=b ju -b j (13)
c3=Tu-T (14)c 3 =T u -T (14)
c4(i,u,j)=α1c1(i,u,j)+α2c2(i,u,j)+α3(i,u,j) (15)c 4 (i, u, j) = α 1 c 1 (i, u, j) + α 2 c 2 (i, u, j) + α 3 (i, u, j) (15)
上式中,dij(i,j∈1,2…n)表示两个客户间的举例,bi(i∈1,2…n)表示在此客户的开始服务的时间,T表示线路总的等待时间;c1(i,u,j)表示插入u后,距离的增量;c2(i,u,j)表示插入u后,到达j客户的时间推迟量;c3表示插入u后,线路总的等待时间的增加量;c4(i,u,j)表示在客户i和j之间插入u的费用,是c1,c2,c3的加权和。In the above formula, d ij (i, j∈1, 2...n) represents an example between two customers, b i (i∈1, 2...n) represents the service start time of this customer, T represents the total line c 1 (i, u, j) represents the increment of distance after inserting u; c 2 (i, u, j) represents the delay in reaching customer j after inserting u; c 3 represents the amount of time delay for inserting u After that, the increase of the total waiting time of the line; c 4 (i, u, j) represents the cost of inserting u between customers i and j, and is the weighted sum of c 1 , c 2 , c 3 .
(7.2)、如果所有的客户都已经分配给车辆,则算法停止;否则选择当前开始服务时间最晚的客户初始化一条线路。(7.2) If all customers have been assigned to vehicles, the algorithm stops; otherwise, select the customer whose service start time is the latest to initialize a line.
(7.2)、对于当前未分配的每个客户,将其插入当前线路中每个可行位置,按照(4)式计算插入费用,选取所有值中最小的值,将此客户插入相应的位置;(7.2), for each customer that is not currently allocated, insert it into each feasible position in the current line, calculate the insertion fee according to formula (4), select the smallest value among all values, and insert this customer into the corresponding position;
(7.3)、重复第二步过程,直到此线路满足车辆的约束或者没有客户可以插入,则转第一步;(7.3), repeat the second step until the line meets the constraints of the vehicle or no customer can insert, then go to the first step;
对于客户少的线路,所有的客户都已经分配给车辆后,再使用重新插入算法(Re-Insert)优化车辆的使用数量,重新插入算法的步骤为:For lines with few customers, after all customers have been allocated to vehicles, the re-insert algorithm (Re-Insert) is used to optimize the number of vehicles used. The steps of the re-insert algorithm are:
(1)、找出所有线路中客户最少的线路,将此线路删除;(1), find out the line with the fewest customers among all lines, and delete this line;
(2)、对于每一个未分配车辆的客户,将其尝试插入以后的所有线路中的每个位置,如果能插入,则将其插入;(2) For each customer who has not allocated a vehicle, try to insert it into each position in all future lines, if it can be inserted, then insert it;
(3)、如果所有未分配的客户都已分配,则算结束;否则,使用改进的廉价插入启发式算法新生成一条线路。(3) If all unallocated customers have been allocated, then it is considered over; otherwise, use the improved cheap insertion heuristic algorithm to generate a new line.
第八步:然后根据配送成本计算方案,及可以是计算访问所有客户的线路长度或者时间,也可以是访问所有客户的费用等。粒子的适应度定义为成本的倒数。Step 8: Then calculate the plan according to the distribution cost, and it can be to calculate the length or time of visiting all customers, or the cost of visiting all customers, etc. The fitness of a particle is defined as the reciprocal of the cost.
第九步:比较粒子的适应度,找出种群中适应度最高的粒子保存,同时每个粒子和自身以前计算的适应度比较,保存自身最好的适应度。此操作的目的是保存当前算法搜索到的最优配送方案及每个粒子搜索到的最优配送方案Step 9: Compare the fitness of the particles, find out the particle with the highest fitness in the population and save it, and compare each particle with its previously calculated fitness, and save its best fitness. The purpose of this operation is to save the optimal distribution plan searched by the current algorithm and the optimal distribution plan searched by each particle
第十步:根据上文提到的公式(16)进行粒子状态的更新,此更新的过程,就是对粒子所代表的配送方案的调整过程。及让所有粒子所代表的配送方案都向目前已知的最优的配送方案靠拢。Step 10: Update the state of the particles according to the formula (16) mentioned above. The updating process is the process of adjusting the delivery plan represented by the particles. And make the distribution plan represented by all particles close to the currently known optimal distribution plan.
第十一步:随机的选择一些粒子进行交叉操作,此操作表示,对各个粒子表示的配送方案进行调整。由此可以产生更优秀的配送方案。Step 11: Randomly select some particles for crossover operation, which means adjusting the distribution plan represented by each particle. This can result in a better delivery solution.
第十二步:重复第六步到十一步的过程,及对可能的配送方案进行搜索,达到预定的迭代次数,则从算法退出。Step 12: Repeat the process from Step 6 to Step 11, and search for possible distribution schemes, and exit from the algorithm when the predetermined number of iterations is reached.
第十三步:输出粒子群算法寻找到的配送方案,以承运单的形式显示。Step 13: Output the distribution plan found by the particle swarm optimization algorithm and display it in the form of a waybill.
参照图2,应用本方法实现的车辆智能调度系统,主要包括:基础信息子系统、智能算法子系统。Referring to Fig. 2, the vehicle intelligent dispatching system implemented by this method mainly includes: a basic information subsystem and an intelligent algorithm subsystem.
所述的基础子信息系统包括:The basic sub-information system includes:
(1)、客户的坐标信息(1), customer coordinate information
此功能可以让用户添加、修改、查询客户的坐标,这些操作都是基于电子地图,客户可以通过鼠标点出客户的位置,坐标数值可以自动修改,显示。This function allows the user to add, modify, and query the customer's coordinates. These operations are based on the electronic map. The customer can click the customer's location with the mouse, and the coordinate value can be automatically modified and displayed.
(2)、客户间的距离(时间)(2), the distance between customers (time)
此功能提供客户间距离(时间)的查询、添加、修改。这些操作都是基于电子地图的,方便用户查看。This function provides query, addition and modification of the distance (time) between customers. These operations are all based on the electronic map, which is convenient for users to view.
(3)、客户配送的难易程度(3) The difficulty of customer delivery
此功能提供客户配送难易程度的查询、添加、修改。难易程度用通俗的语言“难”、“易”等词语表示,方便用户使用。This function provides query, addition, and modification of customer delivery difficulty. The degree of difficulty is represented by words such as "difficult" and "easy" in popular language, which is convenient for users to use.
(4)、算法的参数信息(4) Parameter information of the algorithm
此功能提供各种算法参数的显示,修改。This function provides display and modification of various algorithm parameters.
所述的智能算法子系统包括:Described intelligent algorithm subsystem comprises:
(1)、有时间窗的开放式车辆调度(1), open vehicle scheduling with time window
优化的目标为此次派车任务需要得车辆最少,运行得线路最短(也可以是成本最少,油耗最少等目标,根据基础信息中提供的信息的不同);约束条件中强调客户需求的时间,配送完成后车辆不返回车场。该调度具有以下功能:The goal of optimization is to require the least number of vehicles and the shortest route for this dispatch task (it can also be the least cost, least fuel consumption, etc., depending on the information provided in the basic information); the constraints emphasize the time required by customers, After the delivery is completed, the vehicle will not return to the yard. This schedule has the following functions:
(1.1)、智能算法调度(1.1), intelligent algorithm scheduling
采用本发明的车辆调度方案进行有时间窗的开放式车辆调度,显示配送方案,为下一步生成委运单准备。调度的过程如图1所示,方法的描述略。The vehicle dispatching scheme of the present invention is used to perform open vehicle dispatching with a time window, display the delivery scheme, and prepare for the generation of consignment orders in the next step. The scheduling process is shown in Figure 1, and the description of the method is omitted.
(1.2)、生成承运单(1.2), generate waybill
对满意的调度结果生成承运单。承运单编号根据日期自动产生,承运单的信息可以查看,修改,删除。Generate waybills for satisfactory dispatch results. The waybill number is automatically generated according to the date, and the information of the waybill can be viewed, modified, and deleted.
(1.3)、图形化显示(1.3), graphical display
采用图形化方法显示调度的结果。在地图上会用不同颜色的线条表示不同的车配送的线路。地图上会表示出配送客户的位置和名称。模拟小车会按照算法安排的线路访问客户。The results of scheduling are displayed graphically. Lines of different colors will be used on the map to indicate the routes of different car delivery. The location and name of the delivery customer will be indicated on the map. The simulated car will visit customers according to the route arranged by the algorithm.
(1.4)、收敛图(1.4), Convergence diagram
画出算法此次计算的收敛图,给用户提供判断此次运算结果是否优秀的一个准则。Draw the convergence graph of the calculation of the algorithm to provide users with a criterion for judging whether the calculation result is excellent.
(2)、车辆最少模型调度(2), the least model scheduling of vehicles
此模型是针对车辆返回配送中心的情况下,优化的目标为此次派车任务需要得车辆最少,运行得线路最短(也可以是成本最少,油耗最少等目标,根据基础信息中提供的信息的不同)。功能与上述(1)的有时间窗的开放式车辆调度模型相同。This model is aimed at the situation when the vehicle returns to the distribution center. The optimization goal is to require the least number of vehicles for this dispatch task, and the shortest running route (it can also be the least cost, the least fuel consumption, etc., according to the information provided in the basic information. different). The function is the same as the above-mentioned open vehicle scheduling model with time window in (1).
(3)、准时到达调度(3), punctual arrival dispatch
此模型是车辆返回配送中的情况下,优化的目标是首先是满足客户时间上的要求,及保证在客户要求达到的时间内进行配送。其次是希望所用的车辆数最少,车辆行驶的距离最短(也可以是成本最少,油耗最少等目标,根据基础信息中提供的信息的不同)。功能与上述(1)有时间窗的开放式车辆调度模型相同。In this model, when the vehicle is returning to delivery, the goal of optimization is to first meet the customer's time requirement and ensure delivery within the time required by the customer. Secondly, it is hoped that the number of vehicles used is the least, and the distance traveled by the vehicles is the shortest (it can also be the least cost, the least fuel consumption, etc., depending on the information provided in the basic information). The function is the same as the above (1) open vehicle scheduling model with time window.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA200510062308XA CN1790398A (en) | 2005-12-28 | 2005-12-28 | Particle swarm optimization method for open vehicle routing problem with time windows |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNA200510062308XA CN1790398A (en) | 2005-12-28 | 2005-12-28 | Particle swarm optimization method for open vehicle routing problem with time windows |
Publications (1)
Publication Number | Publication Date |
---|---|
CN1790398A true CN1790398A (en) | 2006-06-21 |
Family
ID=36788230
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNA200510062308XA Pending CN1790398A (en) | 2005-12-28 | 2005-12-28 | Particle swarm optimization method for open vehicle routing problem with time windows |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1790398A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102116635A (en) * | 2009-12-30 | 2011-07-06 | 西门子公司 | Method and device for determining navigation path |
CN104700251A (en) * | 2015-03-16 | 2015-06-10 | 华南师范大学 | Maximum-minimum ant colony optimization method and maximum-minimum ant colony optimization system for solving vehicle scheduling problem |
CN105631518A (en) * | 2015-12-23 | 2016-06-01 | 西安理工大学 | Multi-parameter multi-object chaotic particle swarm parameter optimization method |
CN106651044A (en) * | 2016-12-28 | 2017-05-10 | 中山大学 | Intelligent scheduling algorithm for solving problem of multi-object tape time window periodicity vehicle path |
CN106651231A (en) * | 2015-10-29 | 2017-05-10 | 株式会社日立制作所 | Route planning method and route planning device |
CN108681861A (en) * | 2018-06-19 | 2018-10-19 | 品信科技有限公司 | A kind of Distribution path method and device for planning |
CN108846610A (en) * | 2018-06-19 | 2018-11-20 | 品信科技有限公司 | A kind of Distribution path method and device for planning |
CN109034481A (en) * | 2018-07-31 | 2018-12-18 | 北京航空航天大学 | A kind of vehicle routing problem with time windows modeling and optimization method based on constraint planning |
WO2019090874A1 (en) * | 2017-11-13 | 2019-05-16 | 西华大学 | Single vehicle scheduling method for cargo collection and delivery |
-
2005
- 2005-12-28 CN CNA200510062308XA patent/CN1790398A/en active Pending
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102116635A (en) * | 2009-12-30 | 2011-07-06 | 西门子公司 | Method and device for determining navigation path |
CN104700251A (en) * | 2015-03-16 | 2015-06-10 | 华南师范大学 | Maximum-minimum ant colony optimization method and maximum-minimum ant colony optimization system for solving vehicle scheduling problem |
CN104700251B (en) * | 2015-03-16 | 2018-02-02 | 华南师范大学 | The improvement minimax ant colony optimization method and system of a kind of vehicle dispatching problem |
CN106651231A (en) * | 2015-10-29 | 2017-05-10 | 株式会社日立制作所 | Route planning method and route planning device |
CN106651231B (en) * | 2015-10-29 | 2021-06-11 | 株式会社日立制作所 | Path planning method and path planning device |
CN105631518A (en) * | 2015-12-23 | 2016-06-01 | 西安理工大学 | Multi-parameter multi-object chaotic particle swarm parameter optimization method |
CN106651044A (en) * | 2016-12-28 | 2017-05-10 | 中山大学 | Intelligent scheduling algorithm for solving problem of multi-object tape time window periodicity vehicle path |
CN106651044B (en) * | 2016-12-28 | 2021-01-08 | 中山大学 | Intelligent scheduling algorithm for solving multi-target periodic vehicle path problem with time window |
WO2019090874A1 (en) * | 2017-11-13 | 2019-05-16 | 西华大学 | Single vehicle scheduling method for cargo collection and delivery |
CN108846610A (en) * | 2018-06-19 | 2018-11-20 | 品信科技有限公司 | A kind of Distribution path method and device for planning |
CN108681861A (en) * | 2018-06-19 | 2018-10-19 | 品信科技有限公司 | A kind of Distribution path method and device for planning |
CN109034481A (en) * | 2018-07-31 | 2018-12-18 | 北京航空航天大学 | A kind of vehicle routing problem with time windows modeling and optimization method based on constraint planning |
CN109034481B (en) * | 2018-07-31 | 2022-07-05 | 北京航空航天大学 | Constraint programming-based vehicle path problem modeling and optimizing method with time window |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Luo et al. | Electric vehicle charging station location towards sustainable cities | |
Nesmachnow | An overview of metaheuristics: accurate and efficient methods for optimisation | |
CN111405527B (en) | Vehicle-mounted edge computing method, device and system based on volunteer cooperative processing | |
CN109034468A (en) | A kind of logistics distribution paths planning method with time window based on cuckoo algorithm | |
CN101079851A (en) | Email type judgement method and device and establishment device of system and behavior model | |
Yao et al. | Improved artificial bee colony algorithm for vehicle routing problem with time windows | |
Li et al. | SVND enhanced metaheuristic for plug-in hybrid electric vehicle routing problem | |
CN1790398A (en) | Particle swarm optimization method for open vehicle routing problem with time windows | |
Jiau et al. | Services-oriented computing using the compact genetic algorithm for solving the carpool services problem | |
CN108805335A (en) | A kind of public bicycles dispatching method | |
CN1750028A (en) | A kind of particle group optimizing method of vehicle dispatching problem | |
CN103324703A (en) | Knowledge pushing method based on double driving of workflow engine and knowledge engine | |
CN113408922A (en) | Vehicle optimal scheduling method for kitchen waste recovery process | |
CN111652392B (en) | Low-carbon efficient disassembly line balance optimization method for waste mobile terminal | |
Barletta et al. | Hybrid fleet capacitated vehicle routing problem with flexible Monte–Carlo Tree search | |
Hu et al. | LRP-based design of sustainable recycling network for electric vehicle batteries | |
Li et al. | Improved whale optimization algorithm based on hybrid strategy and its application in location selection for electric vehicle charging stations | |
Liu et al. | Optimal placement of charging stations in road networks: a reinforcement learning approach with attention mechanism | |
Niu et al. | Solving the green open vehicle routing problem using a membrane-inspired hybrid algorithm | |
Zhang et al. | Optimization model and solution algorithm for rural customized bus route operation under multiple constraints | |
Ahmad et al. | Toward Efficient Mobile Electric Vehicle Charging under Heterogeneous Battery Switching Technology | |
CN114253975B (en) | A load-aware road network shortest path distance calculation method and device | |
Long et al. | Scheduling problem of movie scenes based on three meta-heuristic algorithms | |
CN118857324A (en) | Path planning method for collaborative operation of unmanned sanitation vehicles | |
Ghorbanioskalaei et al. | On the use of agile optimization for efficient energy consumption in smart cities’s transportation and mobility |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Open date: 20060621 |