A custom navigation method and system for smart navigation system

CN118565507BActive Publication Date: 2024-11-05QINGDAO DAOKE CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411052401.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-05
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

When relying on third-party navigation software in the smart navigation system, if the scenic spot roads are not included or are not included in detail, it will lead to navigation failure or confusion and cannot provide accurate navigation services.

Method used

Manually set the navigation points and road points in the background of the smart navigation system, and perform the shortest path calculation through the Dijkstra and Floyd algorithms to form road network information to ensure the accuracy and reliability of the navigation route.

Benefits of technology

It provides more accurate navigation services, reduces navigation errors, improves scenic spot management efficiency and tourist experience, and enhances the adaptability and commercial value of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118565507B_ABST
    Figure CN118565507B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of navigation technology, and discloses a custom navigation method and system applied to a smart navigation system. The method sets navigation points for scenic spots in the background of smart navigation; marks road points and connects the points; when the user uses the custom navigation function, the system calls the shortest path algorithm to guide the navigation route. By setting navigation points and marking road points in the background of smart navigation, the present invention can provide tourists with more accurate navigation services and reduce navigation errors caused by incomplete road information of third-party software. The present invention is applicable to graphs with positive edge weights, and has a time complexity of O(n2). It is very efficient in map navigation because the actual road distance cannot be negative. The present invention ensures the accuracy and reliability of the navigation system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of navigation technology, and in particular relates to a user-defined navigation method and system applied to a smart navigation system. Background Art

[0002] The smart guide system is an intelligent identification system that uses mobile applications to achieve positioning, navigation and information query. It is widely used in tourist attractions, commercial areas, schools, hospitals and other places to improve travel efficiency and experience. Its system architecture includes positioning system, navigation system and information query system. The technical implementation depends on positioning technology, intelligent identification technology and mobile application technology. The system architecture of smart guide mainly includes three parts: positioning system, navigation system and information query system. First, the positioning system is responsible for determining the current location of the user. It can use GPS, WiFi, Bluetooth and other technologies for positioning, and transmit the positioning results to the navigation system. The navigation system calculates the shortest path and provides navigation guidance based on the user's starting point, end point and current location.

[0003] At present, the navigation function provided to tourists in the smart tour guide system is highly dependent on third-party navigation software, such as Baidu and Amap. If the roads in the scenic area are not included in Baidu and Amap, or the inclusion is not detailed enough, then tourists will encounter problems such as navigation failure and navigation confusion when using the scenic area tour. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the disclosed embodiments of the present invention provide a custom navigation method and system applied to a smart guide system.

[0005] The technical solution is as follows: A custom navigation method applied to a smart guide system, comprising:

[0006] S1, set the guide points for the scenic spot in the smart guide background;

[0007] S2, marking road points and connecting them;

[0008] S3: When the user uses the custom navigation function, the smart navigation system calls the shortest path algorithm to provide navigation route guidance.

[0009] In step S2, the road points are marked and connected, including:

[0010] Based on the on-site survey, a hand-drawn map of the actual road distribution of the scenic area is drawn, and the hand-drawn map is superimposed on the electronic map engine for display. The starting point, important points, and scenic spots of the road are manually clicked to mark the points; after the points are marked, the adjacent points are automatically connected to form road network information.

[0011] In step S3, the system calls the shortest path algorithm to provide navigation route guidance, including:

[0012] S301, initializing the distance matrix;

[0013] S302, gradually updating the shortest path through three-layer loops;

[0014] S303, checking whether there is a negative weight cycle, if a negative weight cycle is detected, outputting a prompt and terminating the calculation.

[0015] In step S301, initializing the distance matrix includes:

[0016] Construct a distance matrix "dist", where "dist[i][j]" represents the currently known shortest path length from vertex "i" to vertex "j". If there is a direct edge from vertex "i" to vertex "j", "dist[i][j]" is set to the weight of the edge; if there is no direct edge, it is set to infinity; the distance from itself to itself "dist[i][i]" is set to 0.

[0017] In step S302, the shortest path is gradually updated through a three-layer loop, including:

[0018] By checking each vertex "k" one by one, update the shortest path length "dist[i][j]" of all vertex pairs "(i, j)";

