CN111325498A - User route generation method and device for VRPSPD, electronic equipment and storage medium - Google Patents

User route generation method and device for VRPSPD, electronic equipment and storage medium Download PDF

Info

Publication number
CN111325498A
CN111325498A CN202010069786.8A CN202010069786A CN111325498A CN 111325498 A CN111325498 A CN 111325498A CN 202010069786 A CN202010069786 A CN 202010069786A CN 111325498 A CN111325498 A CN 111325498A
Authority
CN
China
Prior art keywords
sequences
preset number
sequence
user
initial
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.)
Granted
Application number
CN202010069786.8A
Other languages
Chinese (zh)
Other versions
CN111325498B (en
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.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
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 Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN202010069786.8A priority Critical patent/CN111325498B/en
Publication of CN111325498A publication Critical patent/CN111325498A/en
Application granted granted Critical
Publication of CN111325498B publication Critical patent/CN111325498B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping
    • G06Q10/0835Relationships between shipper or supplier and carriers
    • G06Q10/08355Routing methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • 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)
  • Physics & Mathematics (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Biology (AREA)
  • Economics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Quality & Reliability (AREA)
  • Artificial Intelligence (AREA)
  • Tourism & Hospitality (AREA)
  • Strategic Management (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Human Resources & Organizations (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Physiology (AREA)
  • Genetics & Genomics (AREA)
  • General Business, Economics & Management (AREA)
  • Biomedical Technology (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 embodiment of the invention provides a user route generation method, a user route generation device, electronic equipment and a storage medium for VRPSPD, wherein the method comprises the following steps: generating a first preset number of initial sequences aiming at a plurality of users; selecting a second preset number of initial sequences as target sequences; copying the initial sequence to obtain a copied sequence, and performing cross operation on the copied sequence to obtain a third preset number of crossed sequences; performing recombination operation on the crossed sequences to obtain a third preset number of recombined sequences; performing mutation operation on the recombined sequences of a third preset number to obtain mutated sequences; performing improvement operation on the copied target sequences of a second preset number to obtain improved sequences; and according to the sequence of the fitness, selecting to obtain a first preset number of selected sequences, and updating the initial sequences into the selected sequences. The embodiment of the invention can accelerate the convergence speed of the user route generation method.

Description

User route generation method and device for VRPSPD, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of computer science, in particular to a user route generation method and device for a VRPSPD, electronic equipment and a storage medium.
Background
In the industrial production and distribution of the material-oriented commodities, the phenomenon of no-load of transport return vehicles is widely existed, which causes the waste of transport resources. In production and distribution, users often have a need for changing goods, returning goods, or returning waste materials and industrial production residual materials to a distribution warehouse, if in an original distribution system of an enterprise, after a distribution Vehicle distributes goods to the users, the distribution Vehicle returned from the users to a distribution center is also used for loading goods needing to be returned to the distribution warehouse, so that transportation resources can be fully utilized, and further economic benefits can be indirectly increased.
In the prior art, a genetic algorithm is usually adopted to solve the VRPSPD, the genetic algorithm is a calculation model of a biological evolution process simulating natural selection and genetic mechanism of Darwin biological evolution theory, and is a method for searching an optimal solution by simulating the natural evolution process, and the specific solving process is as follows: aiming at a plurality of users needing to be delivered, generating a plurality of initial sequences according to user identifications corresponding to the users, wherein each initial sequence comprises a plurality of different sub-sequences, each sub-sequence respectively represents different delivery routes, each sub-sequence comprises a plurality of different user identifications, then, performing cross operation on the initial sequences, the cross operation can specifically be to exchange the user identifications in the two initial sequences, then, performing mutation operation on the sequences obtained after cross, the mutation operation can specifically be to change part of the user identifications in each initial sequence, finally, in the sequences obtained after mutation, calculating the fitness of each sequence after mutation, performing selection operation by using the fitness to obtain a plurality of new sequences, updating each initial sequence into a new sequence, performing cross, mutation and selection operation again, and performing iterative cycle for a plurality of times, and finally obtaining a plurality of target sequences, and finally determining one target sequence as an approximate optimal solution according to the fitness of each target sequence by calculating the fitness of each target sequence.
Because the genetic algorithm in the prior art firstly generates an initial sequence, then carries out crossing, variation and selection operations on the initial sequence to generate a plurality of new sequences, updates each initial sequence into a new sequence, carries out crossing, variation and selection operations again, and iterates for a plurality of times to finally obtain a plurality of target sequences, in the prior art, only two evolution processes of crossing and variation are included, the overall convergence speed is slow, and a near-optimal solution can be obtained only through a plurality of iterative cycles.
Disclosure of Invention
The embodiment of the invention aims to provide a user route generation method and device for a VRPSPD, an electronic device and a storage medium, so as to accelerate the convergence speed of the user route generation method. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a user route generation method for a VRPSPD, where the method includes:
generating user identifications corresponding to users aiming at a plurality of users for generating routes, and generating a first preset number of initial sequences by using a preset maximum loading capacity of a delivery vehicle and a size relation between sums of user delivery amounts corresponding to the user identifications, wherein each initial sequence comprises a plurality of subsequences, each subsequence comprises a plurality of different user identifications, the subsequences are used for representing different delivery routes, and the maximum loading capacity of the delivery vehicle of the delivery route corresponding to the subsequences is larger than or equal to the sum of the user delivery amounts corresponding to the user identifications on the delivery route;
calculating the fitness of each initial sequence, selecting a second preset number of initial sequences from the first preset number of initial sequences based on the fitness to serve as target sequences, and performing copying operation on the second preset number of target sequences to obtain a second preset number of copied target sequences, wherein the fitness of the target sequences is smaller than the fitness of other initial sequences except the target sequences in the first preset number of initial sequences;
copying the first preset number of initial sequences to obtain a third preset number of copied sequences, and performing cross operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences, wherein the third preset number is greater than the first preset number, at least one user identifier exists in the crossed sequences, and the position of the user identifier in the crossed sequences is the same as the position of the user identifier in the copied sequences; at least one user identifier exists in the crossed sequence, and the position of the user identifier in the crossed sequence is different from the position of the user identifier in the copied sequence;
performing recombination operation on the sequences after the crossing according to the third preset number of sequences after the crossing to obtain a third preset number of sequences after the crossing, wherein the subsequence in the sequence after the recombination is different from the subsequence in the sequence after the crossing;
performing variation operation on the third preset number of recombined sequences to obtain a third preset number of varied sequences, wherein at least one user identifier exists in the varied sequences, and the subsequence to which the user identifier belongs in the sequences is different from the subsequence to which the user identifier belongs in the recombined sequences;
performing improvement operation on a second preset number of copied target sequences to obtain a second preset number of improved sequences, wherein at least one user identifier exists in the improved sequences, and the position of the user identifier in the subsequence is different from the position of the user identifier in the subsequence in the copied sequences;
calculating the fitness of the improved sequences of the second preset number and the mutated sequences of the third preset number, selecting the selected sequences of the first preset number according to the sequence of the fitness, updating the initial sequences into the selected sequences, executing the steps of calculating the fitness of each initial sequence, and selecting the initial sequences of the second preset number from the initial sequences of the first preset number based on the fitness to serve as target sequences.
Optionally, the step of generating a user identifier corresponding to each user for a plurality of users to be subjected to route generation, and generating a first preset number of initial sequences by using a preset maximum load of a delivery vehicle and a size relationship between sums of user delivery amounts corresponding to each user identifier includes:
generating user identifications corresponding to the users aiming at a plurality of users to be subjected to route generation;
determining a user identifier from the plurality of user identifiers, and generating an initial subsequence by using the user identifier and a predetermined distribution center identifier, wherein the distribution center identifier is used for identifying a distribution center;
selecting a current user identifier from the plurality of user identifiers, and calculating the sum of the user delivery amount corresponding to the current user identifier and the user delivery amount corresponding to each user identifier in a current subsequence to obtain the sum of the goods delivery amounts, wherein the current subsequence is generated based on the initial subsequence;
judging whether the sum of the goods delivery amount is smaller than or equal to the maximum loading amount of the delivery vehicle, wherein the delivery vehicle is used for delivering the goods of the delivery center to the user corresponding to each user identifier in the subsequence, or delivering the goods of the user corresponding to each user identifier to the delivery center;
if the sum of the cargo delivery amount is less than or equal to the maximum delivery vehicle loading amount, inserting the current user identifier into the current subsequence to obtain a new subsequence, updating the current subsequence to the new subsequence, and executing the step of selecting the current user identifier from the user identifiers;
and if the sum of the cargo delivery amount is larger than the maximum loading amount of the delivery vehicle, executing the step of determining a user identifier from the plurality of user identifiers and generating an initial subsequence by using the user identifier and a predetermined delivery center identifier.
Optionally, the step of inserting the current user identifier into the current subsequence to obtain a new subsequence includes:
inserting the current user identifier between two adjacent user identifiers in the current subsequence, or inserting the current user identifier between the distribution center identifier and the user identifier in the current subsequence, so as to obtain a plurality of current subsequences;
calculating the transportation cost of each current subsequence in the plurality of current subsequences by using a first preset expression, wherein the first preset expression is as follows:
f1=(2cok+clm)-β(clk+ckm)
in the formula (f)1Representing said transportation costs, cokRepresenting the transportation cost of the delivery vehicle driving from the delivery center to the current user corresponding to the current user identifier, clmRepresenting the transportation cost of the delivery vehicle when transporting from between two adjacent users, β representing a preset weight coefficient, clk representing the transportation cost of the delivery vehicle traveling from one of the two adjacent users to the current user, ckmRepresenting a transportation cost of the delivery vehicle traveling from the current customer to the other of the two adjacent customers;
and comparing the transport costs of the current subsequences in the current subsequences, and determining the current subsequence corresponding to the minimum transport cost as the new subsequence.
Optionally, the step of calculating a fitness of each of the initial sequences, and selecting a second preset number of initial sequences from the first preset number of initial sequences as a target sequence based on the fitness includes:
calculating the fitness of each initial sequence according to a second preset expression, wherein the second preset expression is as follows:
fitness(u)=αTD+(1-α)(Wmax-Wmin)
wherein, fitness (u) represents the fitness of the u-th initial sequence, α represents a preset balance coefficient, TD represents the total driving distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequence, W represents the total driving distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequence, andmaxrepresents the maximum driving distance, W, of the distribution route corresponding to all the subsequences in the u-th initial sequenceminRepresenting the minimum driving distance in the distribution routes corresponding to all the sub-sequences in the U-th initial sequence, U ∈ U, wherein U is {1, 2, 3, … …, m }, U represents the number set of the initial sequences, and m represents the first preset number;
sorting each fitness obtained by calculation;
and selecting a second preset number of initial sequences as the target sequences according to the sequence of the fitness from small to large.
Optionally, the step of performing a copy operation on the first preset number of initial sequences to obtain a third preset number of copied sequences, and performing a crossover operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences includes:
determining the copying times of each initial sequence in the initial sequences of the first preset number by using the third preset number and the first preset number;
copying the initial sequences of the first preset number by using the copying times of all the initial sequences to obtain copied sequences of a third preset number;
for each sequence in the third preset number of copied sequences, keeping a fourth preset number of subsequences in the sequence unchanged, acquiring user identifiers in other subsequences except the fourth preset number of subsequences in the sequence, and deleting the user identifiers in other subsequences from the sequence;
aiming at the user identifiers in the other sub-sequences, generating a plurality of sub-sequences by utilizing the preset maximum loading capacity of the delivery vehicles and the size relationship between the sum of the user delivery quantities corresponding to the user identifiers;
and combining the fourth preset number of subsequences and the generated multiple subsequences into the crossed sequence.
Optionally, the step of performing a recombination operation on the sequences after crossing by aiming at the sequences after crossing by the third preset number to obtain a third preset number of recombined sequences includes:
deleting a fifth preset number of user identifications from the sequences aiming at each sequence in the third preset number of crossed sequences;
and reinserting the deleted user identifications with the fifth preset number into the sequence to obtain the recombined sequence.
Optionally, the step of performing a mutation operation on the third preset number of recombined sequences to obtain a third preset number of mutated sequences includes:
and deleting the user identifier in one subsequence in the recombined sequence aiming at each sequence in the third preset number of recombined sequences, and inserting the user identifier into the other subsequence in the recombined sequence to obtain the sequence after variation.
In a second aspect, an embodiment of the present invention provides a user route generation apparatus for a VRPSPD, where the apparatus includes:
the generating module is used for generating user identifiers corresponding to users aiming at a plurality of users for generating routes, generating a first preset number of initial sequences by utilizing a preset maximum loading capacity of a delivery vehicle and a size relation between sums of user delivery amounts corresponding to the user identifiers, wherein each initial sequence comprises a plurality of subsequences, each subsequence comprises a plurality of different user identifiers, the subsequences are used for representing different delivery routes, and the maximum loading capacity of the delivery vehicle of the delivery route corresponding to each subsequence is larger than or equal to the sum of the user delivery amounts corresponding to the user identifiers on the delivery route;
the first processing module is used for calculating the fitness of each initial sequence, selecting a second preset number of initial sequences from the first preset number of initial sequences as target sequences based on the fitness, and performing copy operation on the second preset number of target sequences to obtain a second preset number of copied target sequences, wherein the fitness of the target sequences is smaller than the fitness of other initial sequences except the target sequences in the first preset number of initial sequences;
a second processing module, configured to copy the first preset number of initial sequences to obtain a third preset number of copied sequences, and perform a crossover operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences, where the third preset number is greater than the first preset number, at least one user identifier exists in the crossed sequences, and a position of the user identifier in the crossed sequences is the same as a position of the user identifier in the copied sequences; at least one user identifier exists in the crossed sequence, and the position of the user identifier in the crossed sequence is different from the position of the user identifier in the copied sequence;
a recombination module, configured to perform recombination operation on the sequences after crossing in the third preset number of sequences after crossing to obtain a third preset number of sequences after recombination, where a subsequence in the sequence after recombination is different from a subsequence in the sequence after crossing;
a variation module, configured to perform a variation operation on the third preset number of recombined sequences to obtain a third preset number of varied sequences, where at least one user identifier exists in the varied sequences, and a subsequence to which the user identifier belongs in the sequence is different from a subsequence to which the user identifier belongs in the recombined sequences;
an improvement module, configured to perform an improvement operation on a second preset number of copied target sequences to obtain a second preset number of improved sequences, where at least one user identifier exists in each improved sequence, and a position of the user identifier in a subsequence is different from a position of the user identifier in the subsequence in the copied sequence;
and a third processing module, configured to calculate the improved sequences of the second preset number and the fitness of the sequences after the variation of the third preset number, select a selected sequence of the first preset number according to a high-low order of the fitness, update the initial sequences to the selected sequences, perform the calculation of the fitness of each initial sequence, and select a second preset number of initial sequences from the first preset number of initial sequences based on the fitness, as a target sequence.
Optionally, the generating module includes:
the first generation submodule is used for generating user identifications corresponding to the users aiming at a plurality of users for generating routes;
a first processing submodule, configured to determine a user identifier from the multiple user identifiers, and generate an initial subsequence by using the user identifier and a predetermined distribution center identifier, where the distribution center identifier is used to identify a distribution center;
a second processing sub-module, configured to select a current user identifier from the multiple user identifiers, and calculate a sum of a user delivery amount corresponding to the current user identifier and a user delivery amount corresponding to each user identifier in a current sub-sequence, to obtain a sum of goods delivery amounts, where the current sub-sequence is generated based on the initial sub-sequence;
a determining submodule, configured to determine whether a sum of the cargo delivery amounts is smaller than or equal to a maximum loading amount of the delivery vehicle, where the delivery vehicle is configured to deliver the cargo of the delivery center to the user corresponding to each user identifier in the subsequence, or deliver the cargo of the user corresponding to each user identifier to the delivery center;
a third processing sub-module, configured to insert a current user identifier into the current sub-sequence to obtain a new sub-sequence if the sum of the cargo delivery amounts is less than or equal to the maximum delivery vehicle loading amount, update the current sub-sequence to the new sub-sequence, and trigger the second processing sub-module to perform the step of selecting the current user identifier from the plurality of user identifiers;
and the triggering sub-module is used for triggering the first processing sub-module to execute the steps of determining a user identifier from the plurality of user identifiers and generating an initial sub-sequence by using the user identifier and a predetermined distribution center identifier if the sum of the cargo distribution amount is larger than the maximum loading amount of the distribution vehicle.
Optionally, the third processing sub-module includes:
an inserting unit, configured to insert the current user identifier between two adjacent user identifiers in the current subsequence, or insert the current user identifier between the distribution center identifier and a user identifier in the current subsequence, to obtain multiple current subsequences;
a calculating unit, configured to calculate, by using a first preset expression, a transportation cost of each current subsequence in the multiple current subsequences, where the first preset expression is:
f1=(2cok+clm)-β(clk+ckm)
in the formula (f)1Representing said transportation costs, cokRepresenting the transportation cost of the delivery vehicle driving from the delivery center to the current user corresponding to the current user identifier, clmRepresenting the transportation cost of the delivery vehicle when transporting from between two adjacent users, β representing a preset weight coefficient, clkRepresenting the transportation cost of said delivery vehicle travelling from one of said two adjacent users to said current user, ckmIndicating the delivery vehicleA cost of transportation to travel from the current user to the other of the two adjacent users;
and the processing unit is used for comparing the transport costs of the current subsequences in the current subsequences and determining the current subsequence corresponding to the minimum transport cost as the new subsequence.
Optionally, the first processing module includes:
the calculating submodule is used for calculating the fitness of each initial sequence according to a second preset expression, and the second preset expression is as follows:
fitness(u)=αTD+(1-α)(Wmax-Wmin)
wherein, fitness (u) represents the fitness of the u-th initial sequence, α represents a preset balance coefficient, TD represents the total driving distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequence, W represents the total driving distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequence, andmaxrepresents the maximum driving distance, W, of the distribution route corresponding to all the subsequences in the u-th initial sequenceminRepresenting the minimum driving distance in the distribution routes corresponding to all the sub-sequences in the U-th initial sequence, U ∈ U, wherein U is {1, 2, 3, … …, m }, U represents the number set of the initial sequences, and m represents the first preset number;
the ordering submodule is used for ordering the fitness obtained by calculation;
and the selection submodule is used for selecting a second preset number of initial sequences as the target sequences according to the sequence of the fitness from small to large.
Optionally, the second processing module includes:
the determining submodule is used for determining the copying times of each initial sequence in the initial sequences of the first preset number by utilizing the third preset number and the first preset number;
the replication submodule is used for performing replication operation on the initial sequences of the first preset number by using the replication times of all the initial sequences to obtain a third preset number of replicated sequences;
a fourth processing sub-module, configured to keep a fourth preset number of subsequences in the sequence unchanged for each sequence in the third preset number of copied sequences, obtain user identifiers in other subsequences in the sequence except for the fourth preset number of subsequences, and delete the user identifiers in the other subsequences from the sequence;
a second generation sub-module, configured to generate, for the user identifiers in the other sub-sequences, a plurality of sub-sequences by using a preset maximum loading amount of a delivery vehicle and a size relationship between sums of user delivery amounts corresponding to the user identifiers;
a combining sub-module, configured to combine the fourth preset number of sub-sequences and the generated plurality of sub-sequences into the crossed sequence.
Optionally, the restructuring module comprises:
a deletion submodule, configured to delete a fifth preset number of user identifiers from the sequence for each sequence in the third preset number of crossed sequences;
and the inserting submodule is used for reinserting the deleted user identifications with the fifth preset number into the sequence to obtain the recombined sequence.
Optionally, the variant module is specifically configured to:
and deleting the user identifier in one subsequence in the recombined sequence aiming at each sequence in the third preset number of recombined sequences, and inserting the user identifier into the other subsequence in the recombined sequence to obtain the sequence after variation.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and a processor for implementing any of the above-described user route generation methods for a VRPSPD when executing a program stored in the memory.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any of the method steps described above. A computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-described user route generation methods for a VRPSPD.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a user route generation method, a user route generation device, electronic equipment and a storage medium for VRPSPD (virtual router redundancy protocol), which can generate a plurality of users aiming at a route to be performed, generate user identifications corresponding to the users, and generate a first preset number of initial sequences by utilizing the preset maximum loading capacity of a delivery vehicle and the size relation between the sum of user delivery capacities corresponding to the user identifications; copying a second preset number of target sequences in the first preset number of initial sequences to obtain a second preset number of copied sequences; copying the first preset number of initial sequences to obtain a third preset number of copied sequences, and performing cross operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences; aiming at the sequences after the crossing of the third preset number, carrying out recombination operation on the sequences after the crossing to obtain the recombined sequences of the third preset number; performing mutation operation on the recombined sequences of a third preset number to obtain the mutated sequences of the third preset number; performing improvement operation on a second preset number of copied target sequences to obtain a second preset number of improved sequences; calculating the fitness of the second preset number of improved sequences and the third preset number of mutated sequences, selecting and obtaining the first preset number of selected sequences according to the high-low sequence of the fitness, updating the initial sequence into the selected sequence, and entering an iterative loop process. In the embodiment of the invention, after the initial sequence is obtained, a part of the initial sequence can be subjected to copying operation and improvement operation, and the initial sequence is subjected to crossing operation, recombination operation, mutation operation and selection operation, so that the convergence speed of the user route generation method can be increased. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a user route generation method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a sequence processing procedure according to an embodiment of the present invention;
FIG. 3a is a schematic diagram of a delivery scheme provided by an embodiment of the invention;
FIG. 3b is a schematic illustration of a selection of a delivery route in a delivery scenario;
FIG. 3c is a schematic illustration of a modified delivery scheme;
FIG. 4 is a diagram illustrating a result of a simulation calculation according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a user route generating device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a user route generation method for a VRPSPD, which may include:
s101, aiming at a plurality of users to be subjected to route generation, generating user identifications corresponding to the users, and generating a first preset number of initial sequences by utilizing the preset maximum loading capacity of a delivery vehicle and the size relation between the sum of the user delivery capacities corresponding to the user identifications.
In the generated first preset number of initial sequences, each initial sequence may include user identifiers corresponding to a plurality of users, for example, when the number of users is 100, the number of user identifiers in each initial sequence is 100, and the first preset number of initial sequences may indicate that, for the plurality of users, the generated first preset number of different delivery schemes are different. The first preset number may be a preset number, which may be set empirically or experimentally, and may be set to 100, for example.
Each initial sequence comprises a plurality of subsequences, each subsequence comprises a plurality of different user identifications, the subsequences are used for representing different distribution routes, and each distribution route is used for distributing goods from a distribution center to each user on the distribution route by a distribution vehicle, namely the goods are distributed from the distribution center to the user corresponding to each user identification in the subsequences, or the goods to be returned to the distribution center by the user are conveyed to the distribution center. The maximum load capacity of each delivery vehicle is set in advance, and indicates the maximum weight of the delivery vehicle capable of loading the cargo. For each subsequence, the maximum loading capacity of the delivery vehicles of the delivery route corresponding to the subsequence is greater than or equal to the sum of the delivery capacities of the users corresponding to the user identifications on the delivery route.
And S102, calculating the fitness of each initial sequence, selecting a second preset number of initial sequences from the first preset number of initial sequences based on the fitness to serve as target sequences, and copying the second preset number of target sequences to obtain a second preset number of copied target sequences.
In the embodiment of the present invention, the fitness of the target sequence is smaller than the fitness of other initial sequences except the target sequence in the first preset number of initial sequences, and it should be noted that the fitness generally indicates the degree of goodness of the initial sequences, that is, whether the distribution scheme corresponding to the initial sequence is a better scheme or not, and the smaller the fitness is, the better the distribution scheme corresponding to the initial sequence is, and correspondingly, the larger the fitness is, the worse the distribution scheme corresponding to the initial sequence is, so that the target sequence is the better distribution scheme in all the initial sequences. The second preset number may be a preset number, and may be set according to experiments or experience, for example, the second preset number may be set to 30% of the first preset number, and when the first preset number is 100, the second preset number may be 30. After selecting to obtain a second preset number of target sequences, referring to fig. 2, a copy operation may be performed on the second preset number of target sequences to obtain a second preset number of copied target sequences.
S103, copying the first preset number of initial sequences to obtain a third preset number of copied sequences, and performing cross operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences.
In order to enable the preferred delivery schemes to be selected from the sequences with a larger number and to perform operations such as copy operation and crossover operation again by using the preferred delivery schemes, in the embodiment of the present invention, the third predetermined number may be set to a value larger than the first predetermined number, and the third predetermined number may be set to a difference between twice the first predetermined number and the second predetermined number, that is, when the first predetermined number is 100 and the second predetermined number is 30, the third predetermined number may be 170. In this step, first 100 initial sequences need to be copied into 170 copied sequences, see fig. 2, and then the 170 copied sequences are interleaved, where it should be noted that the specific process of interleaving is described in the following.
At least one user identifier exists in the crossed sequence, and the position of the user identifier in the crossed sequence is the same as the position of the user identifier in the copied sequence; and at least one user identifier exists in the crossed sequence, and the position of the user identifier in the crossed sequence is different from the position of the user identifier in the copied sequence. That is, in the process of performing the interleaving operation on 170 copied sequences, for each sequence, a part of the user identifiers are kept unchanged, and the positions of the other part of the user identifiers in the sequence are changed.
And S104, aiming at the sequences after the third preset number of crossovers, carrying out recombination operation on the sequences after the crossovers to obtain the sequences after the third preset number of recombinations.
Referring to fig. 2, a third predetermined number of sequences after crossing may be recombined, so that the subsequence in each sequence may be changed, that is, the subsequence in each recombined sequence is different from the subsequence in each sequence after crossing, where it should be noted that each subsequence in each recombined sequence is different from the subsequence in each sequence after crossing, or a part of the subsequence in each recombined sequence is different from a part of the subsequence in each sequence after crossing. It should also be noted that the specific recombination process is described below.
And S105, performing mutation operation on the recombined sequences of the third preset number to obtain the sequences of the third preset number after mutation.
Referring to FIG. 2, after a third predetermined number of recombined sequences are obtained, these recombined sequences may be subjected to a mutation operation. In the embodiment of the present invention, at least one user identifier exists in the mutated sequence, and the subsequence to which the user identifier belongs in the sequence is different from the subsequence to which the user identifier belongs in the recombined sequence, that is, the mutation process may be to change the subsequence of one user identifier in the recombined sequence to another subsequence. The specific process of mutation is described below.
And S106, performing improvement operation on the copied target sequences of the second preset number to obtain the improved sequences of the second preset number.
Referring to fig. 2, an improvement operation may be performed on a second preset number of copied target sequences to obtain an improved sequence, where at least one user identifier exists in the improved sequence, and a position of the user identifier in the subsequence is different from a position of the user identifier in the subsequence in the copied sequence, that is, a position of the user identifier in the subsequence is changed, that is, a position of a user corresponding to the user identifier in the delivery route is changed.
S107, calculating the fitness of the second preset number of improved sequences and the third preset number of mutated sequences, selecting and obtaining the first preset number of selected sequences according to the sequence of the fitness, updating the initial sequence to the selected sequence, and then executing the step S102 in the flowchart shown in fig. 1.
Calculating the fitness of the second preset number of improved sequences and the third preset number of mutated sequences, referring to fig. 2, selecting the first preset number of selected sequences according to the sequence of the fitness, and updating the first preset number of initial sequences to the first preset number of selected sequences. Then, an iterative loop process is entered, that is, a copy operation, a crossover operation, a reassembly operation, a mutation operation, an improvement operation, and a selection operation are performed again for the updated sequence, and after a preset cut-off condition is reached, the iterative process is ended, where the preset cut-off condition may be: the iteration times reach the preset iteration times. In the last iteration process, a first preset number of sequences are obtained through selection, the fitness of the first preset number of sequences is calculated respectively, a selected sequence is obtained through selection according to the sequence of the fitness, and the delivery route corresponding to the selected sequence is the optimal delivery route. It should be noted that, by using the fitness of each sequence, the first predetermined number of sequences may be selected from the second predetermined number of improved sequences and the third predetermined number of varied sequences according to the roulette wheel selection method in the prior art, which is not described in detail in the embodiments of the present invention.
As an optional implementation manner of the embodiment of the present invention, step S101 of the embodiment shown in fig. 1 may include:
the method comprises the steps of firstly, generating user identifications corresponding to users aiming at a plurality of users to be subjected to route generation.
The binary number may be used to encode a plurality of users to obtain a user identifier corresponding to each user, and to simplify the description process, for example, the number of users to be subjected to route generation may be set to 4, and the user identifier of each user may be: 001. 010, 011 and 100 indicate that the user identities of different users should be different.
And secondly, determining a user identifier from the plurality of user identifiers, and generating an initial subsequence by using the user identifier and a predetermined distribution center identifier.
The distribution center identification may be used to identify the distribution center, which may be encoded prior to generating the initial subsequence, e.g., the distribution center identification may be 000. A user id may be randomly determined from a plurality of user ids, and an initial sub-sequence may be generated by using the user id and the distribution center id, for example, the determined user id is 001, and the initial sub-sequence is 000001. In the actual distribution process, after the distribution vehicle corresponding to the initial sub-sequence starts from the distribution center, the distribution vehicle corresponding to each user identifier in the sub-sequence should return to the distribution center after the distribution is completed. In addition, the distribution vehicles may be preset so that each distribution vehicle distributes only one user at the same time and immediately travels to another user after one user is distributed.
And thirdly, selecting the current user identifier from the plurality of user identifiers, and calculating the sum of the user delivery amount corresponding to the current user identifier and the user delivery amount corresponding to each user identifier in the current subsequence to obtain the sum of the goods delivery amounts.
From the plurality of user identifiers, one user identifier may be randomly selected as the current user identifier, for example, the selected current user identifier is 010, and the current sub-sequence is generated based on the initial sub-sequence, that is, the current sub-sequence may be the initial sub-sequence, or may be generated by inserting one user identifier on the basis of the initial sub-sequence. In this step, the current subsequence is taken as an example of the initial subsequence, that is, the current subsequence is 000001, which indicates that the delivery vehicle starts from the delivery center, travels to the user corresponding to 001, and returns to the delivery center from the user corresponding to 001.
The sum of the user delivery amounts of the user corresponding to 101 and the user delivery amounts of the user corresponding to 001 is calculated, and the sum of the cargo delivery amounts can be obtained. It should be noted that the user distribution amount of different users may be based on the weight of the goods actually required to be distributed.
And fourthly, judging whether the sum of the cargo delivery amount is less than or equal to the maximum loading amount of the delivery vehicle.
In the embodiment of the present invention, the delivery vehicle is configured to deliver the goods in the delivery center to the user corresponding to each user identifier in the subsequence, or deliver the goods of the user corresponding to each user identifier to the delivery center. And determining whether the sum of the cargo delivery amount is less than or equal to the maximum loading amount of the delivery vehicle, so as to determine whether the delivery vehicle on the delivery route corresponding to the current sub-sequence has enough capacity and load the cargo which needs to be returned by the user corresponding to the current user identifier.
And fifthly, if the sum of the cargo delivery amount is less than or equal to the maximum delivery vehicle loading amount, inserting the current user identifier into the current subsequence to obtain a new subsequence, updating the current subsequence to the new subsequence, and executing the step of selecting the current user identifier from the plurality of user identifiers.
If the sum of the cargo delivery amounts is less than or equal to the maximum delivery vehicle loading amount, it indicates that the delivery vehicle corresponding to the current sub-sequence can load the cargo to be returned by the user corresponding to the current user identifier, so that the current user identifier may be inserted into the current sub-sequence to obtain a new sub-sequence, for example, 101 is inserted into the 000001 sub-sequence, and the obtained new sub-sequence is: 000101001 or 000001101, and updating the current sub-sequence to a new sub-sequence, and selecting the current user identity from the plurality of user identities again until the plurality of user identities are all inserted into the sub-sequence. It should be noted that, in the process of generating each of the 100 initial sequences, the user identifier that has already been selected may be marked, and the marked user identifier is no longer selected in the process of subsequently selecting the current user identifier.
And sixthly, if the sum of the goods delivery amount is larger than the maximum loading amount of the delivery vehicle, determining a user identifier from a plurality of user identifiers, and generating an initial subsequence by using the user identifier and a predetermined delivery center identifier.
If the sum of the cargo delivery amount is larger than the maximum loading amount of the delivery vehicles, it indicates that the delivery vehicles corresponding to the current sub-sequence cannot load the cargos to be delivered by the user corresponding to the current user identifier, and therefore, a sub-sequence needs to be regenerated by using the current user identifier and the delivery center identifier, that is, a new delivery vehicle is adopted to deliver the cargos to be returned by the user corresponding to the current user identifier.
The above steps are a process for generating an initial sequence, and other initial sequences in the 100 initial sequences to be generated may also be generated according to the above process, which is not described in detail in this embodiment of the present invention.
By comparing the sum of the goods delivery amount with the maximum loading amount of the delivery vehicles and determining whether to insert the current user identifier into the current subsequence according to the size relationship between the sum of the goods delivery amount and the maximum loading amount of the delivery vehicles, the loading amounts of the delivery vehicles corresponding to the initial sequences can be balanced as much as possible in the process of generating the initial sequences.
In the prior art, the process of generating the initial sequence is generally: the method comprises the steps of performing region division on a whole region formed by a plurality of users aiming at a plurality of users for generating a route, generating a plurality of initial sequences according to the positions of the users and user identifications corresponding to the users, wherein each initial sequence comprises a plurality of different subsequences, the users corresponding to the user identifications in each subsequence are located in the same region, generating a new sequence through crossing, mutation and selection operations, updating the initial sequence into the new sequence, performing the crossing, mutation and selection operations again, and repeating the iteration cycle for a plurality of times to finally obtain a plurality of selected sequences. In the process of generating the initial sequence in the prior art, users corresponding to the user identifiers in each subsequence in each initial sequence are all located in one region, and then, multiple intersection, variation and selection operations are performed on the initial sequence to finally obtain an approximately optimal solution, so the optimal solution obtained by the user route generation method in the prior art is the optimal solution in the region, but for users located at the edge of the region, there may be a distribution route obtained by inserting the users into a distribution route of a next-door region of the region, and the transportation cost is lower, so the user route generation method in the prior art easily generates a local optimal solution.
In the embodiment of the present invention, in the process of generating the initial sequence, the plurality of users are not divided into regions, so that the users corresponding to the user identifiers in each subsequence in the generated initial sequence may not be located in the same divided region in the prior art, and therefore, the problem of the local optimal solution in the prior art can be solved.
In addition, in the process of generating the initial sequence, in addition to considering the maximum carrying capacity of each delivery vehicle, the maximum delivery distance of each delivery vehicle may be set, and the distance between the user corresponding to the current user identifier and the user corresponding to the user identifier in the current subsequence may be calculated. Thus, the transportation cost of each distribution vehicle can be further balanced, and the situation that the overall transportation cost is increased in the distribution scheme due to the fact that the distribution vehicle runs far can be avoided.
As an optional implementation manner of the embodiment of the present invention, the fifth step in step S101 of the flowchart shown in fig. 1 may include:
the first step is to insert the current user identifier between two adjacent user identifiers in the current subsequence, or to insert the current user identifier between the distribution center identifier and the user identifier in the current subsequence, so as to obtain a plurality of current subsequences.
In this step, it is necessary to insert the current user id into different positions in the current sub-sequence, and obtain multiple current sub-sequences, for example, insert 101 into 000001100 sub-sequences, then the obtained new sub-sequences may be: 000101001100, 000001101100, and 000001100100.
And secondly, calculating the transportation cost of each current subsequence in the plurality of current subsequences by using a first preset expression, wherein the first preset expression is as follows:
f1=(2cok+clm)-β(clk+ckm)
in the formula (f)1Representing the cost of transportation, cokRepresenting the transportation cost of the delivery vehicle driving from the delivery center to the current user corresponding to the current user identifier, clmRepresenting transportation costs of the delivery vehicle when transporting from between the adjacent two users, β representing a preset weight coefficient, clkRepresenting the transportation cost, ck, of the delivery vehicle travelling from one of the two adjacent users to the current usermRepresents the transportation cost of the delivery vehicle traveling from the current customer to the other of the two adjacent customers.
In the embodiment of the invention, before calculating the transportation cost, the coordinate positions of a plurality of users and a distribution center can be obtained, the distance between two adjacent users is calculated by using an Euclidean distance calculation formula, and the transportation cost of each current subsequence is calculated by using a first preset expression. In the calculation process, the weight coefficient can be set according to experiments or experiences, and the value range of the weight coefficient can be 0.2-1.4.
And thirdly, comparing the transportation cost of each current subsequence in the plurality of current subsequences, and determining the current subsequence corresponding to the minimum transportation cost as a new subsequence.
After the transportation costs of each current sub-sequence in the plurality of current sub-sequences are obtained, the transportation costs of each current sub-sequence may be compared, and the current sub-sequence corresponding to the minimum transportation cost may be determined as a new sub-sequence.
As an optional implementation manner of the embodiment of the present invention, step S102 of the flowchart in the embodiment shown in fig. 1 may include:
and step one, calculating the fitness of each initial sequence according to a second preset expression.
The second preset expression is:
fitness(u)=αTD+(1-α)(Wmax-Wmin)
where, fitness (u) represents the fitness of the u-th initial sequence, α represents a preset balance coefficient, TD represents the total travel distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequence, and W represents the total travel distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequencemaxRepresents the maximum driving distance, W, of the distribution route corresponding to all the subsequences in the u-th initial sequenceminAnd U ∈ U, wherein U is {1, 2, 3, … …, m }, U represents the number set of the initial sequences, and m represents a first preset number.
The balance coefficient is preset, and may be set empirically or experimentally, for example, α may be set to 0.7, it should be noted that, in step S107 of the flowchart in fig. 1, the fitness of the second preset number of modified sequences and the fitness of the third preset number of mutated sequences may also be calculated by using the second preset expression.
And secondly, sequencing the fitness obtained by calculation. After the fitness of each initial sequence is calculated, the fitness can be ranked in order from small to large.
And thirdly, selecting a second preset number of initial sequences as target sequences according to the sequence of the fitness from small to large.
In order from small to large, a second preset number of initial sequences are selected from the first preset number of initial sequences, namely 30 initial sequences are selected from 100 initial sequences, and the 30 initial sequences have small fitness compared with other initial sequences, so that the total travel distance of the distribution routes corresponding to all the sub-sequences in the initial sequences is smaller, and/or the difference between the maximum travel distance and the minimum travel distance of the distribution routes corresponding to all the sub-sequences in the initial sequences is smaller, so that the transportation cost of the distribution vehicles in the initial sequences is smaller, namely the distribution scheme is better.
As an optional implementation manner of the embodiment of the present invention, step S103 of the embodiment shown in fig. 1 may include:
and step one, determining the copying times of each initial sequence in the initial sequences with the first preset number by using the third preset number and the first preset number.
Since the third preset number is usually greater than the first preset number, in the process of copying the initial sequence, part of the initial sequence may be copied only once or may be copied multiple times, and thus, the copying times of each initial sequence in the initial sequences of the first preset number may be determined by using the third preset number and the first preset number. For example, when the first preset number is 100 and the third preset number is 170, the number of copies of 70 initial sequences randomly selected from the 100 initial sequences is set to 2, and the number of copies of the other 30 initial sequences is set to 1.
And secondly, copying the initial sequences of the first preset number by using the copying times of the initial sequences to obtain copied sequences of a third preset number.
For each initial sequence in the first preset number of initial sequences, when the number of times of copying the initial sequence is 1, copying the initial sequence once, and when the number of times of copying the initial sequence is 2, copying the initial sequence twice to obtain 170 copied sequences.
And thirdly, aiming at each sequence in the third preset number of copied sequences, keeping the fourth preset number of subsequences in the sequence unchanged, acquiring the user identifications in other subsequences except the fourth preset number of subsequences in the sequence, and deleting the user identifications in other subsequences from the sequence.
And keeping a part of subsequences in the sequences unchanged for each sequence in the 170 copied sequences obtained after copying, and taking out and deleting the user identification in the other part of subsequences from the subsequences. It should be noted that the fourth preset number may be set according to the number of subsequences in the sequence, and experiments and experience, for example, when the number of subsequences in the sequence is 10, the fourth preset number may be set to 6, so in this step, 6 subsequences in the 10 subsequences may be kept unchanged, and the user identifiers in the remaining 4 subsequences may be deleted from the subsequences.
And fourthly, aiming at the user identifications in other sub-sequences, generating a plurality of sub-sequences by utilizing the preset maximum loading capacity of the delivery vehicles and the size relation between the sum of the user delivery quantities corresponding to the user identifications.
For the user identifiers in the obtained 4 sub-sequences, a plurality of sub-sequences may be generated by using a preset maximum loading capacity of a delivery vehicle and a size relationship between a sum of user delivery amounts corresponding to the user identifiers, where the process of generating the plurality of sub-sequences may refer to the first step to the sixth step in step S101 of the embodiment shown in fig. 1, and details of the embodiment of the present invention are not repeated here. It should be noted that the number of generated subsequences may not be 4, but may be other numbers such as 5 or 3.
And fifthly, combining the fourth preset number of subsequences and the generated multiple subsequences into a crossed sequence. After obtaining the plurality of subsequences, the 6 subsequences and the generated plurality of subsequences may be combined to generate a cross sequence.
As an optional implementation manner of the embodiment of the present invention, step S104 of the flowchart shown in fig. 1 may include:
and step one, deleting a fifth preset number of user identifications from the sequences aiming at each sequence in a third preset number of crossed sequences.
For each of the 170 crossed sequences, a fifth preset number of user identifiers may be deleted from the sequence, and the positions of the user identifiers in the sequence may be determined by a random selection method. The third preset number may be a preset number, for example, the third preset number may be set to be one fifth of the number of all the user identifications in the sequence.
And step two, reinserting the deleted user identifications with the fifth preset number into the sequence to obtain a recombined sequence.
The deleted user identifier of one fifth is reinserted into the deleted sequence to obtain a recombined sequence, and it should be noted that the process of reinserting the deleted user identifier of one fifth into the deleted sequence may refer to the first step to the third step included in the fifth step of the flow process shown in fig. 1, which is not described again in the embodiments of the present invention.
As an optional implementation manner of the embodiment of the present invention, step S105 of the flowchart in the embodiment shown in fig. 1 may include:
and deleting the user identifier in one subsequence in the recombined sequence aiming at each sequence in a third preset number of recombined sequences, and inserting the user identifier into the other subsequence in the recombined sequence to obtain the sequence after variation.
For each sequence in the third preset number of recombined sequences, a user identifier may be randomly selected from the sequence, deleted from the atomic sequence, and inserted into another subsequence. As shown in fig. 3a, the user identifier corresponding to the user indicated by the arrow is the user identifier selected at random, wherein the solid black box represents the distribution center, a subsequence is selected at random, that is, a distribution route surrounded by the curve shown in fig. 3b is selected, the user identifier selected at random shown in fig. 3a is deleted from the atomic sequence, and is inserted into the subsequence corresponding to the distribution route selected in fig. 3b, so as to obtain the distribution route corresponding to the varied subsequence shown in fig. 3 c.
As an optional implementation manner of the embodiment of the present invention, step S106 of the flowchart shown in fig. 1 may include:
the method comprises the steps of firstly, aiming at each sequence in a second preset number of copied sequences, randomly selecting a user identifier positioned between two user identifiers from subsequences in the sequence, deleting the user identifier from the two user identifiers, and reinserting the user identifier between two other adjacent user identifiers in the subsequences to obtain a plurality of inserted subsequences.
Secondly, respectively calculating the transportation cost of the distribution route corresponding to each inserted subsequence by using a third preset expression, wherein the third preset expression is as follows:
f2=(cia+caj+cbc)-(cba+cac+cij)
in the formula (f)2Representing the cost of transportation of the delivery route corresponding to the inserted subsequence, ciaRepresenting the cost of transportation of the delivery vehicle from user i to user a, cajRepresenting the cost of transportation of the delivery vehicle from user a to user j, cbcRepresenting the cost of transportation of the delivery vehicle from customer b to customer c, cbaRepresenting the cost of transportation of the delivery vehicle from customer b to customer a, cacRepresenting the cost of transportation of the delivery vehicle from customer a to customer c, cijRepresents the transportation cost of the delivery vehicle traveling from user i to user j.
And thirdly, comparing the transportation cost of the distribution route corresponding to each inserted subsequence.
And fourthly, determining the subsequence of the distribution route with the minimum transportation cost as the subsequence obtained by the inserting operation.
Alternatively, step S106 of the embodiment shown in fig. 1 may also include:
the method comprises the steps of firstly, aiming at each sequence in a second preset number of copied sequences, randomly selecting two user identifications from subsequences in the sequence, wherein one of the two user identifications is located between the other two first user identifications, the other one of the two user identifications is located between two second users, and the first user identification and the second user identification belong to user identifications.
And secondly, exchanging the positions of the two randomly selected user identifications in the subsequence to obtain two exchanged subsequences.
Thirdly, respectively calculating the transportation cost of the two exchanged subsequences by using a fourth preset expression, wherein the fourth preset expression is as follows:
f3=(cik+ckj+clh+chm)-(clk+ckm+cih+chj)
in the formula (f)3Indicating the transportation cost of the exchanged sub-sequence, cik indicating the delivery vehicle from the customeriA transportation cost of traveling to the user k, ckj denotes a transportation cost of traveling the delivery vehicle from the user k to the user j, clh denotes a transportation cost of traveling the delivery vehicle from the user l to the user h, chm denotes a transportation cost of traveling the delivery vehicle from the user h to the user m, clk denotes a transportation cost of traveling the delivery vehicle from the user l to the user k, ckm denotes a transportation cost of traveling the delivery vehicle from the user k to the user m, cih denotes a transportation cost of traveling the delivery vehicle from the user i to the user h, and chj denotes a transportation cost of traveling the delivery vehicle from the user h to the user j.
And a fourth step of comparing the size of the transportation costs of the two exchanged subsequences.
And fifthly, determining the exchanged subsequence corresponding to the minimum transportation cost as a final exchanged subsequence.
According to the user route generation method for the VRPSPD provided by the embodiment of the invention, after the initial sequence is obtained, a part of the initial sequence can be subjected to copying operation and improving operation, and the initial sequence is subjected to cross operation, recombination operation, mutation operation and selection operation, so that the convergence speed of the user route generation method can be increased.
The beneficial effects of the user route generation method for the VRPSPD provided by the embodiment of the present invention are further described below through simulation calculation, 100, 200, and 400 users are respectively selected for simulation calculation, wherein the crossing rate of the crossing operation can be 0.9, the variation rate of the variation operation can be 0.09, and the recombination rate of the recombination operation can be 0.1, the weight coefficient β in the first preset expression is 0.2, the balance coefficient α in the second preset expression is 0.7, and the simulation results are shown in table 1.
TABLE 1 results of simulation calculations
Figure BDA0002377013490000201
Figure BDA0002377013490000211
In table 1, the number of users in examples r101, r201, c101, c201, rc101, and rc201 is 100, the number of users in examples r1_2_1, r2_2_1, c1_2_1, c2_2_1, rc1_2_1, and rc2_2_1 is 200, the number of users in examples r1_4_1, r2_4_1, c1_4_1, c2_4_1, rc1_4_1, and rc2_4_1 is 400, and the positions of the selected users in different examples and the distribution amount of users are different. The difference between the average value and the optimal value is the ratio of the difference between the average value of the distribution distances and the optimal value of the distribution distances to the average value of the distribution distances. Referring to fig. 4, fig. 4 is a schematic diagram showing the results of simulation for 100 users in the rc101 calculation example, wherein different curves represent the distribution routes of the distribution vehicles and the solid origin represents different users, and it can be seen from the results in fig. 4 that the optimal distribution vehicles are 9 vehicles and the total distribution distance is 1085.41m, corresponding to the rc101 calculation example in table 1. As can be seen from table 1, the difference between the optimal value of the dispensing distance and the average value is smaller than the average value, so the simulation experiment is stable.
An embodiment of the present invention provides a specific embodiment of a user route generating device for a VRPSPD, which corresponds to the flow shown in fig. 1, and referring to fig. 5, fig. 5 is a schematic structural diagram of a user route generating device for a VRPSPD according to an embodiment of the present invention, and includes:
the generating module 201 is configured to generate a user identifier corresponding to each user for a plurality of users to perform route generation, and generate a first preset number of initial sequences by using a preset maximum load of a delivery vehicle and a size relationship between sums of user delivery amounts corresponding to the user identifiers, where each initial sequence includes a plurality of sub-sequences, each sub-sequence includes a plurality of different user identifiers, the sub-sequences are used to represent different delivery routes, and a maximum load of the delivery vehicle of a delivery route corresponding to a sub-sequence is greater than or equal to a sum of user delivery amounts corresponding to the user identifiers on the delivery route.
The first processing module 202 is configured to calculate a fitness of each initial sequence, select a second preset number of initial sequences from the first preset number of initial sequences based on the fitness, use the second preset number of initial sequences as a target sequence, and perform a copy operation on the second preset number of target sequences to obtain a second preset number of copied target sequences, where the fitness of the target sequence is smaller than the fitness of other initial sequences except the target sequence in the first preset number of initial sequences.
The second processing module 203 is configured to copy the first preset number of initial sequences to obtain a third preset number of copied sequences, and perform a crossover operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences, where the third preset number is greater than the first preset number, at least one user identifier exists in the crossed sequences, and a position of the user identifier in the crossed sequences is the same as a position of the user identifier in the copied sequences; and at least one user identifier exists in the crossed sequence, and the position of the user identifier in the crossed sequence is different from the position of the user identifier in the copied sequence.
A recombination module 204, configured to perform recombination operation on the sequences after crossing according to a third preset number of sequences after crossing, to obtain a third preset number of sequences after recombination, where a subsequence in the sequence after recombination is different from a subsequence in the sequence after crossing.
A variation module 205, configured to perform a variation operation on a third preset number of the recombined sequences to obtain a third preset number of the varied sequences, where at least one user identifier exists in the varied sequences, and a subsequence to which the user identifier belongs in the sequence is different from a subsequence to which the user identifier belongs in the recombined sequences.
An improving module 206, configured to perform an improving operation on a second preset number of copied target sequences to obtain a second preset number of improved sequences, where at least one user identifier exists in the improved sequences, and a position of the user identifier in the subsequence is different from a position of the user identifier in the subsequence in the copied sequence.
A third processing module 207, configured to calculate fitness of a second preset number of improved sequences and a third preset number of mutated sequences, select a first preset number of selected sequences according to a high-low order of the fitness, update the initial sequences to the selected sequences, perform calculation of the fitness of each initial sequence, and select a second preset number of initial sequences from the first preset number of initial sequences based on the fitness as a target sequence.
As an optional implementation manner of the embodiment of the present invention, the generating module 201 may include:
and the first generation submodule is used for generating user identifications corresponding to the users aiming at the plurality of users for generating the route to be performed. And the first processing submodule is used for determining a user identifier from a plurality of user identifiers, and generating an initial subsequence by using the user identifier and a predetermined distribution center identifier, wherein the distribution center identifier is used for identifying a distribution center. And the second processing sub-module is used for selecting the current user identifier from the plurality of user identifiers, calculating the sum of the user delivery amount corresponding to the current user identifier and the user delivery amount corresponding to each user identifier in the current sub-sequence to obtain the sum of the goods delivery amount, and the current sub-sequence is generated based on the initial sub-sequence. And the judging submodule is used for judging whether the sum of the goods delivery amount is less than or equal to the maximum loading amount of the delivery vehicle, and the delivery vehicle is used for delivering the goods of the delivery center to the user corresponding to each user identifier in the subsequence or delivering the goods of the user corresponding to each user identifier to the delivery center. And the third processing sub-module is used for inserting the current user identifier into the current sub-sequence to obtain a new sub-sequence if the sum of the cargo delivery amount is less than or equal to the maximum delivery vehicle loading amount, updating the current sub-sequence into the new sub-sequence, and triggering the second processing sub-module to execute the step of selecting the current user identifier from the plurality of user identifiers. And the triggering sub-module is used for triggering the first processing sub-module to determine a user identifier from a plurality of user identifiers if the sum of the cargo delivery amount is larger than the maximum loading amount of the delivery vehicle, and generating an initial sub-sequence by using the user identifier and a predetermined delivery center identifier.
As an optional implementation manner of the embodiment of the present invention, the third processing sub-module may include:
and the inserting unit is used for inserting the current user identifier between two adjacent user identifiers in the current subsequence, or inserting the current user identifier between the distribution center identifier and the user identifier in the current subsequence to obtain a plurality of current subsequences.
A calculating unit, configured to calculate, by using a first preset expression, a transportation cost of each current subsequence in the multiple current subsequences, where the first preset expression is:
f1=(2cok+clm)-β(clk+ckm)
in the formula (f)1Representing the cost of transportation, cokRepresenting the transportation cost of the delivery vehicle driving from the delivery center to the current user corresponding to the current user identifier, clmRepresenting transportation costs of the delivery vehicle when transporting from between the adjacent two users, β representing a preset weight coefficient, clkRepresenting the transportation cost of the delivery vehicle travelling from one of the two adjacent users to the current user, ckmRepresents the transportation cost of the delivery vehicle traveling from the current customer to the other of the two adjacent customers.
And the processing unit is used for comparing the transport costs of the current subsequences in the current subsequences and determining the current subsequence corresponding to the minimum transport cost as a new subsequence.
As an optional implementation manner of the embodiment of the present invention, the first processing module 202 may include:
the calculating submodule is used for calculating the fitness of each initial sequence according to a second preset expression, and the second preset expression is as follows:
fitness(u)=αTD+(1-α)(Wmax-Wmin)
where, fitness (u) represents the fitness of the u-th initial sequence, α represents a preset balance coefficient, TD represents the total travel distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequence, and W represents the total travel distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequencemaxRepresents the maximum driving distance, W, of the distribution route corresponding to all the subsequences in the u-th initial sequenceminThe selection sub-module is used for selecting a second preset number of initial sequences as target sequences according to the sequence of the fitness degrees from small to large.
As an optional implementation manner of the embodiment of the present invention, the second processing module 203 may include:
and the determining submodule is used for determining the copying times of each initial sequence in the initial sequences with the first preset number by utilizing the third preset number and the first preset number. And the replication submodule is used for performing replication operation on the initial sequences with the first preset number by using the replication times of all the initial sequences to obtain the replicated sequences with the third preset number. And the fourth processing sub-module is used for keeping the fourth preset number of subsequences in the sequence unchanged for each sequence in the third preset number of copied sequences, acquiring the user identifications in other subsequences except the fourth preset number of subsequences in the sequence, and deleting the user identifications in other subsequences from the sequence. And the second generation sub-module is used for generating a plurality of sub-sequences by utilizing the preset maximum loading capacity of the delivery vehicle and the size relation between the sum of the user delivery quantities corresponding to the user identifications aiming at the user identifications in other sub-sequences. And the combination sub-module is used for combining the fourth preset number of sub-sequences and the generated plurality of sub-sequences into a crossed sequence.
As an optional implementation manner of the embodiment of the present invention, the restructuring module 204 may include:
and the deleting submodule is used for deleting the user identifications of the fifth preset number from the sequences aiming at each sequence in the sequences after the third preset number of intersections. And the inserting submodule is used for reinserting the deleted fifth preset number of user identifications into the sequence to obtain a recombined sequence. As an optional implementation manner of the embodiment of the present invention, the variation module 205 may be specifically configured to:
and deleting the user identifier in one subsequence in the recombined sequence aiming at each sequence in a third preset number of recombined sequences, and inserting the user identifier into the other subsequence in the recombined sequence to obtain the sequence after variation.
According to the user route generation device for the VRPSPD, provided by the embodiment of the invention, after the initial sequence is obtained, a part of the initial sequence can be subjected to copying operation and improving operation, and the initial sequence is subjected to cross operation, recombination operation, mutation operation and selection operation, so that the convergence speed of the user route generation method can be increased.
The embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304. A memory 303 for storing a computer program.
The processor 301, when executing the program stored in the memory 303, implements the following steps: the method comprises the steps of generating user identifications corresponding to users aiming at a plurality of users for generating routes, generating a first preset number of initial sequences by utilizing a preset maximum loading capacity of a delivery vehicle and a size relation between the sum of user delivery amounts corresponding to the user identifications, wherein each initial sequence comprises a plurality of subsequences, each subsequence comprises a plurality of different user identifications, the subsequences are used for representing different delivery routes, and the maximum loading capacity of the delivery vehicle of the delivery route corresponding to each subsequence is larger than or equal to the sum of the user delivery amounts corresponding to the user identifications on the delivery route. Calculating the fitness of each initial sequence, selecting a second preset number of initial sequences from the first preset number of initial sequences based on the fitness to serve as target sequences, and performing copying operation on the second preset number of target sequences to obtain a second preset number of copied target sequences, wherein the fitness of the target sequences is smaller than the fitness of other initial sequences except the target sequences in the first preset number of initial sequences. Copying the first preset number of initial sequences to obtain a third preset number of copied sequences, and performing cross operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences, wherein the third preset number is greater than the first preset number, at least one user identifier exists in the crossed sequences, and the position of the user identifier in the crossed sequences is the same as the position of the user identifier in the copied sequences; and at least one user identifier exists in the crossed sequence, and the position of the user identifier in the crossed sequence is different from the position of the user identifier in the copied sequence. And (3) aiming at the sequences after the crossing of the third preset number, carrying out recombination operation on the sequences after the crossing to obtain the sequences after the recombination of the third preset number, wherein the subsequence in the recombined sequences is different from the subsequence in the sequences after the crossing. And performing mutation operation on the recombined sequences of a third preset number to obtain the mutated sequences of the third preset number, wherein at least one user identifier exists in the mutated sequences, and the subsequence to which the user identifier belongs in the sequences is different from the subsequence to which the user identifier belongs in the recombined sequences. And performing improvement operation on the copied target sequences of the second preset number to obtain the improved sequences of the second preset number, wherein at least one user identifier exists in the improved sequences, and the position of the user identifier in the subsequence is different from the position of the user identifier in the subsequence in the copied sequences. Calculating the fitness of a second preset number of improved sequences and a third preset number of mutated sequences, selecting and obtaining a first preset number of selected sequences according to the high-low sequence of the fitness, updating the initial sequences into the selected sequences, calculating the fitness of each initial sequence, and selecting a second preset number of initial sequences from the first preset number of initial sequences as target sequences based on the fitness.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment. The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In yet another embodiment provided by the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above-mentioned user route generation methods for a VRPSPD.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment. The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A user route generation method for a vehicle routing problem VRPSPD for simultaneous pick-and-place, the method comprising:
generating user identifications corresponding to the users aiming at the users for generating the routes, and generating a first preset number of initial sequences by using a preset maximum loading capacity of a delivery vehicle and a size relation between sums of user delivery amounts corresponding to the user identifications, wherein each initial sequence comprises a plurality of subsequences, each subsequence comprises a plurality of different user identifications, the subsequences are used for representing different delivery routes, and the maximum loading capacity of the delivery vehicle of the delivery route corresponding to each subsequence is larger than or equal to the sum of the user delivery amounts corresponding to the user identifications on the delivery route;
calculating the fitness of each initial sequence, selecting a second preset number of initial sequences from the first preset number of initial sequences based on the fitness to serve as target sequences, and performing copying operation on the second preset number of target sequences to obtain a second preset number of copied target sequences, wherein the fitness of the target sequences is smaller than the fitness of other initial sequences except the target sequences in the first preset number of initial sequences;
copying the first preset number of initial sequences to obtain a third preset number of copied sequences, and performing cross operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences, wherein the third preset number is greater than the first preset number, at least one user identifier exists in the crossed sequences, and the position of the user identifier in the crossed sequences is the same as the position of the user identifier in the copied sequences; at least one user identifier exists in the crossed sequence, and the position of the user identifier in the crossed sequence is different from the position of the user identifier in the copied sequence;
performing recombination operation on the sequences after the crossing according to the third preset number of sequences after the crossing to obtain a third preset number of sequences after the crossing, wherein the subsequence in the sequence after the recombination is different from the subsequence in the sequence after the crossing;
performing variation operation on the third preset number of recombined sequences to obtain a third preset number of varied sequences, wherein at least one user identifier exists in the varied sequences, and the subsequence to which the user identifier belongs in the sequences is different from the subsequence to which the user identifier belongs in the recombined sequences;
performing improvement operation on a second preset number of copied target sequences to obtain a second preset number of improved sequences, wherein at least one user identifier exists in the improved sequences, and the position of the user identifier in the subsequence is different from the position of the user identifier in the subsequence in the copied sequences;
calculating the fitness of the improved sequences of the second preset number and the mutated sequences of the third preset number, selecting the selected sequences of the first preset number according to the sequence of the fitness, updating the initial sequences into the selected sequences, executing the steps of calculating the fitness of each initial sequence, and selecting the initial sequences of the second preset number from the initial sequences of the first preset number based on the fitness to serve as target sequences.
2. The method according to claim 1, wherein the step of generating a user identifier corresponding to each user for a plurality of users who are to perform route generation, and generating a first preset number of initial sequences by using a preset maximum loading capacity of delivery vehicles and a size relationship between a sum of user delivery capacities corresponding to each user identifier comprises:
generating user identifications corresponding to the users aiming at a plurality of users to be subjected to route generation;
determining a user identifier from the plurality of user identifiers, and generating an initial subsequence by using the user identifier and a predetermined distribution center identifier, wherein the distribution center identifier is used for identifying a distribution center;
selecting a current user identifier from the plurality of user identifiers, and calculating the sum of the user delivery amount corresponding to the current user identifier and the user delivery amount corresponding to each user identifier in a current subsequence to obtain the sum of the goods delivery amounts, wherein the current subsequence is generated based on the initial subsequence;
judging whether the sum of the goods delivery amount is smaller than or equal to the maximum loading amount of the delivery vehicle, wherein the delivery vehicle is used for delivering the goods of the delivery center to the user corresponding to each user identifier in the subsequence, or delivering the goods of the user corresponding to each user identifier to the delivery center;
if the sum of the cargo delivery amount is less than or equal to the maximum delivery vehicle loading amount, inserting the current user identifier into the current subsequence to obtain a new subsequence, updating the current subsequence to the new subsequence, and executing the step of selecting the current user identifier from the user identifiers;
and if the sum of the cargo delivery amount is larger than the maximum loading amount of the delivery vehicle, executing the step of determining a user identifier from the plurality of user identifiers and generating an initial subsequence by using the user identifier and a predetermined delivery center identifier.
3. The method of claim 2, wherein the step of inserting the current subscriber identity into the current sub-sequence to obtain a new sub-sequence comprises:
inserting the current user identifier between two adjacent user identifiers in the current subsequence, or inserting the current user identifier between the distribution center identifier and the user identifier in the current subsequence, so as to obtain a plurality of current subsequences;
calculating the transportation cost of each current subsequence in the plurality of current subsequences by using a first preset expression, wherein the first preset expression is as follows:
f1=(2cok+clm)-β(clk+ckm)
in the formula (f)1Representing said transportation costs, cokRepresenting the transportation cost of the delivery vehicle driving from the delivery center to the current user corresponding to the current user identifier, clmRepresenting the transportation cost of the delivery vehicle when transporting from between two adjacent users, β representing a preset weight coefficient, clkRepresenting the transportation cost of said delivery vehicle travelling from one of said two adjacent users to said current user, ckmRepresenting a transportation cost of the delivery vehicle traveling from the current customer to the other of the two adjacent customers;
and comparing the transport costs of the current subsequences in the current subsequences, and determining the current subsequence corresponding to the minimum transport cost as the new subsequence.
4. The method according to claim 1, wherein the step of calculating the fitness of each of the initial sequences and selecting a second preset number of initial sequences from the first preset number of initial sequences as target sequences based on the fitness comprises:
calculating the fitness of each initial sequence according to a second preset expression, wherein the second preset expression is as follows:
fitness(u)=αTD+(1-α)(Wmax-Wmin)
wherein fitness (u) denotes the u-th initial sequenceFitness α represents a preset balance coefficient, TD represents the total driving distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequence, and W represents the total driving distance of the distribution route corresponding to all the sub-sequences in the u-th initial sequencemaxRepresents the maximum driving distance, W, of the distribution route corresponding to all the subsequences in the u-th initial sequenceminRepresenting the minimum driving distance in the distribution routes corresponding to all the sub-sequences in the U-th initial sequence, U ∈ U, wherein U is {1, 2, 3, … …, m }, U represents the number set of the initial sequences, and m represents the first preset number;
sorting each fitness obtained by calculation;
and selecting a second preset number of initial sequences as the target sequences according to the sequence of the fitness from small to large.
5. The method according to claim 1, wherein the step of performing a copy operation on the first preset number of initial sequences to obtain a third preset number of copied sequences, and performing a crossover operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences comprises:
determining the copying times of each initial sequence in the initial sequences of the first preset number by using the third preset number and the first preset number;
copying the initial sequences of the first preset number by using the copying times of all the initial sequences to obtain copied sequences of a third preset number;
for each sequence in the third preset number of copied sequences, keeping a fourth preset number of subsequences in the sequence unchanged, acquiring user identifiers in other subsequences except the fourth preset number of subsequences in the sequence, and deleting the user identifiers in other subsequences from the sequence;
aiming at the user identifiers in the other sub-sequences, generating a plurality of sub-sequences by utilizing the preset maximum loading capacity of the delivery vehicles and the size relationship between the sum of the user delivery quantities corresponding to the user identifiers;
and combining the fourth preset number of subsequences and the generated multiple subsequences into the crossed sequence.
6. The method according to claim 1, wherein the step of performing a recombination operation on each of the crossed sequences to obtain a third preset number of recombined sequences includes:
deleting a fifth preset number of user identifications from the sequences aiming at each sequence in the third preset number of crossed sequences;
and reinserting the deleted user identifications with the fifth preset number into the sequence to obtain the recombined sequence.
7. The method according to claim 1, wherein the step of performing a mutation operation on the third predetermined number of recombined sequences to obtain a third predetermined number of mutated sequences comprises:
and deleting the user identifier in one subsequence in the recombined sequence aiming at each sequence in the third preset number of recombined sequences, and inserting the user identifier into the other subsequence in the recombined sequence to obtain the sequence after variation.
8. A user route generation apparatus for VRPSPD, the apparatus comprising:
the generating module is used for generating user identifiers corresponding to users aiming at a plurality of users for generating routes, generating a first preset number of initial sequences by utilizing a preset maximum loading capacity of a delivery vehicle and a size relation between sums of user delivery amounts corresponding to the user identifiers, wherein each initial sequence comprises a plurality of subsequences, each subsequence comprises a plurality of different user identifiers, the subsequences are used for representing different delivery routes, and the maximum loading capacity of the delivery vehicle of the delivery route corresponding to each subsequence is larger than or equal to the sum of the user delivery amounts corresponding to the user identifiers on the delivery route;
the first processing module is used for calculating the fitness of each initial sequence, selecting a second preset number of initial sequences from the first preset number of initial sequences as target sequences based on the fitness, and performing copy operation on the second preset number of target sequences to obtain a second preset number of copied target sequences, wherein the fitness of the target sequences is smaller than the fitness of other initial sequences except the target sequences in the first preset number of initial sequences;
a second processing module, configured to copy the first preset number of initial sequences to obtain a third preset number of copied sequences, and perform a crossover operation on the third preset number of copied sequences to obtain a third preset number of crossed sequences, where the third preset number is greater than the first preset number, at least one user identifier exists in the crossed sequences, and a position of the user identifier in the crossed sequences is the same as a position of the user identifier in the copied sequences; at least one user identifier exists in the crossed sequence, and the position of the user identifier in the crossed sequence is different from the position of the user identifier in the copied sequence;
a recombination module, configured to perform recombination operation on the sequences after crossing in the third preset number of sequences after crossing to obtain a third preset number of sequences after recombination, where a subsequence in the sequence after recombination is different from a subsequence in the sequence after crossing;
a variation module, configured to perform a variation operation on the third preset number of recombined sequences to obtain a third preset number of varied sequences, where at least one user identifier exists in the varied sequences, and a subsequence to which the user identifier belongs in the sequence is different from a subsequence to which the user identifier belongs in the recombined sequences;
an improvement module, configured to perform an improvement operation on a second preset number of copied target sequences to obtain a second preset number of improved sequences, where at least one user identifier exists in each improved sequence, and a position of the user identifier in a subsequence is different from a position of the user identifier in the subsequence in the copied sequence;
and a third processing module, configured to calculate the improved sequences of the second preset number and the fitness of the sequences after the variation of the third preset number, select a selected sequence of the first preset number according to a high-low order of the fitness, update the initial sequences to the selected sequences, perform the calculation of the fitness of each initial sequence, and select a second preset number of initial sequences from the first preset number of initial sequences based on the fitness, as a target sequence.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN202010069786.8A 2020-01-21 2020-01-21 User route generation method and device for VRPSPD, electronic equipment and storage medium Active CN111325498B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010069786.8A CN111325498B (en) 2020-01-21 2020-01-21 User route generation method and device for VRPSPD, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010069786.8A CN111325498B (en) 2020-01-21 2020-01-21 User route generation method and device for VRPSPD, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111325498A true CN111325498A (en) 2020-06-23
CN111325498B CN111325498B (en) 2023-04-18

Family

ID=71168703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010069786.8A Active CN111325498B (en) 2020-01-21 2020-01-21 User route generation method and device for VRPSPD, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111325498B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11386362B1 (en) * 2020-12-16 2022-07-12 Wm Intellectual Property Holdings, L.L.C. System and method for optimizing waste / recycling collection and delivery routes for service vehicles

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103279796A (en) * 2013-06-08 2013-09-04 苏州大学 Method for optimizing genetic algorithm evolution quality
US20190080240A1 (en) * 2017-09-08 2019-03-14 SparkCognition, Inc. Execution of a genetic algorithm with variable evolutionary weights of topological parameters for neural network generation and training
CN109919376A (en) * 2019-03-01 2019-06-21 浙江工业大学 Multi-field model and multi-vehicle-type vehicle route dispatch control method
CN110109753A (en) * 2019-04-25 2019-08-09 成都信息工程大学 Resource regulating method and system based on various dimensions constraint genetic algorithm

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103279796A (en) * 2013-06-08 2013-09-04 苏州大学 Method for optimizing genetic algorithm evolution quality
US20190080240A1 (en) * 2017-09-08 2019-03-14 SparkCognition, Inc. Execution of a genetic algorithm with variable evolutionary weights of topological parameters for neural network generation and training
CN109919376A (en) * 2019-03-01 2019-06-21 浙江工业大学 Multi-field model and multi-vehicle-type vehicle route dispatch control method
CN110109753A (en) * 2019-04-25 2019-08-09 成都信息工程大学 Resource regulating method and system based on various dimensions constraint genetic algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李敏等: "遗传算法局部最优的定向移民策略", 《兵工自动化》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11386362B1 (en) * 2020-12-16 2022-07-12 Wm Intellectual Property Holdings, L.L.C. System and method for optimizing waste / recycling collection and delivery routes for service vehicles

Also Published As

Publication number Publication date
CN111325498B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
Karaoglan et al. A memetic algorithm for the capacitated location-routing problem with mixed backhauls
Hwang Design of supply-chain logistics system considering service level
Matusiak et al. A fast simulated annealing method for batching precedence-constrained customer orders in a warehouse
Petersen et al. The double travelling salesman problem with multiple stacks–formulation and heuristic solution approaches
Hokama et al. A branch-and-cut approach for the vehicle routing problem with loading constraints
Calvet et al. Solving the multidepot vehicle routing problem with limited depot capacity and stochastic demands
CN111428991B (en) Method and device for determining delivery vehicles
Liu A hybrid population heuristic for the heterogeneous vehicle routing problems
Ting et al. Multi-vehicle selective pickup and delivery using metaheuristic algorithms
Li et al. The tree representation for the pickup and delivery traveling salesman problem with LIFO loading
Bayliss et al. A two-phase local search with a discrete-event heuristic for the omnichannel vehicle routing problem
CN111325498B (en) User route generation method and device for VRPSPD, electronic equipment and storage medium
CN107153880A (en) One kind allots procurement practice, device and equipment
CN115345549B (en) Vehicle path adjustment method and system combined with loading scheme
Hajiaghaei-Keshteli et al. Addressing the freight consolidation and containerization problem by recent and hybridized meta-heuristic algorithms
Sadeghiram et al. Composing distributed data-intensive Web services using a flexible memetic algorithm
CN113780676A (en) Method for optimizing distribution path of bottled liquefied gas vehicle
Utamima et al. Distribution route optimization of gallon water using genetic algorithm and tabu search
Rüther et al. A grouping genetic algorithm for multi depot pickup and delivery problems with time windows and heterogeneous vehicle fleets
Motaghedi-Larijani Solving the number of cross-dock open doors optimization problem by combination of NSGA-II and multi-objective simulated annealing
Alinaghian et al. A novel mathematical model for cross dock open-close vehicle routing problem with splitting
CN112631612A (en) Optimization method for kubernetes cloud platform configuration based on genetic algorithm
Puspita et al. Mathematical modelling of traveling salesman problem (TSP) by implementing simulated annealing and genetic algorithms
Ferdinand et al. A study on network design for shortest path in expedition company
Shojaie et al. Solving a two-objective green transportation problem by using meta-heuristic methods under uncertain fuzzy approach

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
GR01 Patent grant
GR01 Patent grant