A star path finding method and system based on binary heap node sorting

A binary heap and heap sorting technology, which is applied in the A-star pathfinding method and system field based on binary heap node sorting, can solve problems such as slowdown, slow efficiency, and inability to meet the real-time requirements of the game, so as to improve execution efficiency Effect

Inactive Publication Date: 2015-01-07
CHONGQING UNIV OF POSTS & TELECOMM
View PDF1 Cites 16 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The traditional A-star algorithm needs to maintain the OPEN and CLOSE tables frequently, and needs to sort the nodes in the OPEN table every time, while the average time complexity of the A-star algorithm using bubble sorting is O(n^2

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A star path finding method and system based on binary heap node sorting
  • A star path finding method and system based on binary heap node sorting

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0048] Example 1

[0049] figure 1 The flowchart of the method for finding A-star paths based on binary heap node sorting provided by the embodiment of the present invention is as shown in the figure: The method for finding A-star paths based on binary heap node sorting provided by the present invention includes the following steps:

[0050] S1: Initialize the OPEN table, CLOSE table and target point A, put the starting node S into the OPEN table, and empty the CLOSE table;

[0051] S2: Determine whether the OPEN table is empty, if not, take a node n from the header of the OPEN table; if so, end the algorithm process;

[0052] S3: Determine whether the node n is the target solution A, if so, output the node n; if not, go to step S4; the target solution is the target point A to be finally found, that is, find a path from the starting point to reach Target;

[0053] S4: Expand all subsequent nodes of node n to form directly associated child nodes, and determine whether the c...

Example Embodiment

[0085] Example 2

[0086] The difference between this embodiment and Embodiment 1 is only:

[0087] This embodiment describes the A-star pathfinding method based on binary heap node sorting in detail. The method provided in this embodiment is to introduce a binary heap into the A-star algorithm to sort nodes, thereby improving the efficiency of the algorithm. The specific process is as follows:

[0088] 1. Initialize an OPEN table (used to store the next node to be traversed), a CLOSE table (used to store the paths that have been found), put the starting node S into the OPEN table, and empty the CLOSE table;

[0089] 2. If the OPEN table is not empty, take a node n from the table header. If it is empty, the algorithm fails;

[0090] 3. Judging that node n is the target solution, if so, find a solution (continue searching, or terminate the algorithm); if not, go to step 4;

[0091] 4. Step 4 is divided into the following steps

[0092] 4.1. Expand all subsequent nodes of nod...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses an A star path finding method and system based on binary heap node sorting. The A star path finding method includes: conducting initialization; judging whether a node n in an OPEN graph is a target solution A, if not, unfolding all follow-up nodes of the node n to form directly correlated sub nodes, putting the judged node n in a CLOSE graph, calculating the appraisal value of each follow-up node of the node n, conducting heat sorting on the OPEN graph according to the appraisal value, putting the node with the smallest appraisal value at the graph head of the OPEN graph, and repeating the steps until all the nodes are sorted. The A star path finding method introduces heat sorting in the normal A star algorithm so that the execution efficiency of the A star algorithm is greatly improved. The A star path finding method overcomes the defects of the traditional A star algorithm of frequently maintaining the OPEN graph and the CLOSE graph, causing long calculating time as the nodes in the OPEN graph have to be sorted each time, and being incapable of meeting high game timeliness requirements.

Description

technical field [0001] The present invention relates to the technical field of games, in particular to a method and system for finding a path for star A based on binary heap node sorting. Background technique [0002] Games are called the ninth art in the industry, and successful games will be highly praised by players all over the world. With the application of mobile Internet technology and the rapid development of services such as 3G and 4G value-added services with China Mobile Network, mobile games have shown their edge. In game software, artificial intelligence is an important and complex module, and pathfinding algorithm is one of the most basic problems in the application of artificial intelligence in video games. Objects move in a way that specifies a destination, which requires the program to be able to find an optimal path from the starting point to the target point. This path should be the shortest path that bypasses obstacles and reaches the destination. The c...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F19/00
Inventor 熊仕勇林金朝周敏潘豪田航李沁翰唐浩张喜平聂婧谭世雨李杨
Owner CHONGQING UNIV OF POSTS & TELECOMM
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products