[0019] Check whether a shorter path can be obtained from vertex "i" to vertex "j" by using vertex "k" as a transit point; if so, update "dist[i][j]" to "dist[i][k] + dist[k][j]".

[0020] In step S303, it is checked whether there is a negative weight ring. If a negative weight ring is detected, a prompt is output and the calculation is terminated, including:

[0021] After all iterations are completed, if any vertex "i" has "dist[i][i]<0", it means that there is a negative weight cycle in the electronic map; if the shortest path distance from a vertex to itself becomes a negative value, there is a circular path whose total weight is negative.

[0022] Another object of the present invention is to provide a custom navigation system applied to a smart navigation system, the system applying the custom navigation method applied to the smart navigation system, the system comprising:

[0023] The guide point setting module is used to set guide points for scenic spots in the smart guide background;

[0024] Point connection module, used to mark road points and connect them;

[0025] The shortest path algorithm calling module is used when the user uses the custom navigation function, and the system calls the shortest path algorithm for navigation route guidance.

[0026] Furthermore, the system is mounted on a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, and when the processor executes the computer program, the functions of the custom navigation system applied to the smart guide system as described above are implemented.

[0027] Furthermore, the system is mounted on a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the function of the above-mentioned custom navigation system applied to the smart guide system can be realized.

[0028] Furthermore, the system is mounted on an information data processing terminal, and the information data processing terminal is used to provide a user input interface to implement the functions of the custom navigation system applied to the smart guide system as described above when executed on an electronic device.

[0029] In combination with all the above technical solutions, the beneficial effects of the present invention are as follows:

[0030] Accurate navigation: By setting guide points and marking road points in the smart navigation background, more accurate navigation services can be provided to tourists, reducing navigation errors caused by incomplete road information of third-party software.

[0031] Combination of algorithm advantages: Dijkstra algorithm: Applicable to graphs with positive edge weights, with a time complexity of O(n2), which is very efficient in map navigation because the actual road distance cannot be negative.

[0032] Floyd algorithm: Although the time complexity is O(n3), it can calculate the shortest path between all points. It is suitable for complex scenic area maps and can provide comprehensive navigation information.

[0033] Customized navigation: Users can use the customized navigation function, and the system will call the shortest path algorithm to provide route guidance and provide a personalized travel experience.

[0034] Negative loop detection: Although the present invention does not use the Bellman-Ford algorithm, the Floyd algorithm can also detect negative loops to ensure the accuracy and reliability of the navigation system.

[0035] The technical solution of the present invention can significantly improve the management efficiency of scenic spots and the guided tour experience of tourists, and has high commercial application value. By providing more accurate navigation services, more tourists can be attracted and the revenue of scenic spots can be increased. The personalized navigation function of the system can improve the satisfaction of tourists and help improve the brand image of scenic spots.

[0036] The technical solution of the present invention provides a new solution in the field of smart navigation, filling the technical gap of relying on third-party navigation software. The implementation of this solution not only improves the accuracy of navigation, but also can independently complete the navigation task without the support of third-party navigation data.

[0037] The present invention solves the problem of inaccurate or confusing navigation encountered by tourists when using smart guides, which has always been a technical problem that tourists and scenic area managers hope to solve. Through the customized navigation system, tourists can obtain more accurate and reliable navigation services, improving the quality and efficiency of the guide.

[0038] The technical solution of the present invention overcomes the prejudice that the smart navigation system can only rely on existing third-party navigation data. By combining the Dijkstra algorithm and the Floyd algorithm, the present invention provides a more comprehensive and flexible navigation solution suitable for various complex geographical environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure;

[0040] Figure 1 is a flow chart of a custom navigation method applied to a smart guide system provided by an embodiment of the present invention;

[0041] Figure 2 The embodiment of the present invention provides a flowchart of calling the shortest path algorithm to perform navigation route guidance;

[0042] Figure 3 is a schematic diagram of a custom navigation system applied to a smart guide system provided by an embodiment of the present invention;

[0043] In the figure: 1. Navigation point setting module; 2. Point connection module; 3. Shortest path algorithm calling module. DETAILED DESCRIPTION

[0044] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.

