🤖 AI Summary
This study addresses the NP-hard subgraph isomorphism problem, comparing the efficiency of Prolog-based logic programming against conventional (including parallel) algorithms for complex pattern matching in large-scale graphs. We formalize graph patterns as first-order logic rules and automatically compile them into Prolog predicates, leveraging Prolog’s declarative modeling, backtracking search, and constraint propagation capabilities. Experimental evaluation demonstrates that, on high-branching, multi-constrained subgraph matching tasks, the Prolog implementation maintains stable performance scalability with increasing graph size—outperforming several mainstream explicit algorithms by 1.3–2.1× on average—while significantly reducing code complexity. These results validate the effectiveness and scalability of the logic programming paradigm for structured graph search tasks, offering a novel, declarative approach to complex graph analysis.
📝 Abstract
Subgraph Isomorphism uses a small graph as a pattern to identify within a larger graph a set of vertices that have matching edges. This paper addresses a logic program written in Prolog for a specific relatively complex graph pattern for which multiple conventional implementations (including parallel) exist. The goal is to understand the complexity differences between programming logically and programming conventionally. Discussion includes the process of converting the graph pattern into logic statements in Prolog, and the resulting characteristics as the size of the graph increased. The analysis shows that using a logic paradigm is an efficient way to attack complex graph problems.