Table of Contents
Fetching ...

Subgraph Isomorphism: Prolog vs. Conventional

Claire Y. Yin, Peter M. Kogge

TL;DR

The paper investigates subgraph isomorphism by encoding a complex pattern in Prolog and comparing two Prolog implementations against conventional, parallel-ready approaches. It demonstrates that logic programming can yield compact, expressive solutions that perform competitively on large graphs, even when deployed on single-core or single-node configurations. The study uses a sizable reference graph (approximately 38 million edges) and analyzes execution properties, inference counts, and timing across diverse hardware, identifying a notable performance spike around 2–4 million edges in the unified-rule approach. The findings support the viability of Prolog for complex graph-pattern tasks and point to future work on optimization strategies (e.g., asserta-based dynamic clause insertion) and parallel Prolog variants.

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.

Subgraph Isomorphism: Prolog vs. Conventional

TL;DR

The paper investigates subgraph isomorphism by encoding a complex pattern in Prolog and comparing two Prolog implementations against conventional, parallel-ready approaches. It demonstrates that logic programming can yield compact, expressive solutions that perform competitively on large graphs, even when deployed on single-core or single-node configurations. The study uses a sizable reference graph (approximately 38 million edges) and analyzes execution properties, inference counts, and timing across diverse hardware, identifying a notable performance spike around 2–4 million edges in the unified-rule approach. The findings support the viability of Prolog for complex graph-pattern tasks and point to future work on optimization strategies (e.g., asserta-based dynamic clause insertion) and parallel Prolog variants.

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.

Paper Structure

This paper contains 10 sections, 2 figures, 1 table.

Figures (2)

  • Figure 1: Subgraph Pattern.
  • Figure 2: Implementation Comparisons. Solid lines labelled with chip names are single core Prolog single pattern implementations. Short dotted lines are single core Prolog subpattern implementations. Long dashed lines are non-Prolog multi-core parallel implementations.