[0045] The innovation of the present invention is that the present invention provides accurate navigation services by setting navigation points in the background and manually marking road points. The system combines the advantages of the Dijkstra algorithm and the Floyd algorithm, and can independently complete navigation tasks without the support of third-party navigation data, and provide users with personalized navigation route guidance through the shortest path algorithm. In addition, the system can also detect negative weight loops to ensure the accuracy and reliability of navigation. These innovations not only improve the accuracy of navigation and user experience, but also enhance the versatility and adaptability of the system, enabling it to provide reliable navigation services in a variety of different environments. In short, the custom navigation method and system of the present invention bring innovative technical solutions to the field of smart navigation, with significant commercial application value and broad market prospects.

[0046] Embodiment 1, the present invention mainly aims at the problem that tourists cannot navigate or have navigation confusion when using the scenic spot guide system due to the incomplete internal roads recorded by the third-party navigation software. Figure 1 As shown, a custom navigation method applied to a smart guide system is proposed, comprising:

[0047] S1, set the guide points for the scenic spot in the smart guide background;

[0048] Enhanced User Interface: The improved backend system provides an intuitive, easy-to-use interface, allowing administrators to set and adjust guide points more conveniently.

[0049] Map integration and editing tools: The backend system integrates advanced map editing tools, allowing administrators to directly draw and mark navigation points on electronic maps, including the overlay display function of hand-drawn maps.

[0050] Real-time data synchronization: When guide points are set or updated, the system can synchronize these changes to the user's mobile application in real time to ensure the timeliness and accuracy of the guide information.

[0051] Intelligent point connection: The system uses intelligent algorithms to automatically connect adjacent navigation points to form coherent road network information, reducing errors and omissions in manual input.

[0052] Multi-dimensional information support: In addition to location information, the background also allows the addition of multi-dimensional information, such as the historical background and cultural significance of the tour points, enriching the tour content.

[0053] Flexible route planning: Administrators can flexibly set up multiple guided routes according to different tourist needs and scenic spot characteristics, and provide personalized guided tour options.

[0054] S2, marking road points and connecting them;

[0055] First, draw a hand-drawn map of the actual road distribution of the scenic area based on the field survey, and then overlay the hand-drawn map on the electronic map engine (such as Gaode, Baidu, ArcGIS, etc.) to display it. Manually click on the starting point of the road, important points, and scenic spots to mark the points. After the points are marked, the system automatically connects the adjacent points to form the road network information. The denser the marking, the smoother the point connection and the more complete the road network information.

[0056] Intelligent labeling assistance: By introducing machine learning, the system can provide intelligent suggestions when administrators perform manual labeling, automatically identify road contours and important landmarks, and reduce the burden of manual operations.

[0057] Dynamic point density adjustment: The system can dynamically adjust the density of points according to the actual use of the road and user feedback to ensure the smoothness and accuracy of the road network information. Use high-frequency sampling methods to increase the density of points, making the path smoother.

[0058] Optimized connection algorithm: Improve the point connection algorithm and introduce Bezier curve and spline curve algorithms to generate smoother routes. These algorithms can automatically adjust the curve according to the position of adjacent points to achieve a more natural transition effect.

[0059] Negative feedback loop detection: When forming road network information, the system can detect and correct negative feedback loops that may cause navigation errors by adding a detection algorithm to identify and solve these problems.

[0060] Interactive editing tools: Provide more advanced interactive editing tools, allowing administrators to drag, connect and delete points directly on the map, making the editing of road network information more intuitive and efficient.

[0061] Multi-source data fusion: Combine multiple data sources, such as satellite imagery, terrain data, and field survey results, to improve the accuracy of hand-drawn maps and the reliability of road network information.

[0062] S3: When the user uses the custom navigation function, the smart navigation system calls the shortest path algorithm to provide navigation route guidance.

[0063] At present, there are several common shortest path algorithms: Bellman-Ford, SPFA, and Floyd-Warshall. The ideas of each algorithm are different or even completely different, and the applicable scenarios are also different.

[0064] bellman-ford: can be used for graphs with negative edge weights. If there is a negative cycle in the graph, the algorithm will detect it. Time complexity O(VE).

[0065] Dijkstra's algorithm is used to solve the single-source shortest path problem and is applicable to graphs with non-negative edge weights. The basic steps are as follows:

[0066] Step 1: Initialize the distance from the source point to all other vertices to infinity, and the distance from the source point to itself to 0.

