Counting homomorphisms of a constant sized pattern graph $H$ in an input graph $G$ is a fundamental computational problem. There is a rich history of studying the complexity of this problem, under various constraints on the input $G$ and the pattern $H$. Given the significance of this problem and the large sizes of modern inputs, we investigate when near-linear time algorithms are possible. We focus on the case when the input graph has bounded degeneracy, a commonly studied and practically relevant class for homomorphism counting. It is known from previous work that for certain classes of $H$, $H$-homomorphisms can be counted exactly in near-linear time in bounded degeneracy graphs. Can we precisely characterize the patterns $H$ for which near-linear time algorithms are possible?
We completely resolve this problem, discovering a clean dichotomy using fine-grained complexity. Let $m$ denote the number of edges in $G$. We prove the following: if the largest induced cycle in $H$ has length at most $5$, then there is an $O(m\log m)$ algorithm for counting $H$-homomorphisms in bounded degeneracy graphs. If the largest induced cycle in $H$ has length at least $6$, then (assuming standard fine-grained complexity conjectures) there is a constant $γ> 0$, such that there is no $o(m^{1+γ})$ time algorithm for counting $H$-homomorphisms.
In the counting Graph Homomorphism problem (#GraphHom) the question is: Given graphs G,H, find the number of homomorphisms from G to H. This problem is generally #P-complete, moreover, Cygan et al. proved that unless the ETH is false there is no algorithm that solves this problem in time O(|V(H)|^{o(|V(G)|)}. This, however, does not rule out the possibility that faster algorithms exist for restricted problems of this kind. Wahlstrom proved that #GraphHom can be solved in plain exponential time, that is, in time k^{|V(G)|+V(H)|}\poly(|V(H)|,|V(G)|) provided H has clique width k. We generalize t…
The goal of this work is to give precise bounds on the counting complexity of a family of generalized coloring problems (list homomorphisms) on bounded-treewidth graphs. Given graphs $G$, $H$, and lists $L(v)\subseteq V(H)$ for every $v\in V(G)$, a {\em list homomorphism} is a function $f:V(G)\to V(H)$ that preserves the edges (i.e., $uv\in E(G)$ implies $f(u)f(v)\in E(H)$) and respects the lists (i.e., $f(v)\in L(v))$. Standard techniques show that if $G$ is given with a tree decomposition of width $t$, then the number of list homomorphisms can be counted in time $|V(H)|^t\cdot n^{\mathcal{O}…
Counting homomorphisms from a graph $H$ into another graph $G$ is a fundamental problem of (parameterized) counting complexity theory. In this work, we study the case where \emph{both} graphs $H$ and $G$ stem from given classes of graphs: $H\in \mathcal{H}$ and $G\in \mathcal{G}$. By this, we combine the structurally restricted version of this problem, with the language-restricted version. Our main result is a construction based on Kneser graphs that associates every problem $\tt P$ in $\#\mathsf{W[1]}$ with two classes of graphs $\mathcal{H}$ and $\mathcal{G}$ such that the problem $\tt P$ is…
We introduce graph motif parameters, a class of graph parameters that depend only on the frequencies of constant-size induced subgraphs. Classical works by Lovász show that many interesting quantities have this form, including, for fixed graphs $H$, the number of $H$-copies (induced or not) in an input graph $G$, and the number of homomorphisms from $H$ to $G$. Using the framework of graph motif parameters, we obtain faster algorithms for counting subgraph copies of fixed graphs $H$ in host graphs $G$: For graphs $H$ on $k$ edges, we show how to count subgraph copies of $H$ in time $k^{O(k)}\c…
We revisit the well-studied problem of triangle count estimation in graph streams. Given a graph represented as a stream of $m$ edges, our aim is to compute a $(1\pm\varepsilon)$-approximation to the triangle count $T$, using a small space algorithm. For arbitrary order and a constant number of passes, the space complexity is known to be essentially $Θ(\min(m^{3/2}/T, m/\sqrt{T}))$ (McGregor et al., PODS 2016, Bera et al., STACS 2017). We give a (constant pass, arbitrary order) streaming algorithm that can circumvent this lower bound for \emph{low degeneracy graphs}. The degeneracy, $κ$, is a …
We consider the problem of counting all $k$-vertex subgraphs in an input graph, for any constant $k$. This problem (denoted sub-cnt$_k$) has been studied extensively in both theory and practice. In a classic result, Chiba and Nishizeki (SICOMP 85) gave linear time algorithms for clique and 4-cycle counting for bounded degeneracy graphs. This is a rich class of sparse graphs that contains, for example, all minor-free families and preferential attachment graphs. The techniques from this result have inspired a number of recent practical algorithms for sub-cnt$_k$. Towards a better understanding o…
Triangle counting is a fundamental technique in network analysis, that has received much attention in various input models. The vast majority of triangle counting algorithms are targeted to static graphs. Yet, many real-world graphs are directed and temporal, where edges come with timestamps. Temporal triangles yield much more information, since they account for both the graph topology and the timestamps. Temporal triangle counting has seen a few recent results, but there are varying definitions of temporal triangles. In all cases, temporal triangle patterns enforce constraints on the time int…
We study tensor networks as a model of arithmetic computation for evaluating multilinear maps. These capture any algorithm based on low border rank tensor decompositions, such as $O(n^{ω+ε})$ time matrix multiplication, and in addition many other algorithms such as $O(n \log n)$ time discrete Fourier transform and $O^*(2^n)$ time for computing the permanent of a matrix. However tensor networks sometimes yield faster algorithms than those that follow from low-rank decompositions. For instance the fastest known $O(n^{(ω+ε)t})$ time algorithms for counting $3t$-cliques can be implemented with ten…
We consider the problem of counting the number of copies of a fixed graph $H$ within an input graph $G$. This is one of the most well-studied algorithmic graph problems, with many theoretical and practical applications. We focus on solving this problem when the input $G$ has bounded degeneracy. This is a rich family of graphs, containing all graphs without a fixed minor (e.g. planar graphs), as well as graphs generated by various random processes (e.g. preferential attachment graphs). We say that $H$ is easy if there is a linear-time algorithm for counting the number of copies of $H$ in an inp…
Since counting subgraphs in general graphs is, by and large, a computationally demanding problem, it is natural to try and design fast algorithms for restricted families of graphs. One such family that has been extensively studied is that of graphs of bounded degeneracy (e.g., planar graphs). This line of work, which started in the early 80's, culminated in a recent work of Gishboliner et al., which highlighted the importance of the task of counting homomorphic copies of cycles (i.e., cyclic walks) in graphs of bounded degeneracy. Our main result in this paper is a surprisingly tight relation …
We study the problems of counting the homomorphisms, counting the copies, and counting the induced copies of a $k$-vertex graph $H$ in a $d$-degenerate $n$-vertex graph $G$. Our main result establishes exhaustive and explicit complexity classifications for counting subgraphs and induced subgraphs. We show that the (not necessarily induced) copies of $H$ in $G$ can be counted in time $f(k,d)\cdot n^{\max(\mathsf{imn}(H),1)}\cdot \log n$, where $f$ is some computable function and $\mathsf{imn}(H)$ is the size of the largest induced matching of $H$. Whenever the class of allowed patterns has unbo…
We show for a broad class of counting problems, correlation decay (strong spatial mixing) implies FPTAS on planar graphs. The framework for the counting problems considered by us is the Holant problems with arbitrary constant-size domain and symmetric constraint functions. We define a notion of regularity on the constraint functions, which covers a wide range of natural and important counting problems, including all multi-state spin systems, counting graph homomorphisms, counting weighted matchings or perfect matchings, the subgraphs world problem transformed from the ferromagnetic Ising model…
Given a pair of graphs $\textbf{A}$ and $\textbf{B}$, the problems of deciding whether there exists either a homomorphism or an isomorphism from $\textbf{A}$ to $\textbf{B}$ have received a lot of attention. While graph homomorphism is known to be NP-complete, the complexity of the graph isomorphism problem is not fully understood. A well-known combinatorial heuristic for graph isomorphism is the Weisfeiler-Leman test together with its higher order variants. On the other hand, both problems can be reformulated as integer programs and various LP methods can be applied to obtain high-quality rel…
Given a graph property $Φ$, we consider the problem $\mathtt{EdgeSub}(Φ)$, where the input is a pair of a graph $G$ and a positive integer $k$, and the task is to decide whether $G$ contains a $k$-edge subgraph that satisfies $Φ$. Specifically, we study the parameterized complexity of $\mathtt{EdgeSub}(Φ)$ and of its counting problem $\#\mathtt{EdgeSub}(Φ)$ with respect to both approximate and exact counting. We obtain a complete picture for minor-closed properties $Φ$: the decision problem $\mathtt{EdgeSub}(Φ)$ always admits an FPT algorithm and the counting problem $\#\mathtt{EdgeSub}(Φ)$ al…
In this paper we study a natural generalization of both {\sc $k$-Path} and {\sc $k$-Tree} problems, namely, the {\sc Subgraph Isomorphism} problem. In the {\sc Subgraph Isomorphism} problem we are given two graphs $F$ and $G$ on $k$ and $n$ vertices respectively as an input, and the question is whether there exists a subgraph of $G$ isomorphic to $F$. We show that if the treewidth of $F$ is at most $t$, then there is a randomized algorithm for the {\sc Subgraph Isomorphism} problem running in time $\cO^*(2^k n^{2t})$. To do so, we associate a new multivariate {Homomorphism polynomial} of degre…
Homomorphism Indistinguishability Beyond Graphs: Relational Weisfeiler--Leman and Hypertree Width
Hasso Plattner Institute, University of Potsdam(波茨坦大学哈索·普拉特纳研究所);Postdoc Network Brandenburg Institute of Logic and Computation, TU Wien(维也纳技术学院勃兰登堡逻辑与计算博士后网络);School of Electronic Engineering and Computer Science, Queen Mary University of London(伦敦玛丽女王大学电子工程与计算机科学学院)
The sparse regression problem, also known as best subset selection problem, can be cast as follows: Given a set $S$ of $n$ points in $\mathbb{R}^d$, a point $y\in \mathbb{R}^d$, and an integer $2 \leq k \leq d$, find an affine combination of at most $k$ points of $S$ that is nearest to $y$. We describe a $O(n^{k-1} \log^{d-k+2} n)$-time randomized $(1+\varepsilon)$-approximation algorithm for this problem with \(d\) and \(\varepsilon\) constant. This is the first algorithm for this problem running in time $o(n^k)$. Its running time is similar to the query time of a data structure recently prop…