Two graphs $G$ and $H$ are homomorphism indistinguishable over a family of graphs $\mathcal{F}$ if for all graphs $F \in \mathcal{F}$ the number of homomorphisms from $F$ to $G$ is equal to the number of homomorphism from $F$ to $H$. Many natural equivalence relations comparing graphs such as (quantum) isomorphism, cospectrality, and logical equivalences can be characterised as homomorphism indistinguishability relations over various graph classes. For a fixed graph class $\mathcal{F}$, the decision problem HomInd($\mathcal{F}$) asks to determine whether two input graphs $G$ and $H$ are homomorphism indistinguishable over $\mathcal{F}$. The problem HomInd($\mathcal{F}$) is known to be decidable only for few graph classes $\mathcal{F}$. We show that HomInd($\mathcal{F}$) admits a randomised polynomial-time algorithm for every graph class $\mathcal{F}$ of bounded treewidth which is definable in counting monadic second-order logic CMSO2. Thereby, we give the first general algorithm for deciding homomorphism indistinguishability. This result extends to a version of HomInd where the graph class $\mathcal{F}$ is specified by a CMSO2-sentence and a bound $k$ on the treewidth, which are given as input. For fixed $k$, this problem is randomised fixed-parameter tractable. If $k$ is part of the input then it is coNP- and coW[1]-hard. Addressing a problem posed by Berkholz (2012), we show coNP-hardness by establishing that deciding indistinguishability under the $k$-dimensional Weisfeiler--Leman algorithm is coNP-hard when $k$ is part of the input.
翻译:两个图$G$和$H$在某个图族$\mathcal{F}$上是同态不可区分的,如果对所有$F \in \mathcal{F}$,从$F$到$G$的同态数量与从$F$到$H$的同态数量相等。许多比较图的自然等价关系,例如(量子)同构、谱等价和逻辑等价,都可以刻画为不同图类上的同态不可区分性关系。对于固定的图类$\mathcal{F}$,决策问题HomInd($\mathcal{F}$)要求判断两个输入图$G$和$H$在$\mathcal{F}$上是否同态不可区分。已知HomInd($\mathcal{F}$)仅对少数图类$\mathcal{F}$是可判定的。我们证明,对于每个具有有界树宽且可在计数单调二阶逻辑CMSO2中定义的图类$\mathcal{F}$,HomInd($\mathcal{F}$)存在随机多项式时间算法。由此,我们给出了判定同态不可区分性的首个通用算法。该结果扩展至HomInd的一个变体,其中图类$\mathcal{F}$由一条CMSO2语句和树宽上界$k$指定,并作为输入给出。对于固定$k$,该问题是随机固定参数可解的。若$k$属于输入的一部分,则它是coNP-和coW[1]-难的。针对Berkholz(2012)提出的一个问题,我们通过证明当$k$作为输入时,判定$k$维Weisfeiler--Leman算法下的不可区分性是coNP-难的,从而建立了其coNP-难性。