[0067] Step 2, use a priority queue (usually a minimum heap) to select the vertex with the smallest current distance.

[0068] Step 3: Update the distances of all adjacent vertices of the vertex.

[0069] Step 4, repeat steps 2 and 3 until the shortest paths of all vertices are determined.

[0070] spfa: Bellman-Ford optimization algorithm, which is essentially Bellman-Ford, so its applicability is the same as Bellman-Ford. Time complexity is O(KE).

[0071] Dijkstra: Can only be used in graphs with positive edge weights. Time complexity O(n2).

[0072] floyd: It can also be used in graphs with negative weights. Even if there are negative cycles, the algorithm can detect them. It can find the shortest path to any point, the minimum and maximum cycles of directed and undirected graphs. The time complexity is O(n3).

[0073] The present invention mainly uses a combination of Dijkstra and Floyd-Warshall and optimizes the algorithm. Because the Dijkstra algorithm is more efficient, and the distance between each two points in the map must be a positive number, and it is impossible for the distance between two points to be negative. Although the Floyd-Warshall algorithm is slower, it is very powerful and can directly calculate the paths between all points in a map. Therefore, for the optimal path navigation scenario in the map, the present invention adopts a solution combining the two.

[0074] Specifically include:

[0075] Initialization: Use the Floyd-Warshall algorithm to preprocess the shortest paths between all vertex pairs to obtain the distance matrix dist.

[0076] Global optimization: The Floyd-Warshall algorithm can preprocess and optimize the shortest paths between all pairs of vertices in the entire network, which provides a global perspective for path planning in complex networks.

[0077] Data preprocessing: By preprocessing the data, a fast response can be achieved when an actual navigation request occurs, because the shortest paths for all vertex pairs have been calculated and stored.

[0078] Algorithm improvement: The Floyd-Warshall algorithm in the prior art is usually not optimized for specific application scenarios. The present invention improves the efficiency and applicability of the algorithm by improving the algorithm (introducing heuristic methods and parallel computing).

[0079] Memory optimization: For large-scale networks, the traditional Floyd-Warshall algorithm may encounter memory limitations. This invention adopts space optimization technology to store only necessary path information and reduce memory usage.

[0080] Real-time updates: In a dynamically changing network, such as road construction or temporary closures, pre-processed data can be quickly updated to ensure the real-time and accurate navigation information.

[0081] User customization: Based on the user's historical data and preferences, the pre-processed shortest path data can be personalized to provide navigation services that better meet user needs.

[0082] The distance matrix dist is a data structure used to represent the shortest path lengths between all pairs of vertices in a graph. In this matrix, dist[i][j] represents the shortest path length from vertex i to vertex j. If there is a direct edge between vertex i and vertex j, the value of dist[i][j] is the weight of the edge; if there is no direct connection between them, the value of dist[i][j] is usually set to infinity (indicating unreachable); for any vertex i, the value of dist[i][i] is set to 0, because the shortest path length from any vertex to itself is 0.

[0083] When using an algorithm such as the Floyd-Warshall algorithm, the distance matrix is ​​updated during the algorithm execution to reflect changes in the shortest path between vertices. For example, if the path from vertex i to vertex j can be shorter by using vertex k as a transfer point, the value of dist[i][j] will be updated to dist[i][k] + dist[k][j]. In this way, at the end of the algorithm, the dist matrix contains the shortest path lengths between all vertex pairs, which can be used in application scenarios such as navigation and path planning.

[0084] Single-source shortest path query:

[0085] For single-source shortest path queries (the shortest path from some source vertex to all other vertices), Dijkstra's algorithm can be used.

[0086] 1. Priority queue optimization: Use a more efficient data structure, the Fibonacci heap, to optimize the operation of the priority queue, thereby reducing the time complexity of the algorithm.

[0087] 2. Heuristic search: Combine heuristic algorithms (A* algorithm) to optimize the Dijkstra algorithm, guide the search direction by estimating the distance to the target vertex, and reduce unnecessary path exploration.

[0088] 3. Parallel computing: Utilize the parallel computing capabilities of modern multi-core processors to parallelize different parts of the Dijkstra algorithm to speed up the calculation process.

