CN110399997B - Path planning method and system for multiple pass points, electronic device and storage medium - Google Patents

Path planning method and system for multiple pass points, electronic device and storage medium Download PDF

Info

Publication number
CN110399997B
CN110399997B CN201811301033.4A CN201811301033A CN110399997B CN 110399997 B CN110399997 B CN 110399997B CN 201811301033 A CN201811301033 A CN 201811301033A CN 110399997 B CN110399997 B CN 110399997B
Authority
CN
China
Prior art keywords
point
current
transit
path
starting point
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.)
Active
Application number
CN201811301033.4A
Other languages
Chinese (zh)
Other versions
CN110399997A (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 Jingdong Three Hundred And Sixty Degree E Commerce Co ltd
Original Assignee
Beijing Jingdong Three Hundred And Sixty Degree E Commerce Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Three Hundred And Sixty Degree E Commerce Co ltd filed Critical Beijing Jingdong Three Hundred And Sixty Degree E Commerce Co ltd
Priority to CN201811301033.4A priority Critical patent/CN110399997B/en
Publication of CN110399997A publication Critical patent/CN110399997A/en
Application granted granted Critical
Publication of CN110399997B publication Critical patent/CN110399997B/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/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G06Q10/047Optimisation of routes or paths, e.g. travelling salesman problem

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Navigation (AREA)

Abstract

The invention discloses a path planning method, a system, electronic equipment and a storage medium of multiple transit points, wherein the path planning method comprises the following steps: acquiring a first set comprising a starting point and at least two passing points; inquiring a passing point with the shortest route from the current starting point; saving a sub-path from the current starting point to the current route point obtained by query; changing the passing point obtained by the current query into a starting point; judging whether the first set comprises a passing point or not; if yes, continuing to execute the query step; if not, the sub-paths are spliced according to the stored sequence to generate the optimal path. The invention starts from an initial starting point, inquires a passing point closest to the current starting point to obtain a sub-path, then takes the obtained passing point as a new starting point, continuously inquires another passing point closest to the passing point to obtain another sub-path, and continuously circulates the process until all the passing points are inquired, thereby being capable of quickly obtaining an optimized path close to the optimal solution.

Description

Path planning method and system for multiple pass points, electronic device and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method and a system for planning paths of multi-path points, electronic equipment and a storage medium.
Background
Currently, in terms of path planning, two situations can be distinguished, one being the shortest path problem from one location to another, for which there are existing accurate solutions such as the a star algorithm, Dijkstra (Dijkstra) algorithm, etc.; secondly, the problem of the shortest path from a location to a plurality of destinations is mainly that the existing algorithm has: the method comprises an exhaustion method, namely, distances between two points are calculated respectively and then converted into a TSP (tracking Salesman Problem) Problem to be solved, the algorithm can calculate an accurate solution, but the time complexity is high, and actual requirements cannot be met; and secondly, the spatial distance is adopted to replace the actual road distance and then converted into the TSP problem for solving, the algorithm is high in speed, but the solving result cannot meet the actual requirement due to the fact that the detour condition is easy to occur.
Disclosure of Invention
The invention provides a multi-transit point path planning method, a multi-transit point path planning system, electronic equipment and a storage medium, aiming at overcoming the defect that an accurate solution and a quick solution of multi-transit point path planning in the prior art cannot coexist.
The invention solves the technical problems through the following technical scheme:
a path planning method for multiple transit points is characterized by comprising the following steps:
acquiring a first set, wherein the first set comprises a starting point and at least two passing points;
inquiring a passing point with the shortest route from the current starting point;
saving a sub-path from the current starting point to the current route point obtained by query;
changing the passing point obtained by the current query into a starting point;
judging whether the first set comprises a passing point or not;
if yes, continuing to execute the step of inquiring the passing point with the shortest route from the current starting point;
if not, splicing the sub-paths according to the stored sequence to generate an optimal path;
wherein the current starting point is the latest starting point in the first set.
Preferably, the step of querying the route point with the shortest route from the current starting point includes:
adding the current starting point into the second set;
selecting the point with the minimum path cost in the second set as a transit point;
adding the current transit point into a third set, and deleting the current transit point from the second set;
judging whether the neighbor points of the current transit point are included in the third set;
if the current transit point is included in the third set, continuing to judge whether another adjacent point of the current transit point is included in the third set;
if not, judging whether the current adjacent point is included in the second set;
if the current path cost is included in the second set, recalculating the path cost of the current adjacent point;
if not, adding the current adjacent point into the second set, and calculating the path cost of the current adjacent point;
judging whether other adjacent points which are not judged exist in the current transit point;
if yes, continuously judging whether another adjacent point of the current transit point is included in the third set;
if not, continuing to execute the step of selecting the point with the minimum path cost in the second set as the transit point;
and for the point P in the second set, the path cost is the sum of the minimum value of the cost from the point P to each passing point and the cost from the point P to the first current starting point.
Preferably, after the step of adding the current transit point into the third set, the step of querying a route point with the shortest route from the current starting point further includes:
judging whether the current transit point is a passing point or not;
if yes, turning to the step of saving the sub-path from the current starting point to the current route point obtained by query;
if not, continuing to execute the step of judging whether the adjacent point of the current transfer point is included in the third set.
Preferably, the step of saving the sub-path from the current starting point to the route point obtained by the current query includes:
and connecting the points in the third set according to the adding sequence to generate the sub-path.
An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements any one of the above-mentioned multi-waypoint path planning methods when executing the computer program.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of any of the above-mentioned methods for path planning for multiple waypoints.
A multi-transit point path planning system, the path planning system comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first set, and the first set comprises a starting point and at least two passing points;
the query module is used for querying a passing point with the shortest route away from the current starting point;
the storage module is used for storing sub-paths from the current starting point to the route point obtained by current query;
the changing module is used for changing the passing point obtained by the current query into a starting point;
the judging module is used for judging whether the first set comprises a passing point or not;
if yes, continuing to call the query module; if not, calling the splicing module;
the splicing module is used for splicing the sub-paths according to the stored sequence to generate an optimal path;
wherein the current starting point is the latest starting point in the first set.
Preferably, the query module comprises:
a first adding unit, configured to add the current starting point into the second set;
a selecting unit, configured to select a point in the second set with the smallest path cost as a transit point;
a second adding unit, configured to add the current transit point to the third set;
a deleting unit configured to delete the current transit point from the second set;
a first judgment unit configured to judge whether or not a neighboring point of the current transit point is included in the third set;
if the current transit point is included in the third set, calling the first judging unit to continuously judge whether another adjacent point of the current transit point is included in the third set;
if the current time is not included in the third set, calling a second judgment unit;
wherein the second judging unit is configured to judge whether a current neighboring point is included in the second set;
if the first adding unit is not included in the second set, calling a third adding unit and a calculating unit;
if the current time is included in the second set, the computing unit is called again;
wherein the third adding unit is configured to add a current neighboring point to the second set;
the calculating unit is used for calculating the path cost of the current adjacent point;
the third judging unit is used for judging whether other adjacent points which are not judged exist in the current transit point;
if yes, calling the first judging unit, and continuously judging whether another adjacent point of the current transit point is included in the third set;
if not, calling the selection unit;
and for the point P in the second set, the path cost is the sum of the minimum value of the cost from the point P to each passing point and the cost from the point P to the first current starting point.
Preferably, the query module further comprises:
a fourth judging unit, configured to judge whether the current transit point is a transit point;
if yes, calling the storage module;
if not, the first judgment unit is called.
Preferably, the storage module is configured to connect the points in the third set according to a joining sequence to generate a sub-path.
The positive progress effects of the invention are as follows: the invention starts from an initial starting point, inquires a passing point closest to the current starting point to obtain a sub-path, then takes the passing point obtained by inquiry as a new starting point, continuously inquires another passing point closest to the passing point to obtain another sub-path, and continuously circulates the process until all the passing points are inquired.
Drawings
Fig. 1 is a flowchart of a path planning method for multiple transit points according to embodiment 1 of the present invention.
Fig. 2 is a partial flowchart of a path planning method for multiple transit points according to embodiment 1 of the present invention.
Fig. 3 is a schematic diagram of a plurality of transit points in step S2 in the route planning method for a plurality of transit points according to embodiment 1 of the present invention.
Fig. 4 is a schematic diagram of a hardware structure of an electronic device according to embodiment 2 of the present invention.
Fig. 5 is a schematic block diagram of a multi-route-point route planning system according to embodiment 4 of the present invention.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
The present embodiment provides a path planning method for multiple transit points, and fig. 1 shows a flowchart of the present embodiment. Referring to fig. 1, the path planning method of the present embodiment includes:
and S1, acquiring the first set.
In this embodiment, the first set includes, but is not limited to, representations of lists, where the first set includes a starting point and at least two passing points, and in this embodiment, the current starting point is the latest starting point in the first set, that is, when only one starting point is included in the first set, the only starting point is the current starting point.
And S2, inquiring the passing point with the shortest path from the current starting point.
Fig. 2 shows a flowchart of step S2, specifically, step S2 includes:
s201, adding the current starting point into a second set;
s202, selecting a point with the minimum path cost in the second set as a transit point;
s203, adding the current transfer point into a third set, and deleting the current transfer point from the second set;
s204, judging whether the current transit point is a passing point or not;
if yes, go to step S3; if not, go to step S205;
s205, judging whether the adjacent points of the current transit point are included in the third set;
if yes, another neighboring point is selected to continue to perform step S205; if not, go to step S206;
s206, judging whether the current adjacent point is included in the second set;
if yes, go to step S207; if not, go to step S208;
s207, recalculating the path cost of the current adjacent point, and turning to the step S209;
s208, adding the current adjacent point into the second set, calculating the path cost of the current adjacent point, and turning to the step S209;
s209, judging whether other adjacent points which are not judged exist in the current transit point;
if yes, another neighboring point is selected to continue to perform step S205; if not, the step S202 is continued.
In the present embodiment, when the determinations of step S205 and step S209 are yes, the execution of step S205 is continued with the aim of determining whether another neighboring point of the current transit point is included in the third set.
Specifically, in the present embodiment, referring to fig. 3, the first set includes the start point S0Passing point M1、M2At this time, the starting point S0I.e. the current starting point. The current starting point S0Adding a second set, wherein the second set only comprises the current starting point S0And then, without calculation, the current starting point S0That is, the point with the minimum path cost in the second set is selected as the current starting point S0Is the transit point. The current transit point S0Adding the third set and deleting the current transit point S from the second set0At this time, only the current transit point S is included in the third set0The second set does not include any point, and thus, step S204, step S205 and step S206 are both determined to be no. In this embodiment, the points that are not obstacles and are away from the transit point by the unit length can be made to be adjacent points, and then, for the current transit point S0Current neighbor point P ofiI can take the values 1, 2, 3, 4. The current adjacent point P1Add the second set and calculate P1The path cost of (2). Suppose that the current transit point S0Also includes neighboring points P2、P3、P4Furthermore, when step S202 is executed continuously, the second set includes neighboring points P for which the path cost has been calculated1、P2、P3、P4The third set including a starting point S0
Continuing to step S202, assume neighboring point P2When the path cost is the minimum, P is selected2Is the transit point. The current transit point P2Adding the third set and deleting the current transit point P from the second set2At this time, the third set includes the start point S0And a neutral point P2The second set comprising P1、P3、P4. For the current transit point P2Adjacent point P of5Which are not route points and are not included in either the third set or the second set, a current neighboring point P is included5Add the second set and calculate P5The path cost of (2). The current transit point P due to the presence of an obstacle (shaded portion in the figure)2Also includes neighboring points S0、P6Returning to step S205, the determination is continued. For adjacent points S0Since the third set includes S0Returning to step S205 to continue judging neighboring point P6. For adjacent point P6Which are not route points and are not included in either the third set or the second set, a current neighboring point P is included6Add the second set and calculate P6The path cost of (2). To this end, the second set comprises neighboring points P for which the path cost has been calculated1、P3、P4、P5、P6The third set including a starting point S0And a neutral point P2
Continue to holdStep S202, assume neighboring point P6When the path cost is the minimum, P is selected6Is the transit point. The current transit point P6Adding the third set and deleting the current transit point P from the second set6At this time, the third set includes the start point S0And a neutral point P2、P6P is included in the second set1、P3、P4、P5. For the current transit point P6Adjacent point P of3If it is not a waypoint and is not included in the third set but is included in the second set, then P is recalculated3The path cost of (2).
In this embodiment, for the point P in the second set, the path cost is the sum of the minimum value of the cost from the point P to each passing point and the cost from the point P to the first current starting point. For example, for P3The precursor of which is initially S0Then, P is estimated separately3To a passing point M1And M2Taking the minimum value of (1) and P3To the starting point S0(S0→P3) The sum of the costs of (a) is the path cost; and, P for the recomputed path cost3Its precursor is changed to P6Taking P3To a passing point M1And M2Is compared with the minimum value of the cost to the starting point S0(S0→P2→P6→P3) The sum of the costs of (a) is the path cost.
The above steps are continuously executed until step S204 determines that the current transit point is a transit point, that is, a transit point with the shortest route from the current starting point is found, and step S3 is executed.
And S3, saving the sub-path from the current starting point to the route point obtained by the current query.
Suppose that, in the present embodiment, the first query results in being the passing point M1Then save from the starting point S0To a passing point M1Is used to determine the sub-path of (1). Specifically, in this embodiment, the points in the third set are connected according to the adding sequence to generate the sub-path, that is, the sub-path is S0→P2→P6→P3→……→M1
And S4, changing the route point obtained by the current query into a starting point.
At this time, the passing point M1Change to the starting point S1Thus, the first set includes the start point S0、S1And a passing point M2
At the passing point M1Change to the starting point S1Previously, step S4 may further include: deleting the current starting point, and the first set comprises the starting point S1And a passing point M2At this time, the latest starting point in the first set is still S1
S5, judging whether the first set comprises a passing point or not;
if yes, go to step S2; if not, go to step S6;
and S6, splicing the sub-paths according to the stored sequence to generate the optimal path.
When the first set includes the starting point S0、S1And a passing point M2If yes, step S5 continues to execute step S2 until the passing point M is inquired2Saving from the starting point S1To a passing point M2Is used to determine the sub-path of (1). Finally, in step S6, the sub-paths are spliced according to the stored sequence, and in this embodiment, the finally generated optimal path is S0→P2→P6→P3→……→M1→……→M2
In this embodiment, a route point closest to the current starting point is queried from the initial starting point to obtain a sub-route, the route point obtained through the query is taken as a new starting point, another route point closest to the route point is continuously queried to obtain another sub-route, and the above process is continuously circulated until all the route points are queried.
Example 2
The present embodiment provides an electronic device, which may be represented in the form of a computing device (for example, may be a server device), and includes a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor, when executing the computer program, may implement the multi-transit-point path planning method provided in embodiment 1.
Fig. 4 shows a schematic diagram of a hardware structure of the present embodiment, and as shown in fig. 4, the electronic device 9 specifically includes:
at least one processor 91, at least one memory 92, and a bus 93 for connecting the various system components (including the processor 91 and the memory 92), wherein:
the bus 93 includes a data bus, an address bus, and a control bus.
Memory 92 includes volatile memory, such as Random Access Memory (RAM)921 and/or cache memory 922, and can further include Read Only Memory (ROM) 923.
Memory 92 also includes a program/utility 925 having a set (at least one) of program modules 924, such program modules 924 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The processor 91 executes various functional applications and data processing, such as the multi-transit point path planning method provided in embodiment 1 of the present invention, by executing the computer program stored in the memory 92.
The electronic device 9 may further communicate with one or more external devices 94 (e.g., a keyboard, a pointing device, etc.). Such communication may be through an input/output (I/O) interface 95. Also, the electronic device 9 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 96. The network adapter 96 communicates with the other modules of the electronic device 9 via the bus 93. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 9, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module, according to embodiments of the application. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Example 3
The present embodiment provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the steps of the multi-transit point path planning method provided in embodiment 1.
More specific examples, among others, that the readable storage medium may employ may include, but are not limited to: a portable disk, a hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible implementation, the present invention can also be implemented in the form of a program product including program code for causing a terminal device to perform the steps of implementing the path planning method for multi-transit points in embodiment 1 when the program product is run on the terminal device.
Where program code for carrying out the invention is written in any combination of one or more programming languages, the program code may be executed entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on a remote device or entirely on the remote device.
Example 4
The present embodiment provides a path planning system with multiple transit points, and fig. 5 shows a module diagram of the present embodiment. Referring to fig. 5, the path planning system of the present embodiment includes:
an obtaining module 1, configured to obtain the first set. In this embodiment, the first set includes, but is not limited to, representations of lists, where the first set includes a starting point and at least two passing points, and in this embodiment, the current starting point is the latest starting point in the first set, that is, when only one starting point is included in the first set, the only starting point is the current starting point.
And the query module 2 is used for querying the passing point with the shortest path from the current starting point. Referring to fig. 5, the query module 2 specifically includes:
a first adding unit 201, configured to add the current starting point to the second set.
A selecting unit 202, configured to select a point in the second set with the smallest path cost as a transit point.
A second adding unit 203, configured to add the current transit point to the third set.
A deleting unit 204, configured to delete the current transit point from the second set.
A fourth judging unit 210, configured to judge whether the current transit point is a transit point; if yes, calling a storage module 3; if not, the first determination unit 205 is invoked.
A first judging unit 205 configured to judge whether or not a neighboring point of the current transit point is included in the third set; if yes, the first determining unit 205 is invoked to continue to determine whether another neighboring point of the current transit point is included in the third set; if not, the second determination unit 206 is invoked.
The second judging unit 206 is configured to judge whether the current neighboring point is included in the second set;
if not, a third adding unit 207 and a calculating unit 208 are called; if so, the calculation unit 208 is recalled.
The third adding unit 207 is configured to add the current neighboring point to the second set.
The calculating unit 208 is configured to calculate a path cost of the current neighboring point. The computation unit 208 is called again, that is, the path cost of the current neighboring point is recalculated.
A third determining unit 209, configured to determine whether there are other neighboring points that are not determined at the current transit point; if yes, the first determining unit 205 is invoked to continue to determine whether another neighboring point of the current transit point is included in the third set; if not, the selection unit 202 is invoked.
In this embodiment, a schematic diagram of the query module 2 querying a passing point with the shortest route from the current starting point is also shown in fig. 3, and specifically, the first set obtained by the obtaining module 1 includes the starting point S0Passing point M1、M2At this time, the starting point S0I.e. the current starting point. The first joining unit 201 joins the current start point S0Adding a second set, wherein the second set only comprises the current starting point S0And then, without calculation, the current starting point S0That is, the point with the minimum path cost in the second set, the selection unit 202 selects the current starting point S0Is the transit point. The second adding unit 203 adds the current transfer point S0The third set is added and the deletion unit 204 deletes the current transit point S from the second set0At this time, only the current transit point S is included in the third set0The second set does not include any point, and thus the fourth judging unit 210, the first judging unit 205, and the second judging unit 206 judge no. In this embodiment, the points that are not obstacles and are away from the transit point by the unit length can be made to be adjacent points, and then, for the current transit point S0Current neighbor point P ofiI can take the values 1, 2, 3, 4. The third adding unit 207 adds the current neighboring point P1Join the second set and the calculation unit 208 calculates P1The path cost of (2). Suppose that the current transit point S0Also includes neighboring points P2、P3、P4Furthermore, when the selection unit 202 is continuously invoked, the second set includes neighboring points P for which the path cost has been calculated1、P2、P3、P4The third set including a starting point S0
The selection unit 202 is invoked continuously, assuming the neighboring point P2Has the smallest path cost, the selection unit 202 selects P2Is the transit point. The second adding unit 203 will beFront middle turning point P2The third set is added and the deletion unit 204 deletes the current transit point P from the second set2At this time, the third set includes the start point S0And a neutral point P2The second set comprising P1、P3、P4. For the current transit point P2Adjacent point P of5Which is not a route point and is included in neither the third nor the second set, the third adding unit 207 adds the current neighboring point P to the second set5Join the second set and the calculation unit 208 calculates P5The path cost of (2). The current transit point P due to the presence of an obstacle (shaded portion in the figure)2Also includes neighboring points S0、P6The first judgment unit 205 is invoked to continue the judgment. For adjacent points S0Since the third set includes S0Invoking the first determining unit 205 to continue determining the neighboring point P6. For adjacent point P6Which is not a route point and is included in neither the third nor the second set, the third adding unit 207 adds the current neighboring point P to the second set6Join the second set and the calculation unit 208 calculates P6The path cost of (2). To this end, the second set comprises neighboring points P for which the path cost has been calculated1、P3、P4、P5、P6The third set including a starting point S0And a neutral point P2
The selection unit 202 is invoked continuously, assuming the neighboring point P6Has the smallest path cost, the selection unit 202 selects P6Is the transit point. The second adding unit 203 adds the current transit point P6The third set is added and the deletion unit 204 deletes the current transit point P from the second set6At this time, the third set includes the start point S0And a neutral point P2、P6P is included in the second set1、P3、P4、P5. For the current transit point P6Adjacent point P of3If it is not a passing point and is not included in the third set but is included in the second set, the calculation unit 208 recalculates P3The path cost of (2).
In this embodiment, for the point P in the second set, the path cost is the sum of the minimum value of the cost from the point P to each passing point and the cost from the point P to the first current starting point. For example, for P3The precursor of which is initially S0Then, P is estimated separately3To a passing point M1And M2Taking the minimum value of (1) and P3To the starting point S0(S0→P3) The sum of the costs of (a) is the path cost; and, P for the recomputed path cost3Its precursor is changed to P6Taking P3To a passing point M1And M2Is compared with the minimum value of the cost to the starting point S0(S0→P2→P6→P3) The sum of the costs of (a) is the path cost.
The above units are continuously called until the fourth judging unit 210 judges that the current transit point is a passing point, that is, a passing point with the shortest route from the current starting point is found, and the saving module 3 is called.
And the storage module 3 is used for storing the sub-path from the current starting point to the route point obtained by the current query. Suppose that, in the present embodiment, the first query results in being the passing point M1Then save from the starting point S0To a passing point M1Is used to determine the sub-path of (1). Specifically, in this embodiment, the points in the third set are connected according to the adding sequence to generate the sub-path, that is, the sub-path is S0→P2→P6→P3→……→M1
And the changing module 4 is used for changing the passing point obtained by the current query into a starting point. At this time, the passing point M1Change to the starting point S1Thus, the first set includes the start point S0、S1And a passing point M2
At the passing point M1Change to the starting point S1Before, the changing module 4 may be further configured to delete the current starting point, and the first set includes the starting point S1And a passing point M2At this time, the latest starting point in the first set is still S1
A judging module 5, configured to judge whether the first set includes a passing point; if yes, continuing to call the query module 2; if not, the splicing module 6 is called.
And the splicing module 6 is used for splicing the sub-paths according to the stored sequence to generate an optimal path. When the first set includes the starting point S0、S1And a passing point M2If yes, the judging module 5 continues to call the query module 2 until the passing point M is queried2Saving from the starting point S1To a passing point M2Is used to determine the sub-path of (1). Finally, the splicing module 6 splices the sub-paths according to the stored sequence, in this embodiment, the finally generated optimal path is S0→P2→P6→P3→……→M1→……→M2
In this embodiment, a route point closest to the current starting point is queried from the initial starting point to obtain a sub-route, the route point obtained through the query is taken as a new starting point, another route point closest to the route point is continuously queried to obtain another sub-route, and the above process is continuously circulated until all the route points are queried.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (8)

1. A path planning method for multiple transit points is characterized by comprising the following steps:
acquiring a first set, wherein the first set comprises a starting point and at least two passing points;
inquiring a passing point with the shortest route from the current starting point;
saving a sub-path from the current starting point to the current route point obtained by query;
changing the passing point obtained by the current query into a starting point;
judging whether the first set comprises a passing point or not;
if yes, continuing to execute the step of inquiring the passing point with the shortest route from the current starting point;
if not, splicing the sub-paths according to the stored sequence to generate an optimal path;
wherein the current starting point is the latest starting point in the first set;
the step of inquiring the passing point with the shortest path from the current starting point comprises the following steps:
adding the current starting point into the second set;
selecting the point with the minimum path cost in the second set as a transit point;
adding the current transit point into a third set, and deleting the current transit point from the second set;
judging whether the neighbor points of the current transit point are included in the third set;
if the current transit point is included in the third set, continuing to judge whether another adjacent point of the current transit point is included in the third set;
if not, judging whether the current adjacent point is included in the second set;
if the current path cost is included in the second set, recalculating the path cost of the current adjacent point;
if not, adding the current adjacent point into the second set, and calculating the path cost of the current adjacent point;
judging whether other adjacent points which are not judged exist in the current transit point;
if yes, continuously judging whether another adjacent point of the current transit point is included in the third set;
if not, continuing to execute the step of selecting the point with the minimum path cost in the second set as the transit point;
and for the point P in the second set, the path cost is the sum of the minimum value of the cost from the point P to each passing point and the cost from the point P to the first current starting point.
2. The method for route planning of multiple transit points according to claim 1, wherein after the step of adding the current transit point to the third set, the step of querying the transit point having the shortest route from the current start point further comprises:
judging whether the current transit point is a passing point or not;
if yes, turning to the step of saving the sub-path from the current starting point to the current route point obtained by query;
if not, continuing to execute the step of judging whether the adjacent point of the current transfer point is included in the third set.
3. The method for route planning of multiple transit points according to claim 2, wherein the step of saving the sub-route from the current start point to the current route point obtained by the query comprises:
and connecting the points in the third set according to the adding sequence to generate the sub-path.
4. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method for path planning for multiple transit points according to any of claims 1-3 when executing the computer program.
5. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for path planning of multiple transit points according to any of claims 1-3.
6. A multi-transit point path planning system, the path planning system comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first set, and the first set comprises a starting point and at least two passing points;
the query module is used for querying a passing point with the shortest route away from the current starting point;
the storage module is used for storing sub-paths from the current starting point to the route point obtained by current query;
the changing module is used for changing the passing point obtained by the current query into a starting point;
the judging module is used for judging whether the first set comprises a passing point or not;
if yes, continuing to call the query module; if not, calling the splicing module;
the splicing module is used for splicing the sub-paths according to the stored sequence to generate an optimal path;
wherein the current starting point is the latest starting point in the first set;
the query module comprises:
a first adding unit, configured to add the current starting point into the second set;
a selecting unit, configured to select a point in the second set with the smallest path cost as a transit point;
a second adding unit, configured to add the current transit point to the third set;
a deleting unit configured to delete the current transit point from the second set;
a first judgment unit configured to judge whether or not a neighboring point of the current transit point is included in the third set;
if the current transit point is included in the third set, calling the first judging unit to continuously judge whether another adjacent point of the current transit point is included in the third set;
if the current time is not included in the third set, calling a second judgment unit;
wherein the second judging unit is configured to judge whether a current neighboring point is included in the second set;
if the first adding unit is not included in the second set, calling a third adding unit and a calculating unit;
if the current time is included in the second set, the computing unit is called again;
wherein the third adding unit is configured to add a current neighboring point to the second set;
the calculating unit is used for calculating the path cost of the current adjacent point;
the third judging unit is used for judging whether other adjacent points which are not judged exist in the current transit point;
if yes, calling the first judging unit, and continuously judging whether another adjacent point of the current transit point is included in the third set;
if not, calling the selection unit;
and for the point P in the second set, the path cost is the sum of the minimum value of the cost from the point P to each passing point and the cost from the point P to the first current starting point.
7. The multi-transit point path planning system of claim 6, wherein the query module further comprises:
a fourth judging unit, configured to judge whether the current transit point is a transit point;
if yes, calling the storage module;
if not, the first judgment unit is called.
8. The system according to claim 7, wherein the storage module is configured to connect the points in the third set according to a joining order to generate the sub-path.
CN201811301033.4A 2018-11-02 2018-11-02 Path planning method and system for multiple pass points, electronic device and storage medium Active CN110399997B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811301033.4A CN110399997B (en) 2018-11-02 2018-11-02 Path planning method and system for multiple pass points, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811301033.4A CN110399997B (en) 2018-11-02 2018-11-02 Path planning method and system for multiple pass points, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN110399997A CN110399997A (en) 2019-11-01
CN110399997B true CN110399997B (en) 2022-04-26

Family

ID=68322202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811301033.4A Active CN110399997B (en) 2018-11-02 2018-11-02 Path planning method and system for multiple pass points, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN110399997B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781132A (en) * 2020-06-15 2021-12-10 北京沃东天骏信息技术有限公司 Online shopping guide method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105607646A (en) * 2016-02-05 2016-05-25 哈尔滨工程大学 UUV route planning method with necessary points under obstacle environment
CN107687859A (en) * 2017-09-06 2018-02-13 电子科技大学 Most short method for searching based on A star algorithms
CN107860393A (en) * 2017-10-31 2018-03-30 刘靖宇 A kind of fast searching method of a plurality of shortest path
CN108229734A (en) * 2017-12-26 2018-06-29 北京像素软件科技股份有限公司 Paths planning method and device
CN108592929A (en) * 2018-03-26 2018-09-28 海南掌控科技有限公司 The some method of path planning and transport delivery system between multiple spot

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105607646A (en) * 2016-02-05 2016-05-25 哈尔滨工程大学 UUV route planning method with necessary points under obstacle environment
CN107687859A (en) * 2017-09-06 2018-02-13 电子科技大学 Most short method for searching based on A star algorithms
CN107860393A (en) * 2017-10-31 2018-03-30 刘靖宇 A kind of fast searching method of a plurality of shortest path
CN108229734A (en) * 2017-12-26 2018-06-29 北京像素软件科技股份有限公司 Paths planning method and device
CN108592929A (en) * 2018-03-26 2018-09-28 海南掌控科技有限公司 The some method of path planning and transport delivery system between multiple spot

Also Published As

Publication number Publication date
CN110399997A (en) 2019-11-01

Similar Documents

Publication Publication Date Title
CN109432777B (en) Path generation method and device, electronic equipment and storage medium
US9557182B2 (en) Computer-implemented systems and methods for planning a route
US10593110B2 (en) Method and device for computing a path in a game scene
US10634512B2 (en) Route navigation method and system, terminal, and server
US7917288B2 (en) Abbreviated directions for route navigation
CN109117429B (en) Database query method and device and electronic equipment
US20140067452A1 (en) Intelligent work management based on satellite navigation system data and network node data
KR100791748B1 (en) Reduceing Method of Shortest Path Searching Area and Calculating Method of Minimal Expecting Load and Method of Searching Shortest Path
CN111678527B (en) Path network graph generation method and device, electronic equipment and storage medium
US20180109439A1 (en) Constrained shortest path determination in a network
CN110703758A (en) Path planning method and device
CN113128743B (en) Goods picking path planning method and device
CN110399997B (en) Path planning method and system for multiple pass points, electronic device and storage medium
CN109816131B (en) Path planning method, path planning device and computer readable storage medium
CN113108806A (en) Path planning method, device, equipment and medium
CN112729323B (en) Path planning method and device
CN112539761A (en) Data processing method, device, equipment, storage medium and computer program product
CN115700641A (en) Shortest path determination method and device, electronic equipment and storage medium
CN111553637B (en) Method and device for generating pickup path, electronic equipment and storage medium
CN111830957A (en) Path planning method and device
CN115402323A (en) Lane changing decision method and electronic equipment
CN113739798B (en) Path planning method and device
CN108449268B (en) Point-to-point shortest path computing system in peer-to-peer network
CN112861024B (en) Method and device for determining road network matrix, electronic equipment and storage medium
CN113361788B (en) Path planning method for multi-type service demand under urban environment

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
TA01 Transfer of patent application right

Effective date of registration: 20210303

Address after: 101, 1st floor, building 2, yard 20, Suzhou street, Haidian District, Beijing 100080

Applicant after: Beijing Jingbangda Trading Co.,Ltd.

Address before: 100086 8th Floor, 76 Zhichun Road, Haidian District, Beijing

Applicant before: BEIJING JINGDONG SHANGKE INFORMATION TECHNOLOGY Co.,Ltd.

Applicant before: BEIJING JINGDONG CENTURY TRADING Co.,Ltd.

Effective date of registration: 20210303

Address after: Room 222, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Beijing Jingdong three hundred and sixty degree e-commerce Co.,Ltd.

Address before: 101, 1st floor, building 2, yard 20, Suzhou street, Haidian District, Beijing 100080

Applicant before: Beijing Jingbangda Trading Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant