Hierarchical Data Index for Efficient Graph Traversal
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traversing hierarchical data in databases can be a protracted operation that consumes excessive computational resources, particularly when executing graph algorithms like shortest path or page rank algorithms, due to the complexity of navigating the graph structure.
Innovation Solution
A system generates an index for traversing the graph based on a source table, enabling depth-first traversal starting from a root node and allowing detection of cycles, using data structures like an inner node map, root node list, next sibling vector, and node identifier vector to efficiently identify child and sibling nodes and prevent infinite loops.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If graph algorithms are executed to traverse hierarchical data, then accurate path finding and analysis are achieved, but computational resources are excessively consumed and operation time is prolonged
Solution Approach 1:
The patent applies preliminary action by pre-computing and storing traversal paths in a materialized path column during data insertion. Each node stores its complete path from the root in a standardized format (e.g., '/1/3/7/'), enabling O(1) time complexity for path queries without executing graph algorithms at query time.
Solution Approach 2:
The patent creates a copy of the hierarchical structure information by storing the materialized path as a string representation of the node's position in the hierarchy. This copied path information can be directly compared and queried without traversing the actual graph structure, significantly reducing computational overhead.
2Measurement precision
If graph algorithms are executed to traverse hierarchical data, then accurate path finding and analysis are achieved, but computational resources are excessively consumed
Solution Approach 1:
The patent applies preliminary action by pre-computing and storing traversal paths in a materialized path column during data insertion. Each node stores its complete path from the root in a standardized format (e.g., '/1/3/7/'), enabling O(1) time complexity for path queries without executing graph algorithms at query time.
Solution Approach 2:
The patent creates a copy of the hierarchical structure information by storing the materialized path as a string representation of the node's position in the hierarchy. This copied path information can be directly compared and queried without traversing the actual graph structure, significantly reducing computational overhead.
3Reliability
If traditional graph traversal methods are used, then comprehensive path analysis is achieved, but the operation becomes protracted and inefficient
Solution Approach 1:
The patent applies preliminary action by pre-computing and storing traversal paths in a materialized path column during data insertion. Each node stores its complete path from the root in a standardized format (e.g., '/1/3/7/'), enabling O(1) time complexity for path queries without executing graph algorithms at query time.
Solution Approach 2:
The patent creates a copy of the hierarchical structure information by storing the materialized path as a string representation of the node's position in the hierarchy. This copied path information can be directly compared and queried without traversing the actual graph structure, significantly reducing computational overhead.
Data Source
AI summary
A method for traversing hierarchical data is provided. The method may include generating, based on a source table stored in a database, an index for traversing a graph corresponding to the source table. The source table may identify a parent node for each node in the graph. The generating of the index may include iterating over the source table to generate an inner node map. The inner node map may include at least one mapping identifying one or more children nodes descending from an inner node in the graph. The graph may be traversed based at least on the index. The index may enable the graph to be traversed depth first starting from a root node of the graph and continuing to a first child node descending from the root node of the graph. Related systems and articles of manufacture, including computer program products, are also provided.