[0089] 4. Dynamic update: For dynamically changing graphs and real-time traffic networks, the algorithm is improved to support fast updates of the shortest path without recalculating it from scratch.

[0090] 5. Local optimization: For specific types of graphs (such as sparse graphs or graphs with specific structures), perform local optimization of the algorithm to improve efficiency.

[0091] 6. Preprocessing techniques: Preprocess the graph, using layered graphs or landmark methods to quickly answer shortest path queries.

[0092] In the initialization stage of the Dijkstra algorithm, the preprocessed distance matrix dist can be used to speed up the setting of the initial distance.

[0093] In the initialization phase of the Dijkstra algorithm, using the preprocessed distance matrix dist to speed up the setting of the initial distance is an effective improvement. The specific implementation process can be described as follows:

[0094] Preprocessing stage:

[0095] First, the graph is preprocessed by the Floyd-Warshall algorithm or other methods to calculate and store the shortest path lengths between all vertex pairs to form a distance matrix dist.

[0096] In this matrix, dist[i][j] represents the shortest path length from vertex i to vertex j.

[0097] Initialize Dijkstra's algorithm:

[0098] When a single-source shortest path query is required, a source point s is selected.

[0099] For each vertex v, set the initial distance d[v] to dist[s][v]. In this way, the initial distance of each vertex is already the shortest path length from the source point s to the vertex.

[0100] Execute Dijkstra's algorithm:

[0101] Use a priority queue to manage unprocessed vertices and sort them according to the initial distance d[v].

[0102] Starting from the source point s, update the distances of adjacent vertices, and repeat this process until all vertices have been processed.

[0103] Optimization points:

[0104] Data structure optimization: Use more efficient priority queue implementations, such as Fibonacci heaps, to reduce the time complexity of distance update operations.

[0105] Parallel processing: Execute different parts of Dijkstra's algorithm in parallel on multi-core processors, especially when processing a large number of vertices.

[0106] Dynamic update: If the edge weights in the graph change, the distance matrix dist can be updated quickly without recalculating the entire matrix.

[0107] In this way, the initialization phase of the Dijkstra algorithm can be significantly accelerated, especially in application scenarios where single-source shortest path queries are frequently performed. This improvement can improve the overall efficiency and response speed of the algorithm.

[0108] The specific running code program is:

[0109] import heapq

[0110] def floyd_warshall(graph):

[0111] num_vertices = len(graph)

[0112] dist = [[float('inf')] * num_vertices for _ in range(num_vertices)]

[0113] for i in range(num_vertices):

[0114] dist[i][i]= 0

[0115] for u in range(num_vertices):

[0116] for v, weight in graph[u]:

[0117] dist[u][v]= weight

[0118] for k in range(num_vertices):

[0119] for i in range(num_vertices):

[0120] for j in range(num_vertices):

[0121] if dist[i][j]>dist[i][k]+ dist[k][j]:

[0122] dist[i][j]= dist[i][k]+ dist[k][j]

[0123] return dist

[0124] def dijkstra(graph, start, dist):

[0125] num_vertices = len(graph)

[0126] min_heap = [(0, start)]

[0127] distances = [float('inf')] * num_vertices

[0128] distances[start] = 0

[0129] visited = [0] * num_vertices

[0130] while min_heap:

[0131] current_distance, u = heapq.heappop(min_heap)

[0132] if visited[u]:

[0133] continue

[0134] visited[u] = 1

[0135] for v, weight in graph[u]:

[0136] distance = current_distance + weight

[0137] if distance <distances[v]:

[0138] distances[v] = distance

[0139] heapq.heappush(min_heap, (distance, v))

[0140] return distances

[0141] # Example, graph[u] is a list containing all edges (v, weight) starting from u

[0142] graph = {

[0143] 0: [(1, 3), (2, 1)],

[0144] 1: [(2, 7), (3, 5), (4, 1)],

[0145] 2: [(3, 2)],

[0146] 3: [(4, 7)], 4: []

[0148] }

[0149] # Use the Floyd-Warshall algorithm to preprocess the shortest paths between all vertex pairs

[0150] dist = floyd_warshall(graph)

[0151] # Use Dijkstra's algorithm to find the shortest path from a source point (such as 0) to all other vertices

[0152] start = 0

