An Exact Algorithm for Meta-Path Counting in Heterogeneous Graphs
摘要
The meta-path counting problem is a fundamental task in graph data analysis, widely applied in fields such as network science, database queries, and cybersecurity. This paper introduces an exact algorithm for meta-path counting in heterogeneous graphs under multi-role and feature constraints, leveraging depth-first search (DFS). The algorithm addresses challenges in meta-path counting by incorporating implicit edges to support flexible role-switching of multi-role nodes and dynamically verifying constraints on completion time and completion probability to ensure accuracy. Several pruning strategies, including pattern pruning, time pruning, and probability pruning, are proposed to reduce computational complexity. Experimental results demonstrate that the proposed algorithm significantly reduces runtime while maintaining accuracy, particularly in large-scale heterogeneous graphs. These findings underscore the algorithm’s effectiveness and scalability in handling the exponentially increasing complexity of meta-path enumeration as graph size grows.