English

Largest common subgraph of two forests

Data Structures and Algorithms 2024-03-07 v1 Discrete Mathematics Combinatorics

Abstract

A common subgraph of two graphs G1G_1 and G2G_2 is a graph that is isomorphic to subgraphs of G1G_1 and G2G_2. In the largest common subgraph problem the task is to determine a common subgraph for two given graphs G1G_1 and G2G_2 that is of maximum possible size lcs(G1,G2){\rm lcs}(G_1,G_2). This natural problem generalizes the well-studied graph isomorphism problem, has many applications, and remains NP-hard even restricted to unions of paths. We present a simple 44-approximation algorithm for forests, and, for every fixed ϵ(0,1)\epsilon\in (0,1), we show that, for two given forests F1F_1 and F2F_2 of order at most nn, one can determine in polynomial time a common subgraph FF of F1F_1 and F2F_2 with at least lcs(F1,F2)ϵn{\rm lcs}(F_1,F_2)-\epsilon n edges. Restricted to instances with lcs(F1,F2)cn{\rm lcs}(F_1,F_2)\geq cn for some fixed positive cc, this yields a polynomial time approximation scheme. Our approach relies on the approximation of the given forests by structurally simpler forests that are composed of copies of only O(log(n))O(\log (n)) different starlike rooted trees and iterative quantizations of the options for the solutions.

Keywords

Cite

@article{arxiv.2403.03696,
  title  = {Largest common subgraph of two forests},
  author = {Dieter Rautenbach and Florian Werner},
  journal= {arXiv preprint arXiv:2403.03696},
  year   = {2024}
}
R2 v1 2026-06-28T15:10:57.148Z