[0153] shortest_paths = dijkstra(graph, start, dist)

[0154] print("The shortest path starting from vertex 0:", shortest_paths).

[0155] Example 2, exemplary, such as Figure 2 As shown, in step S3, when the user uses the custom navigation function, the system calls the shortest path algorithm to perform navigation route guidance, including:

[0156] S301, initializing the distance matrix;

[0157] S302, then gradually update the shortest path through three-layer loops;

[0158] S303, finally checking whether there is a negative weight cycle, if a negative weight cycle is detected, outputting a prompt and terminating the calculation; this method ensures the reliability of the navigation system when processing graphs with negative weight edges.

[0159] For example, the Floyd-Warshall algorithm can not only find the shortest path between all vertex pairs, but also detect whether there is a negative weight cycle in the electronic map, thereby ensuring the accuracy and reliability of the navigation system. The specific steps of applying the algorithm in the present invention are as follows:

[0160] (1) Initialization.

[0161] Construct a distance matrix "dist", where "dist[i][j]" represents the currently known shortest path length from vertex "i" to vertex "j". If there is a direct edge from vertex "i" to vertex "j", "dist[i][j]" is set to the weight of the edge; if there is no direct edge, it is set to infinity (indicating unreachable); the distance from itself to itself "dist[i][i]" is set to 0.

[0162] Iterative updates:

[0163] The algorithm checks each vertex "k" one by one and tries to update the shortest path length "dist[i][j]" of all vertex pairs "(i, j)":

[0164] Python

[0165] for k in range(num_vertices):

[0166] for i in range(num_vertices):

[0167] for j in range(num_vertices):

[0168] if dist[i][j]>dist[i][k]+ dist[k][j]:

[0169] dist[i][j]= dist[i][k]+ dist[k][j]

[0170] This process checks whether a shorter path from vertex "i" to vertex "j" can be obtained by using vertex "k" as a transit point. If so, "dist[i][j]" is updated to "dist[i][k] + dist[k][j]".

[0171] (2) Negative weight ring detection.

[0172] After all iterations are completed, if any vertex "i" has "dist[i][i]<0", it means that there is a negative weight cycle in the electronic map. Because the distance update of the self-loop reflects the change of the total weight of the path, if the shortest path distance from a vertex to itself becomes negative, it means that there is a cycle path with a negative total weight:

[0173] Python

[0174] for i in range(num_vertices):

[0175] if dist[i][i]<0:

[0176] print(“Graph contains a negative weight cycle”)

[0177] break

[0178] Through the above method, the Floyd-Warshall algorithm can not only calculate the shortest path between all vertex pairs, but also effectively detect negative weight cycles, which is crucial to the accuracy and reliability of the navigation system. The navigation system relies on correct path information. If there are negative weight cycles, the shortest path algorithm may produce incorrect results, causing the system's path planning to fail. By detecting and processing negative weight cycles, the system can more reliably provide correct navigation information.

[0179] The example code of m in the embodiment of the present invention is as follows:

[0180] Here is the Python implementation:

[0181] (1) Python

[0182] def floyd_warshall_with_negative_cycle_detection(graph):

[0183] num_vertices = len(graph)

[0184] dist = [[float('inf')] * num_vertices for _ in range(num_vertices)]

[0185] for i in range(num_vertices):

[0186] dist[i][i] = 0

[0187] for u in range(num_vertices):

[0188] for v, weight in graph[u]:

[0189] dist[u][v] = weight

[0190] for k in range(num_vertices):

[0191] for i in range(num_vertices):

[0192] for j in range(num_vertices):

[0193] if dist[i][j]>dist[i][k]+ dist[k][j]:

[0194] dist[i][j]= dist[i][k]+ dist[k][j]

[0195] (2) Detection of negative weight cycles:

[0196] for i in range(num_vertices):

[0197] if dist[i][i]<0:

[0198] print(“Graph contains a negative weight cycle”)

[0199] return None

[0200] return dist

[0201] (3) Example graph, graph[u] is a list containing all the edges (v, weight) starting from u

[0202] graph = {

[0203] 0: [(1, 3), (2, 1)],

[0204] 1: [(2, 7), (3, 5), (4, 1)],

[0205] 2: [(3, 2)],

[0206] 3: [(4, 7)],

[0207] 4: [(1, -10)]

[0208] (4) Negative weight edges, forming negative weight rings

[0209] }

