CN107687859A - Most short method for searching based on A star algorithms - Google Patents
Most short method for searching based on A star algorithms Download PDFInfo
- Publication number
- CN107687859A CN107687859A CN201710794646.5A CN201710794646A CN107687859A CN 107687859 A CN107687859 A CN 107687859A CN 201710794646 A CN201710794646 A CN 201710794646A CN 107687859 A CN107687859 A CN 107687859A
- Authority
- CN
- China
- Prior art keywords
- point
- starting point
- grid
- cost
- state
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C21/00—Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
- G01C21/20—Instruments for performing navigational calculations
Landscapes
- Engineering & Computer Science (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Automation & Control Theory (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Navigation (AREA)
Abstract
The invention discloses a kind of most short method for searching based on A star algorithms.It includes region of search is divided into multiple grids and is put into starting point opening in list, the adjacent grid of grid where search starting point simultaneously calculates the distance of adjacent mesh point and target point, the cost calculated using A star algorithms from original state to dbjective state is estimated, correspond to whether cost estimate is that minimum value finds ground zero by judging starting point to each path of target point, then by judging whether new starting point is that target point completes pathfinding.The present invention has simple and clear, strong applicability, the advantages of being applicable various scene pathfindings.
Description
Technical field
The invention belongs to pathfinding algorithmic technique field, more particularly to a kind of most short method for searching based on A star algorithms.
Background technology
Pathfinding algorithm on general texts is often only applied on " figure " in mathematical meaning, i.e., by vertex set and side
Set interconnects the structure of composition.Therefore we need the map of a rasterizing being converted into one " figure ":Map
On each lattice can be used as a summit, and adjacent grid then respectively has a line, and two-dimensional grid is only considered in this example.
It is most of in AI and the pathfinding algorithm of algorithm field both for " figure " as mathematic(al) structure itself, and not pin
To this gridding map.It is desirable that find a kind of method that can utilize map unique characteristics.In fact some
It is considered that being the thing of general knowledge in two-dimensional mesh trrellis diagram, some pathfinding algorithms used on common figure may not examined in itself
Consider, for example, if two object distances are farther out, then time that may be from an object to the movement of another object and road
Footpath can be longer.For direction, if direction is towards east, then the path of optimal path should also be as being substantially to walk toward east, and
Do not go west.Information can also be obtained from symmetrical within a grid, i.e., first northwards again westwards, in most cases with it is first westwards
It is of equal value northwards again.These extra information can allow pathfinding algorithm quicker.
Dijkstra's algorithm in brief, exactly accesses other neighbor nodes from starting point, and node addition is to be checked
Look into node set, the path length value of node to be checked is updated using relaxed algorithm.As long as the side of negative weights is not present in figure,
Dijkstra's algorithm, which is able to ensure that, finds shortest path.
Greedy preferably first search algorithm is substantially similar therewith, the difference is that the algorithm has one to estimate the distance of target point
Evaluation (inspiration value).The algorithm node that selected distance starting point is not near in node set to be checked carries out the meter of next step
Calculate, but the node that chosen distance target point is near.Greedy preferably first search algorithm, which does not ensure that, searches out optimal path, so
And pathfinding speed can be greatly improved, because it has used heuristic to guide the trend in path.Compared to Dijkstra
Algorithm, greedy best-first search algorithm being capable of more rapidly pathfindings.But although greedy best-first search algorithm has done less calculating,
But a preferable path can not be found.
The content of the invention
The present invention goal of the invention be:In order to solve problem above present in prior art, the present invention proposes one kind
Most short method for searching based on A star algorithms.
The technical scheme is that:A kind of most short method for searching based on A star algorithms, comprises the following steps:
A, region of search is divided into multiple grids, determines starting point, target point and grid where barrier point, starting point is put into
Open in list;
B, the adjacent grid of grid where search starting point, the distance of adjacent mesh point and target point is calculated;
C, cost is used as using point corresponding to grid as the distance between the state in state space, point, using A star algorithms
Calculate the cost estimation from original state to dbjective state;
D, compare starting point to each path of target point and correspond to cost estimate size, judge starting point to each path of target point successively
Whether corresponding cost estimate is minimum value;If so, starting point is then put into closing list, at the same grid where starting point is adjacent
New starting point is put into and opened in list as new starting point by mesh point;It is if it is not, then that the path of starting point to target point is corresponding
Neighbor mesh points be put into closing list, reselect next starting point to the path of target point;
E, judge whether new starting point is target point;If so, then pathfinding terminates;If it is not, then return to step B.
Further, it is specially that region of search is divided into M*N region of search to be divided into multiple grids in the step A
Grid spaces.
Further, the step C is using point corresponding to grid as the conduct of the distance between the state in state space, point
Cost, use A star algorithms calculate from original state to dbjective state cost estimation calculation formula for
F=G+H
Wherein, F is the cost estimation from original state to dbjective state, and G is the cost from original state to NextState,
H is cost of the NextState to the optimal path of dbjective state.
The beneficial effects of the invention are as follows:The present invention uses A star algorithms, constantly updates start position, can directly search most
Good route, best route search can also be completed in the case where there is barrier;Further, it is also possible to practical problem is expanded
Exhibition, best route search can also be completed when Obstacle Position changes, has simple and clear, strong applicability, Ke Yishi
The advantages of with various scene pathfindings.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the most short method for searching based on A star algorithms of the present invention.
Fig. 2 is the region schematic diagram of a scenario in the embodiment of the present invention.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the present invention, not
For limiting the present invention.
As shown in figure 1, the schematic flow sheet of the most short method for searching based on A star algorithms for the present invention.One kind is based on A stars
The most short method for searching of algorithm, comprises the following steps:
A, region of search is divided into multiple grids, determines starting point, target point and grid where barrier point, starting point is put into
Open in list;
B, the adjacent grid of grid where search starting point, the distance of adjacent mesh point and target point is calculated;
C, cost is used as using point corresponding to grid as the distance between the state in state space, point, using A star algorithms
Calculate the cost estimation from original state to dbjective state;
D, compare starting point to each path of target point and correspond to cost estimate size, judge starting point to each path of target point successively
Whether corresponding cost estimate is minimum value;If so, starting point is then put into closing list, at the same grid where starting point is adjacent
New starting point is put into and opened in list as new starting point by mesh point;It is if it is not, then that the path of starting point to target point is corresponding
Neighbor mesh points be put into closing list, reselect next starting point to the path of target point;
E, judge whether new starting point is target point;If so, then pathfinding terminates;If it is not, then return to step B.
In step, region of search is divided into multiple grids by the present invention, and region of search specially is divided into M*N's
Grid spaces;Meanwhile mark out the grid wherein where starting point, target point and impassable barrier point;And starting point is put
Enter to open in list.
In stepb, the present invention is according to the starting point opened in list, the adjacent grid of grid where searching for the starting point, this
In the adjacent grid grid direction up and down where starting point grid, starting point carries out upper bottom left by grid adjacent thereto
Move right;According to the distance of the adjacent mesh point of the mobile route zequin of starting point and target point.
In step C, the present invention use A star algorithms, will be put corresponding to grid as the state in state space, between point
Distance as cost, calculate the cost estimation from original state to dbjective state, calculation formula is
F=G+H
Wherein, F is the cost estimation from original state to dbjective state, the i.e. distance of starting point and target point;G is from initial
Distance of the state to the cost, i.e. starting point and adjacent mesh point of NextState;H is NextState to the optimal road of dbjective state
The distance of the cost in footpath, i.e., adjacent mesh point and target point.
In step D, the present invention relatively starting point to each path of target point corresponds to cost estimate size, then chooses successively
One starting point judges that the paths correspond to whether cost estimate is minimum value to the path of target point;If so, Ze Jianggaitiao roads
The starting point in footpath is put into closing list, while using the adjacent mesh point of grid where starting point as new starting point, new starting point is put
Enter to open in list;If it is not, neighbor mesh points corresponding to the path of starting point to target point then are put into closing list, select again
Next starting point is selected to the path of target point, until having traveled through starting point to all paths of target point.
In step E, the present invention is by judging whether new starting point is target point to determine whether to complete most short pathfinding;If
It is then to illustrate to have completed most short pathfinding, pathfinding terminates;If it is not, then illustrating not completing most short pathfinding, return to step B, search for new
The adjacent grid of grid where starting point.
As shown in Fig. 2 it is the region schematic diagram of a scenario in the embodiment of the present invention.Region of search is divided into 5*3 by the present invention
Grid spaces, barrier is 1*1 grid spaces, and the position coordinates of starting point is set to (2,2), the coordinate of target point be set to (3,
5), the coordinate of barrier is set to (2,4), the adjacent mesh point of grid where search starting point, due to that can only be moved up and down
It is dynamic, therefore only judge the position of tetra- points of B, D, E, G.The distance that a mobile grid represents is 1, therefore B points G is 1, H 5, F
For 6;D points G is 1, H 5, F 6;E points G is 1, H 3, F 4;G points G is 1, H 3, F 4.Because point of destination is right in region
Inferior horn, thus be excluded that B points and D points, be put into and is closed in list, consider E points and G points as next step transfer point at this 2 points.By
It is identical in both E points and G points F, therefore select any point to move, the point of selection is put into open in list and moved
It is dynamic, initial point is put into and closed in list, and carries out judging new transfer point again.The point for being directed to barrier puts it into pass
Close in list and do not pay attention to, eventually find target point by the way that iteration is repeated several times, can now obtain optimal pathfinding route.
One of ordinary skill in the art will be appreciated that embodiment described here is to aid in reader and understands this hair
Bright principle, it should be understood that protection scope of the present invention is not limited to such especially statement and embodiment.This area
Those of ordinary skill can make according to these technical inspirations disclosed by the invention various does not depart from the other each of essence of the invention
The specific deformation of kind and combination, these deform and combined still within the scope of the present invention.
Claims (3)
1. a kind of most short method for searching based on A star algorithms, it is characterised in that comprise the following steps:
A, region of search is divided into multiple grids, determines starting point, target point and grid where barrier point, starting point is put into unlatching
In list;
B, the adjacent grid of grid where search starting point, the distance of adjacent mesh point and target point is calculated;
C, cost is used as using point corresponding to grid as the distance between the state in state space, point, is calculated using A star algorithms
Cost estimation from original state to dbjective state;
D, compare starting point to each path of target point and correspond to cost estimate size, judge that starting point is corresponding to each path of target point successively
Whether cost estimate is minimum value;If so, starting point then is put into closing list, while by the adjacent grid of grid where starting point
New starting point is put into and opened in list as new starting point by point;If it is not, then by phase corresponding to the path of starting point to target point
Adjacent mesh point is put into closing list, reselects next starting point to the path of target point;
E, judge whether new starting point is target point;If so, then pathfinding terminates;If it is not, then return to step B.
2. the most short method for searching based on A star algorithms as claimed in claim 1, it is characterised in that will search in the step A
Region division is that multiple grids are specially the grid spaces that region of search is divided into M*N.
3. the most short method for searching based on A star algorithms as claimed in claim 1, it is characterised in that the step C is by grid pair
The point answered is used as cost as the distance between the state in state space, point, is calculated using A star algorithms from original state to mesh
Mark state cost estimation calculation formula be
F=G+H
Wherein, F is the cost estimation from original state to dbjective state, and G is the cost from original state to NextState, and H is
Cost of the NextState to the optimal path of dbjective state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710794646.5A CN107687859A (en) | 2017-09-06 | 2017-09-06 | Most short method for searching based on A star algorithms |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710794646.5A CN107687859A (en) | 2017-09-06 | 2017-09-06 | Most short method for searching based on A star algorithms |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107687859A true CN107687859A (en) | 2018-02-13 |
Family
ID=61156117
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710794646.5A Pending CN107687859A (en) | 2017-09-06 | 2017-09-06 | Most short method for searching based on A star algorithms |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107687859A (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108818532A (en) * | 2018-06-25 | 2018-11-16 | 广州视源电子科技股份有限公司 | Motion planning method, device, equipment and computer readable storage medium |
CN108871364A (en) * | 2018-06-28 | 2018-11-23 | 南京信息工程大学 | A kind of underwater robot paths planning method based on Node Algorithm |
CN109859525A (en) * | 2019-04-03 | 2019-06-07 | 哈尔滨工业大学 | Parking stall air navigation aid based on A star algorithm |
CN110220528A (en) * | 2019-06-10 | 2019-09-10 | 福州大学 | A kind of two-way dynamic path planning method of automatic Pilot unmanned vehicle based on A star algorithm |
CN110285819A (en) * | 2018-03-19 | 2019-09-27 | 北京京东尚科信息技术有限公司 | The method and apparatus for determining shortest path |
CN110399997A (en) * | 2018-11-02 | 2019-11-01 | 北京京东尚科信息技术有限公司 | Paths planning method, system, electronic equipment, the storage medium of more transit points |
CN110595482A (en) * | 2019-10-28 | 2019-12-20 | 深圳市银星智能科技股份有限公司 | Path planning method and device with obstacle avoidance weight and electronic equipment |
CN112558611A (en) * | 2020-12-15 | 2021-03-26 | 深圳市云视机器人有限公司 | Path planning method and device, computer equipment and storage medium |
CN112717406A (en) * | 2021-01-04 | 2021-04-30 | 厦门梦加网络科技股份有限公司 | Role processing method and system for multi-user hand trip disconnection |
CN113730915A (en) * | 2021-09-16 | 2021-12-03 | 腾讯科技(深圳)有限公司 | Target path determination method and device, storage medium and electronic equipment |
CN113781132A (en) * | 2020-06-15 | 2021-12-10 | 北京沃东天骏信息技术有限公司 | Online shopping guide method and device |
CN114485611A (en) * | 2021-12-28 | 2022-05-13 | 中科星图股份有限公司 | Three-dimensional space shortest path planning method and device based on Beidou grid code |
CN115779424A (en) * | 2023-02-08 | 2023-03-14 | 广州三七极耀网络科技有限公司 | Navigation grid path finding method, device, equipment and medium |
CN116764225A (en) * | 2023-06-09 | 2023-09-19 | 广州三七极梦网络技术有限公司 | Efficient path-finding processing method, device, equipment and medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103529843A (en) * | 2013-10-17 | 2014-01-22 | 电子科技大学中山学院 | Lambda path planning algorithm |
CN103697895A (en) * | 2014-01-09 | 2014-04-02 | 西安电子科技大学 | Method for determining optimal path of flight vehicle based on self-adaptive A star algorithm |
CN103971008A (en) * | 2014-05-19 | 2014-08-06 | 浪潮电子信息产业股份有限公司 | Improved heuristic A * algorithm |
CN105138859A (en) * | 2015-09-30 | 2015-12-09 | 四川师范大学 | Three-dimensional panorama roaming path finding method and system |
CN106441303A (en) * | 2016-09-30 | 2017-02-22 | 哈尔滨工程大学 | Path programming method based on A* algorithm capable of searching continuous neighborhoods |
US20170199041A1 (en) * | 2016-01-08 | 2017-07-13 | Fuji Jukogyo Kabushiki Kaisha | Path searching apparatus, path searching method, and recording medium |
-
2017
- 2017-09-06 CN CN201710794646.5A patent/CN107687859A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103529843A (en) * | 2013-10-17 | 2014-01-22 | 电子科技大学中山学院 | Lambda path planning algorithm |
CN103697895A (en) * | 2014-01-09 | 2014-04-02 | 西安电子科技大学 | Method for determining optimal path of flight vehicle based on self-adaptive A star algorithm |
CN103971008A (en) * | 2014-05-19 | 2014-08-06 | 浪潮电子信息产业股份有限公司 | Improved heuristic A * algorithm |
CN105138859A (en) * | 2015-09-30 | 2015-12-09 | 四川师范大学 | Three-dimensional panorama roaming path finding method and system |
US20170199041A1 (en) * | 2016-01-08 | 2017-07-13 | Fuji Jukogyo Kabushiki Kaisha | Path searching apparatus, path searching method, and recording medium |
CN106441303A (en) * | 2016-09-30 | 2017-02-22 | 哈尔滨工程大学 | Path programming method based on A* algorithm capable of searching continuous neighborhoods |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110285819B (en) * | 2018-03-19 | 2023-01-31 | 北京京东乾石科技有限公司 | Method and device for determining shortest path |
CN110285819A (en) * | 2018-03-19 | 2019-09-27 | 北京京东尚科信息技术有限公司 | The method and apparatus for determining shortest path |
CN108818532B (en) * | 2018-06-25 | 2021-11-09 | 广州视源电子科技股份有限公司 | Motion planning method, device, equipment and computer readable storage medium |
CN108818532A (en) * | 2018-06-25 | 2018-11-16 | 广州视源电子科技股份有限公司 | Motion planning method, device, equipment and computer readable storage medium |
CN108871364A (en) * | 2018-06-28 | 2018-11-23 | 南京信息工程大学 | A kind of underwater robot paths planning method based on Node Algorithm |
CN110399997B (en) * | 2018-11-02 | 2022-04-26 | 北京京东叁佰陆拾度电子商务有限公司 | Path planning method and system for multiple pass points, electronic device and storage medium |
CN110399997A (en) * | 2018-11-02 | 2019-11-01 | 北京京东尚科信息技术有限公司 | Paths planning method, system, electronic equipment, the storage medium of more transit points |
CN109859525A (en) * | 2019-04-03 | 2019-06-07 | 哈尔滨工业大学 | Parking stall air navigation aid based on A star algorithm |
CN110220528A (en) * | 2019-06-10 | 2019-09-10 | 福州大学 | A kind of two-way dynamic path planning method of automatic Pilot unmanned vehicle based on A star algorithm |
CN110595482A (en) * | 2019-10-28 | 2019-12-20 | 深圳市银星智能科技股份有限公司 | Path planning method and device with obstacle avoidance weight and electronic equipment |
CN113781132A (en) * | 2020-06-15 | 2021-12-10 | 北京沃东天骏信息技术有限公司 | Online shopping guide method and device |
CN112558611A (en) * | 2020-12-15 | 2021-03-26 | 深圳市云视机器人有限公司 | Path planning method and device, computer equipment and storage medium |
CN112717406A (en) * | 2021-01-04 | 2021-04-30 | 厦门梦加网络科技股份有限公司 | Role processing method and system for multi-user hand trip disconnection |
CN113730915A (en) * | 2021-09-16 | 2021-12-03 | 腾讯科技(深圳)有限公司 | Target path determination method and device, storage medium and electronic equipment |
CN113730915B (en) * | 2021-09-16 | 2023-08-25 | 腾讯科技(深圳)有限公司 | Determination method and device of target path, storage medium and electronic equipment |
CN114485611A (en) * | 2021-12-28 | 2022-05-13 | 中科星图股份有限公司 | Three-dimensional space shortest path planning method and device based on Beidou grid code |
CN114485611B (en) * | 2021-12-28 | 2024-04-26 | 中科星图股份有限公司 | Three-dimensional space shortest path planning method and device based on Beidou grid codes |
CN115779424A (en) * | 2023-02-08 | 2023-03-14 | 广州三七极耀网络科技有限公司 | Navigation grid path finding method, device, equipment and medium |
CN116764225A (en) * | 2023-06-09 | 2023-09-19 | 广州三七极梦网络技术有限公司 | Efficient path-finding processing method, device, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107687859A (en) | Most short method for searching based on A star algorithms | |
CN108981710B (en) | A kind of complete coverage path planning method of mobile robot | |
CN109405839B (en) | Traffic network off-line map matching algorithm based on multiple paths | |
Maher et al. | A bi-level programming approach for trip matrix estimation and traffic control problems with stochastic user equilibrium link flows | |
CN110111574B (en) | Urban traffic imbalance evaluation method based on flow tree analysis | |
TWI500297B (en) | Path searching method and path search device | |
CN109540136A (en) | A kind of more unmanned boat collaboration paths planning methods | |
JP2013508692A (en) | Additional map generation, refinement and expansion using GPS trajectories | |
US20160033292A1 (en) | Method and system for obtaining trajectory pattern of route | |
CN103309932B (en) | Method for searching path and route searching equipment | |
CN106446960A (en) | Dynamic hot degree road network constructing method with density-based clustering time quantum dividing function | |
CN107121146B (en) | Optimum path planning method based on road chain depth | |
Azis et al. | Comparison of Floyd-Warshall algorithm and greedy algorithm in determining the shortest route | |
CN109443363A (en) | Certainty of dividing and ruling path optimizing algorithm | |
KR101299134B1 (en) | Searching system and method for moving targets in dynamic environment by cooperation of plural robots | |
KR100690777B1 (en) | Method for searching a optimal route | |
Chia et al. | Trip planning route optimization with operating hour and duration of stay constraints | |
CN109781126A (en) | A kind of global static path planning method based on vector method | |
CN111337047A (en) | Unstructured road macroscopic path planning method based on multi-task point constraint | |
WO2016119615A1 (en) | Navigation route road section expansion method and device thereof | |
Kuznetsov | Cellular automata-based model of group motion of agents with memory and related continuous model | |
CN116878527A (en) | Hybrid path planning method and device based on improved adaptive window algorithm | |
Jia et al. | An improved JPS algorithm in symmetric graph | |
Fink | Online learning of search heuristics | |
JP2018159568A (en) | Calculation device, calculation system, calculation method and calculation program |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180213 |