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.
翻译:子图同构利用小图作为模式,在大图中识别出具有匹配边的一组顶点。本文针对一个特定的、相对复杂的图模式,研究了一个用 Prolog 编写的逻辑程序,该图模式已有多种常规(包括并行)实现。目标在于理解逻辑编程与常规编程在复杂度上的差异。讨论内容包括将图模式转换为 Prolog 逻辑语句的过程,以及随着图规模增大所呈现的特性。分析表明,使用逻辑范式是处理复杂图问题的一种高效方法。