[0210] (5) Run the Floyd-Warshall algorithm and detect negative weight cycles

[0211] dist = floyd_warshall_with_negative_cycle_detection(graph)

[0212] if dist:

[0213] print("All pairs shortest paths:", dist).

[0214] Embodiment 3, as Figure 3 As shown, the custom navigation system applied to the smart guide system provided by the embodiment of the present invention includes:

[0215] The guide point setting module 1 is used to set the guide points for the scenic spot in the smart guide background;

[0216] Point connection module 2, used for marking road points and connecting them;

[0217] The shortest path algorithm calling module 3 is used for the system to call the shortest path algorithm for navigation route guidance when the user uses the custom navigation function.

[0218] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0219] To further illustrate the effects of the embodiments of the present invention, the following experiment was conducted.

[0220] Experimental design

[0221] Experimental purpose: To evaluate the advantages of the customized navigation method provided by the present invention in the smart navigation system compared with traditional third-party navigation software, including navigation accuracy, user satisfaction and algorithm efficiency.

[0222] Experimental steps:

[0223] Experimental environment settings:

[0224] Choose a scenic spot: Qingdao Zhongshan Park Scenic Area, which has a complex road network and multiple scenic spots.

[0225] Deploy and configure the smart tour guide system: Deploy and configure the smart tour guide system in the selected scenic area, including setting tour guide points, marking road points and connection points.

[0226] Experimental group and control group settings:

[0227] Experimental group: The customized navigation method provided by the present invention is used for navigation, including manually setting navigation points and using the shortest path algorithm (such as Dijkstra algorithm) for path planning.

[0228] Control group: Use traditional third-party navigation software (such as Baidu Maps and Amap) for guided tours to evaluate their navigation accuracy and user experience in the same scenic spots.

[0229] Experimental data collection and analysis:

[0230] Navigation accuracy: Record the navigation starting point, end point and actual arrival path of each group, and compare the consistency between the calculated path and the actual path.

[0231] Experimental data:

[0232] The experimental group compared the path length calculated by the navigation system of the present invention with the actual walking path.

[0233] The control group used a third-party navigation software to calculate the path length and compared it with the actual walking path. See Table 1 for details.

[0234] Table 1 Comparison table of the experimental group of the navigation system of the present invention and the use of third-party navigation software:

[0235]

[0236] User satisfaction survey: A questionnaire survey was conducted on participants to assess their satisfaction with navigation accuracy, interface friendliness, and user experience.

[0237] Experimental data:

[0238] The ratings and feedback from users on the navigation systems of the experimental and control groups in the questionnaire are shown in Table 2.

[0239] Table 2 Comparison of users' ratings and feedback on the navigation systems of the experimental group and the control group:

[0240]

[0241] Analysis of experimental results: Through the above experimental design, the following conclusions can be drawn:

[0242] Navigation accuracy: The consistency between the path taken by the experimental group using the navigation system of the present invention and the actual path was higher than that of the third-party navigation software used by the control group, especially in complex road networks and scenic area maps.

[0243] User satisfaction: The experimental group was significantly more satisfied with navigation accuracy, user-friendly interface, and personalized experience than the control group. Users were more inclined to choose a navigation system that could provide precise paths and personalized settings.

[0244] In summary, through the analysis of experimental data and results, the advantages and application value of the present invention in the smart guide system can be further verified and demonstrated, providing strong scientific support for its promotion and application in actual scenarios.

[0245] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.

Claims

1. A custom navigation method applied to a smart guide system, characterized in that: The method includes: S1, set the guide points for the scenic spot in the smart guide background; S2, marking road points and connecting them; S3, when the user uses the custom navigation function, the smart navigation system calls the shortest path algorithm to provide navigation route guidance; In step S2, the road points are marked and connected, including: Draw a hand-drawn map of the actual road distribution of the scenic area based on the field survey, overlay the hand-drawn map on the electronic map engine for display, and manually click on the starting point, important points, and scenic spots of the road to mark the points; after the points are marked, the adjacent points are automatically connected to form road network information; In step S3, the system calls the shortest path algorithm to provide navigation route guidance, including: S301, initializing the distance matrix; S302, gradually updating the shortest path through three-layer loops; S303, check whether there is a negative weight ring, if a negative weight ring is detected, output a prompt and terminate the calculation; The custom navigation method applied to the smart navigation system further includes: Preprocessing stage: First, the graph is preprocessed using the Floyd-Warshall algorithm to calculate and store the shortest path lengths between all vertex pairs to form a distance matrix dist. In the distance matrix dist, dist[i][j] represents the shortest path length from vertex i to vertex j. At the same time, for large-scale networks, spatial optimization technology is used to optimize the traditional Floyd-Warshall algorithm, storing only necessary path information and reducing memory usage. Secondly, initialize the Dijkstra algorithm: when a single-source shortest path query is required, select a source point s; for each vertex v, set the initial distance d[v] to dist[s][v]; the initial distance of each vertex is already the shortest path length from the source point s to the vertex; Execute an optimized Dijkstra algorithm that introduces priority queue optimization, heuristic methods, parallel computing, and dynamic updates: use a priority queue to manage unprocessed vertices and sort them according to the initial distance d[v]; start from the source point s, update the distances of adjacent vertices, and repeat this process until all vertices are processed; The priority queue optimization includes: using a more efficient data structure - Fibonacci heap, optimizing the operation of the priority queue, and reducing the time complexity of the algorithm; The heuristic method includes: optimizing the Dijkstra algorithm in combination with the heuristic A* algorithm, guiding the search direction by estimating the distance to the target vertex, and reducing unnecessary path exploration; The parallel computing includes: utilizing the parallel computing capability of a multi-core processor to parallelize different parts of the Dijkstra algorithm to speed up the computing process; The dynamic update includes: for dynamically changing graphs, real-time traffic networks, if the edge weights in the graph change, updating the shortest path does not need to be recalculated from scratch.

2. The custom navigation method for a smart navigation system according to claim 1, characterized in that: In step S301, initializing the distance matrix includes: Construct a distance matrix "dist", where "dist[i][j]" represents the currently known shortest path length from vertex "i" to vertex "j". If there is a direct edge from vertex "i" to vertex "j", "dist[i][j]" is set to the weight of the edge; if there is no direct edge, it is set to infinity; the distance from itself to itself "dist[i][i]" is set to 0.

3. The user-defined navigation method for a smart navigation system according to claim 2, characterized in that: In step S302, the shortest path is gradually updated through a three-layer loop, including: By checking each vertex "k" one by one, update the shortest path length "dist[i][j]" of all vertex pairs "(i, j)"; Check whether there is a shorter path from vertex "i" to vertex "j" by using vertex "k" as a transit point; if so, update "dist[i][j]" to "dist[i][k] + dist[k][j]".

4. The user-defined navigation method for a smart navigation system according to claim 1, characterized in that: In step S303, it is checked whether there is a negative weight ring. If a negative weight ring is detected, a prompt is output and the calculation is terminated, including: After all iterations are completed, if any vertex "i" has "dist[i][i] < 0", it means that there is a negative weight cycle in the electronic map; if the shortest path distance from a vertex to itself becomes a negative value, there is a circular path whose total weight is negative.

5. A custom navigation system applied to a smart guide system, characterized in that: The system applies the custom navigation method applied to the smart guide system according to any one of claims 1 to 4, and the system includes: A guide point setting module (1) is used to set guide points for scenic spots in the smart guide background; A point connection module (2), used for marking road points and connecting them; The shortest path algorithm calling module (3) is used for the system to call the shortest path algorithm to provide navigation route guidance when the user uses the custom navigation function.

6. The custom navigation system for a smart guide system according to claim 5, characterized in that: The system is mounted on a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, the functions of the custom navigation system applied to the smart guide system described above are realized.

7. The user-defined navigation system for a smart navigation system according to claim 5, characterized in that: The system is mounted on a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the functions of the above-mentioned custom navigation system applied to the smart guide system can be realized.

8. The user-defined navigation system for a smart navigation system according to claim 5, characterized in that: The system is mounted on an information data processing terminal, and when the information data processing terminal is used to implement the functions of the custom navigation system applied to the smart guide system as described above, it provides a user input interface when executed on an electronic device.