==== TABLE OF CONTENTS ==== The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//bibliography.tex The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//paper.tex The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/01-introduction.tex The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/02-wl.tex The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/03-encoding.tex The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/04-offsets.tex The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/05-projection.tex The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/06-computation.tex The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/07-identification.tex =========================== ==== BEGIN The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//bibliography.tex ==== \begin{thebibliography}{99} \bibitem{AKRV2017} V. Arvind, Johannes K\"obler, Gaurav Rattan, and Oleg Verbitsky. \newblock Graph Isomorphism, Color Refinement, and Compactness. \newblock \emph{Computational Complexity}, 26(3):627--685, 2017. \newblock \href{https://doi.org/10.1007/s00037-016-0147-6}{doi:10.1007/s00037-016-0147-6}. \newblock Consulted full version: arXiv:1502.01255v3, May 4, 2015, \url{https://arxiv.org/abs/1502.01255v3}. \bibitem{CFI1992} Jin-Yi Cai, Martin F\"urer, and Neil Immerman. \newblock An optimal lower bound on the number of variables for graph identification. \newblock \emph{Combinatorica}, 12(4):389--410, 1992. \newblock \href{https://doi.org/10.1007/BF01305232}{doi:10.1007/BF01305232}. \bibitem{Grohe1999} Martin Grohe. \newblock Equivalence in Finite-Variable Logics is Complete for Polynomial Time. \newblock \emph{Combinatorica}, 19(4):507--532, 1999. \newblock \href{https://doi.org/10.1007/s004939970004}{doi:10.1007/s004939970004}. \bibitem{GLNS2025} Martin Grohe, Moritz Lichter, Daniel Neuen, and Pascal Schweitzer. \newblock Compressing CFI Graphs and Lower Bounds for the Weisfeiler--Leman Refinements. \newblock \emph{Journal of the ACM}, 72(3), Article 21, 21:1--21:27, 2025. \newblock \href{https://doi.org/10.1145/3727978}{doi:10.1145/3727978}. \newblock Consulted full version: arXiv:2308.11970v2, January 27, 2025, \url{https://arxiv.org/abs/2308.11970v2}. \bibitem{KN2019} Sandra Kiefer and Daniel Neuen. \newblock The Power of the Weisfeiler--Leman Algorithm to Decompose Graphs. \newblock In \emph{44th International Symposium on Mathematical Foundations of Computer Science (MFCS 2019)}, volume 138 of \emph{Leibniz International Proceedings in Informatics}, pages 45:1--45:15. Schloss Dagstuhl -- Leibniz-Zentrum f\"ur Informatik, 2019. \newblock \href{https://doi.org/10.4230/LIPIcs.MFCS.2019.45}{doi:10.4230/LIPIcs.MFCS.2019.45}. \bibitem{LRS2025} Moritz Lichter, Simon Ra\ss mann, and Pascal Schweitzer. \newblock Computational Complexity of the Weisfeiler--Leman Dimension. \newblock In \emph{33rd EACSL Annual Conference on Computer Science Logic (CSL 2025)}, volume 326 of \emph{Leibniz International Proceedings in Informatics}, pages 13:1--13:22. Schloss Dagstuhl -- Leibniz-Zentrum f\"ur Informatik, 2025. \newblock \href{https://doi.org/10.4230/LIPIcs.CSL.2025.13}{doi:10.4230/LIPIcs.CSL.2025.13}. \bibitem{LRS2024full} Moritz Lichter, Simon Ra\ss mann, and Pascal Schweitzer. \newblock \emph{Computational Complexity of the Weisfeiler--Leman Dimension}. \newblock Full version, arXiv:2402.11531v2, revised November 15, 2024. \newblock \url{https://arxiv.org/abs/2402.11531v2}. \newblock Journal version: \emph{ACM Transactions on Computational Logic}, 27(2), 2026, \href{https://doi.org/10.1145/3798282}{doi:10.1145/3798282}. \bibitem{Mackworth1977} Alan K. Mackworth. \newblock Consistency in Networks of Relations. \newblock \emph{Artificial Intelligence}, 8(1):99--118, 1977. \newblock \href{https://doi.org/10.1016/0004-3702(77)90007-8}{doi:10.1016/0004-3702(77)90007-8}. \bibitem{VariableWL} OpenAI. \newblock Variable-dimension Weisfeiler--Leman equivalence on general and subcubic graphs. \newblock OpenAI Math Release preprint \href{https://github.com/openai/math/blob/main/preprints/Variable-dimension-Weisfeiler-Leman-equivalence-on-general-and-subcubic-graphs-September-25-2026/paper.pdf}{OAI:Variable-dimension-Weisfeiler-Leman-equivalence-on-general-and-subcubic-graphs-September-25-2026}, 2026. \bibitem{Seppelt2024} Tim Seppelt. \newblock An Algorithmic Meta Theorem for Homomorphism Indistinguishability. \newblock In \emph{49th International Symposium on Mathematical Foundations of Computer Science (MFCS 2024)}, volume 306 of \emph{Leibniz International Proceedings in Informatics}, pages 82:1--82:19. Schloss Dagstuhl -- Leibniz-Zentrum f\"ur Informatik, 2024. \newblock \href{https://doi.org/10.4230/LIPIcs.MFCS.2024.82}{doi:10.4230/LIPIcs.MFCS.2024.82}. \bibitem{WL1968} Boris Weisfeiler and Andrei Leman. \newblock The Reduction of a Graph to Canonical Form and the Algebra Which Appears Therein. \newblock \emph{Nauchno-Technicheskaya Informatsiya, Series 2}, 9:12--16, 1968. \newblock English translation by Grigory Ryabov: \url{https://www.iti.zcu.cz/wl2018/pdf/wl_paper_translation.pdf}. \end{thebibliography} ==== END The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//bibliography.tex ==== ==== BEGIN The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//paper.tex ==== \pdfminorversion=7 \PassOptionsToPackage{hyphens}{url} \documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amssymb,amsthm,mathtools} \usepackage{microtype} \usepackage{enumitem} \usepackage{tikz} \usetikzlibrary{arrows.meta,positioning,calc} \usepackage[hidelinks]{hyperref} \usepackage{bookmark} \newcommand{\F}{\mathbb F_2} \newcommand{\WLdim}{\operatorname{WLdim}} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \numberwithin{equation}{section} \setlist{itemsep=3pt,topsep=5pt} \setlength{\emergencystretch}{2em} \title{The complexity of identifying a graph\newline by Weisfeiler--Leman refinement} \author{OpenAI} \date{September 25, 2026} \hypersetup{pdftitle={The complexity of identifying a graph by Weisfeiler-Leman refinement},pdfauthor={OpenAI}} \begin{document} \maketitle \begin{abstract} We prove that deciding whether Weisfeiler--Leman refinement of an input dimension identifies a given graph is EXPTIME-complete. The input is a nonempty finite simple uncolored graph in adjacency-matrix form and a positive binary-encoded dimension. Identification quantifies over every comparison graph. \end{abstract} \setcounter{tocdepth}{1} \tableofcontents \clearpage \input{sections/01-introduction} \input{sections/02-wl} \input{sections/03-encoding} \input{sections/04-offsets} \input{sections/05-projection} \input{sections/06-computation} \input{sections/07-identification} \begingroup \raggedright \input{bibliography} \endgroup \end{document} ==== END The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//paper.tex ==== ==== BEGIN The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/01-introduction.tex ==== \section{Introduction} \label{sec:introduction} The Weisfeiler--Leman algorithm refines the colors of tuples of vertices to test graph isomorphism. A graph's Weisfeiler--Leman dimension measures how much tuple information is needed to identify a particular graph among all graphs. This differs from testing whether a specified pair of graphs survives refinement: identification quantifies over every possible comparison graph. We determine the complexity of identification when the dimension is part of the input. Increasing the dimension exposes more information, but also increases the number of tuples on which refinement operates. This makes the least sufficient dimension a natural measure of the strength needed on an individual graph. The decision problem studied here asks for that threshold, rather than for the number of refinement rounds or the cost of one particular implementation of refinement. All graphs in this paper are finite, simple, undirected, and uncolored. For $k\ge2$ we use the joint-update convention: a $k$-tuple starts with its equality and adjacency type, and each refinement adjoins the multiset, over vertices $z$, of the vectors of colors obtained by replacing each coordinate by that same $z$. At $k=1$ we use ordinary neighbor color refinement. Colors are shared between the graphs being compared. Write $G\equiv_k H$ when their tuple-color histograms agree at every round. We say that $k$-WL \emph{identifies} $G$ if $G\equiv_k H$ implies $G\cong H$ for every graph $H$. The \emph{Weisfeiler--Leman dimension} $\WLdim(G)$ is the least positive integer $k$ that identifies $G$. Section~\ref{sec:wl} gives the formal refinement rule and proves the monotonicity needed for this definition. Our decision problem has as input a nonempty graph $G$, given by its binary adjacency matrix, and a positive integer $k$, given in binary. It asks whether $\WLdim(G)\le k$. Malformed inputs are rejected. \begin{theorem} \label{thm:main} The following problem is EXPTIME-complete under deterministic polynomial-time many-one reductions: given a nonempty finite simple undirected uncolored graph $G$ by its adjacency matrix and a positive integer $k$ in binary, decide whether $\WLdim(G)\le k$. Here dimension one uses ordinary neighbor color refinement, and dimensions at least two use the joint-update rule described above. \end{theorem} The problem remains EXPTIME-complete when $k$ is encoded in unary (Corollary~\ref{cor:unary}). Thus the hardness does not require a dimension whose numerical value is exponentially larger than its encoding. \subsection{Context and contribution} The refinement method originates in Weisfeiler and Leman's work on graph canonization and its associated algebra~\cite{WL1968}. The relation between Weisfeiler--Leman refinement, counting logic, and pebble games is a central tool in finite model theory and graph isomorphism; see Cai, F\"urer, and Immerman~\cite{CFI1992} and the game formulation in Kiefer and Neuen~\cite{KN2019}. Arvind, K\"obler, Rattan, and Verbitsky proved P-hardness for dimension-one identification~\cite{AKRV2017}. Lichter, Ra\ss mann, and Schweitzer extended fixed-dimension P-hardness to every $k\ge2$ and proved NP-hardness when the dimension is part of the input, including simple uncolored graphs \cite[Theorems~3--4]{LRS2025}. Those results distinguish identification from equivalence of a given pair. Variable-dimension pair equivalence was shown coNP-hard by Seppelt~\cite[Theorem~5]{Seppelt2024} and independently by Lichter, Ra\ss mann, and Schweitzer~\cite[Theorem~19]{LRS2025}. The identification arguments of Lichter, Ra\ss mann, and Schweitzer already analyze every equivalent mate of their colored CFI graphs, using local recognition of gadget incidences \cite[Lemma~8 and Claim~9]{LRS2024full}. The issue here is therefore not the all-mates quantifier by itself. Our incidence encoding admits an entire family of shifted constraints, and we must prove that every shift arising from an equivalent mate lifts to one global isomorphism on an accepting instance. This requires more than recognizing the allowed constraint pattern one incidence piece at a time. At the level of graph encodings, local parity constraints and a global twist obstruction are central features of the Cai--F\"urer--Immerman construction~\cite{CFI1992}. Compressed CFI graphs provide a related method for retaining game obstructions in smaller representations \cite{GLNS2025}. That work proves lower bounds on refinement rounds; such bounds do not by themselves determine the complexity of deciding identification. Our representation and its game properties are proved directly below. The companion paper \emph{Variable-dimension Weisfeiler--Leman equivalence on general and subcubic graphs}~\cite{VariableWL} develops a compressed computation construction for pair equivalence. We use its short tables on binary coordinates, comparisons of images of scalar linear forms, and potential-based extension of local assignments. The identification-specific arguments are proved below; in particular, pair-equivalence hardness is not taken to imply identification hardness. The graph representation is changed so that the structure of an arbitrary equivalent graph can be recovered from bounded-size incidence tests. Theorem~\ref{thm:main} completes the complexity classification of the input-dimension identification problem. The additional mechanism is a local-to-global reconstruction for binary linear constraints. Small incidence pieces determine the possible shifts in any equivalent graph. We distinguish local choices that suffice for a winning game strategy from compatible choices that define one graph isomorphism. Both conditions are established for an abstract family of comparisons before the comparisons are chosen to encode a computation. \subsection{Proof outline} For a fixed exponential-time machine and input word, the reduction constructs a graph $G(0)$ and a polynomially bounded dimension $r$. The graph records binary linear constraints. Each variable bit has a pair of vertices, and each small constraint has vertices for its legal valuations, joined to the bit values they specify. Distinct colors for these classes are subsequently encoded by private leaves. The notation $G(\beta)$ denotes the same construction with constraint right-hand sides changed from zero to a list of bits $\beta$. The representation has three properties. First, every graph equivalent to $G(0)$ at dimension $r$ is isomorphic to some $G(\beta)$, and such a mate is isomorphic to $G(0)$ exactly when its shifts admit a global solution. Second, game equivalence yields nonempty sets of vector values indexed by binary addresses $a\in\{0,1\}^r$. Each comparison equates just one scalar image of these sets, up to the prescribed shift. For a particular class of shifts, these image conditions also suffice for game equivalence. Third, a global solution exists exactly when the comparison equations have vector-valued solutions of the form \[ h(a)=\sum_{i=1}^r h_i(a_i,a_{i+1}), \qquad a_{r+1}=a_1, \] where each $h_i$ is a function of the displayed two binary coordinates. The adjacent-coordinate representation is what keeps the graph small despite its exponentially many addresses. The addressed comparisons encode a monotone circuit computing the machine's tableau. A private two-dimensional buffer, compared through its coordinate forms and their sum, makes a singleton source image force a singleton destination image, while still permitting full source images. If the machine accepts, a broadcast family forces all relevant vector sets to be singletons. Buffered identity self-connections then compare the same coordinate with both buffer entries, up to their shifts. Adding the entries cancels the coordinate's two occurrences and expresses the destination value as a sum of three shifts. This forces the displayed adjacent-coordinate form. Every equivalent mate is therefore isomorphic. If the machine does not accept, two self-connections admit a shift with no global solution but with the required nonempty image sets, producing a nonisomorphic equivalent mate. Section~\ref{sec:wl} establishes the game convention and the upper bound. Section~\ref{sec:encoding} gives the incidence construction and recovers all possible equivalent mates. Section~\ref{sec:offsets} proves the image conditions and global lifting criterion. Section~\ref{sec:projection} proves the local-offset extension theorem underlying the converse game strategy. Sections~\ref{sec:computation} and~\ref{sec:identification} construct the computation and complete the reduction, with explicit polynomial size bounds. ==== END The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/01-introduction.tex ==== ==== BEGIN The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/02-wl.tex ==== \section{Weisfeiler--Leman refinement and the bijective game} \label{sec:wl} We first fix the refinement convention and its game characterization. The game will let us query the constraints encoded in the graphs of the next section. It also gives the monotonicity needed to interpret a dimension bound as identification by a particular refinement algorithm. All graphs in this paper are finite, simple, undirected, and uncolored unless colors are explicitly introduced during a construction. For a graph $G$, an integer $k\ge 2$, and a tuple $\bar v=(v_1,\ldots,v_k)\in V(G)^k$, let $\bar v[i\leftarrow z]$ denote the tuple obtained by replacing its $i$th entry by $z$. The initial color $\chi_0^G(\bar v)$ records every equality $v_i=v_j$ and adjacency $v_iv_j\in E(G)$. Define subsequent colors by \begin{equation} \label{eq:wl-update} \chi_{s+1}^G(\bar v)= \left(\chi_s^G(\bar v), \left\{\!\left\{ \bigl(\chi_s^G(\bar v[1\leftarrow z]),\ldots, \chi_s^G(\bar v[k\leftarrow z])\bigr) :z\in V(G) \right\}\!\right\}\right). \end{equation} Thus a single multiset records the \emph{joint vector} of replacement colors. It is not a list of separately counted coordinate multisets. For $k=1$, we instead use ordinary color refinement: all vertices have one initial color, and \[ \chi_{s+1}^G(v)= \left(\chi_s^G(v), \left\{\!\left\{\chi_s^G(w):w\in N_G(v)\right\}\!\right\}\right). \] The colors are named consistently between graphs. Write $G\equiv_k H$ if, at every round, the multisets of colors of their $k$-tuples agree. We say that $k$-WL \emph{identifies} $G$ if $G\equiv_k H$ implies $G\cong H$ for every graph $H$. The Weisfeiler--Leman dimension of $G$ is the least positive $k$ that identifies it. \subsection{The game characterization} For graphs of equal positive order, the \emph{bijective game with $K$ pair slots} is played as follows. A position consists of at most $K$ pairs of marked vertices, one vertex from each graph in each occupied slot. Repeated vertices are allowed. Spoiler may discard pairs. To fill a vacant slot, Spoiler first designates that slot; Duplicator then announces a bijection $f:V(G)\to V(H)$; finally, Spoiler chooses $v\in V(G)$ and places the pair $(v,f(v))$ in the designated slot. Duplicator wins if the occupied pairs always define a partial isomorphism, preserving equality as well as adjacency. A winning strategy must work against every sequence of Spoiler's choices. This is a standard characterization of the joint-vector convention; see, for example, \cite{KN2019}. We include the argument to fix both the parameter shift and the treatment of vacant slots. \begin{lemma} \label{lem:wl-game} Let $G,H$ have equal positive order, and let $k\ge 2$. Then $G\equiv_k H$ if and only if Duplicator has a winning strategy from the empty position in the bijective game with $k+1$ pair slots. Moreover, a winning strategy with at least two pair slots implies $G\equiv_1 H$. \end{lemma} \begin{proof} Apply refinement with common color names to the disjoint union of the two \emph{tuple tables} $V(G)^k$ and $V(H)^k$, taking replacements within the corresponding graph. Since each update retains the old color, these common partitions refine. If one update causes no splitting, it only renames the existing classes. All subsequent updates then have the same property, so the common partition has stabilized. We use two consequences of the update rule. First, if two tuples have equal colors at a round, applying the same coordinate permutation to both preserves color equality. This follows by induction from the initial types: a common permutation permutes the components of a replacement vector and applies the corresponding coordinate permutation to each replacement tuple. Second, for two tuples in the same stable class, stability provides a vertex bijection matching their entire vectors of stable replacement colors. Indeed, the two multisets of such vectors agree, so we may match the vertices within each vector class. Suppose $G\equiv_k H$. Choose a pair of equally colored stable $k$-tuples; one exists because the color histograms agree and the graphs are nonempty. Use the preceding bijection to append one vertex to each tuple. The resulting pair of $(k+1)$-tuples has the following property: deleting any common slot leaves equally colored stable $k$-tuples. Deleting the appended slot gives the original pair; every other deletion gives a matched replacement pair, up to a common coordinate permutation. Duplicator maintains a pair of fully specified $(k+1)$-tuples with this property, treating entries in vacant slots as virtual. To fill slot $j$, apply the stable-class bijection to the projection deleting slot $j$. Whichever vertex Spoiler chooses, the projection deleting $j$ remains unchanged, while every other deletion projection becomes a matched replacement pair, up to a common permutation. Thus the property persists. Discarding a pair only makes that entry virtual. Every two slots occur together in some deletion projection because $k\ge 2$. The initial types in these projections therefore preserve all equalities and adjacencies among occupied slots, proving that this strategy wins. Conversely, fix a winning strategy with $k+1$ slots. We prove by induction on $s$ that, at every history ending with exactly $k$ occupied pairs, the two tuples have equal round-$s$ colors in any common ordering of those slots. The case $s=0$ is partial isomorphism. For the induction step, fill the spare slot. The strategy announces a bijection before Spoiler chooses the new vertex. After any such choice, Spoiler may discard any one of the old slots. The induction hypothesis at these resulting histories matches all $k$ replacement colors for that same vertex bijection. Hence the entire joint vector is matched, and Equation~\eqref{eq:wl-update} gives the next-round equality. Fill $k$ slots from empty in a fixed order. This procedure induces a bijection from $V(G)^k$ to $V(H)^k$, even when the strategy depends on the history. To recover the preimage of a target tuple, invert the first announced vertex bijection, thereby recover the first source choice and history, and continue successively. Since each resulting tuple pair has equal colors at every round, the color histograms agree. For the final assertion, use induction on the ordinary color-refinement round at all one-pair histories. From such a history fill another slot. The announced bijection preserves adjacency to the retained pair for every possible choice. After discarding the old pair, the induction hypothesis matches the previous-round colors of the new vertices. Thus the same bijection matches the neighbor-color multisets of the retained vertices. Their next colors agree. The first announced bijection, from the empty history, then proves equality of all vertex-color histograms. \end{proof} \begin{lemma} \label{lem:monotonicity} For positive integers $j\le k$, the relation $G\equiv_k H$ implies $G\equiv_j H$. Consequently, a graph has Weisfeiler--Leman dimension at most $k$ if and only if $k$-WL identifies it. \end{lemma} \begin{proof} Equal histograms imply equal graph orders, since their total sizes are $|V(G)|^k$ and $|V(H)|^k$. Empty graphs cause no difficulty, so assume that this common order is positive. A winning strategy can be restricted to a smaller number of slots. For $k\ge j\ge 2$, apply Lemma~\ref{lem:wl-game} in both directions. For $k\ge 2$ and $j=1$, use its final assertion; the remaining case is immediate. If some $j\le k$ identifies $G$, then $k$-equivalence to $G$ implies $j$-equivalence and hence isomorphism. The converse follows from the definition of dimension. \end{proof} The next elementary observation lets us recover vertex colors that will be encoded by degrees. \begin{lemma} \label{lem:degree} In every history following a winning strategy with at least two pair slots, matched vertices have equal degrees. Every vertex bijection announced by that strategy therefore preserves degrees for all its possible choices. \end{lemma} \begin{proof} Retain only a suspect pair $(v,w)$ and fill another slot. To preserve adjacency for every vertex choice, the announced bijection must map $N_G(v)$ onto $N_H(w)$, so their cardinalities agree. This applies to every candidate pair created by any announced bijection, proving the second assertion as well. \end{proof} \subsection{An exponential-time decision procedure} \begin{proposition} \label{prop:upper} For a nonempty graph given by its binary adjacency matrix and a positive integer $k$ in binary, deciding whether its Weisfeiler--Leman dimension is at most $k$ belongs to EXPTIME. \end{proposition} \begin{proof} Malformed encodings, including matrices outside the specified graph domain and nonpositive parameters, can be rejected in polynomial time. Let $n\ge 1$ be the order of a valid input graph $G$. First compare the binary parameter with $n$. If $k\ge n$, accept. For $n\ge 2$, a $k$-tuple listing all vertices, with repetitions if needed, has an initial equality and adjacency type that determines an isomorphism to any matching tuple in a graph of order $n$. Different orders are distinguished by histogram sizes. Order one is immediate under ordinary color refinement. This comparison is performed before constructing a tuple table, regardless of how large the integer encoded by $k$ may be. It remains to consider $1\le k=stealth, every node/.style={font=\small}] \node (source) at (0,0) {\(P,a:\ o\)}; \node (one) at (2.8,.6) {\(z_1\)}; \node (two) at (2.8,-.6) {\(z_2\)}; \node at (2.8,1.15) {\(B_l,a\)}; \draw[rounded corners=2pt] (2.3,-.95) rectangle (3.3,.95); \node (sum) at (4.8,0) {\(z_1+z_2\)}; \node (target) at (7.7,0) {\(R,\sigma_l(a):\ s\)}; \draw[->] (source) -- node[above left] {\(l1\)} (one); \draw[->] (source) -- node[below left] {\(l2\)} (two); \draw[densely dashed] (one) -- (sum); \draw[densely dashed] (two) -- (sum); \draw[->] (sum) -- node[above] {\(l3\)} (target); \end{tikzpicture} \caption{A buffered connection. Solid arrows represent the three comparisons in \eqref{eq:buffer}; dashed lines indicate addition of the two coordinates, not further comparisons. Image consistency compares sets of form values, with their shifts. It does not choose a common pointwise value for all comparisons.} \label{fig:buffer} \end{figure} Apply the layout and graph construction to exactly the seed comparisons and the triples \eqref{eq:buffer}, and output \begin{equation} (G(0),r), \label{eq:reduction-output} \end{equation} with \(r\) as in \eqref{eq:computation-parameters}. All real-type dimensions are one or two, all domains are nonempty products, and all address maps are coordinate injections. Thus the hypotheses of the graph construction hold. \subsection{Acceptance: every equivalent mate is isomorphic} \begin{proposition} \label{prop:acceptance} If \(M\) accepts \(w\), then every finite simple uncolored graph \(H\equiv_r G(0)\) is isomorphic to \(G(0)\). \end{proposition} \begin{proof} By Proposition~\ref{prop:mate}, write \(H\cong G(\beta)\) for some square bits \(\beta\). Transporting equivalence through this isomorphism, apply Proposition~\ref{prop:image-consistency} to obtain nonempty sets \(Q_{P,a}\) satisfying \eqref{eq:image-consistency}. No restriction to the special twists of Theorem~\ref{thm:special-twist} is made here: all wire sums \(\Delta_e(a)\) may depend on the address. First consider a buffered connection \(l\) at \(a\in D_l\). If the source image \(o(Q_{P,a})\) is a singleton, the first two comparisons force both coordinate images of \(Q_{B_l,a}\) to be singletons, possibly translated by different shifts. As this set is nonempty, it contains exactly one vector. Its sum image is therefore a singleton, and the third comparison makes \(s(Q_{R,\sigma_l(a)})\) a singleton. Thus a buffered connection propagates singletonness from its source form to its destination form. We do not need these singletons to have value zero. At each seed, comparison with the dummy's zero form gives a singleton scalar image. Induction in the acyclic circuit order now shows that every true gate has a singleton output image. For a true scalar, use its seed comparison or one true incoming source. For a true AND gate, each port receives a true source, so both coordinate images become singletons and their sum is a singleton as well. By Proposition~\ref{prop:computation}, at least one test is true. Its added connection forces \(A\) to have a singleton image at that address. Flipping individual coordinates connects all addresses in \(\{0,1\}^r\), so the broadcast connections propagate this property to every address of \(A\). The connections from \(A\) to every gate coordinate then imply that all primary sets are singletons. Write \[ Q_{P,a}=\{h_P(a)\} \qquad(P\text{ primary},\ a\in\{0,1\}^r). \] To use Proposition~\ref{prop:global-offsets}, it remains to prove that these functions have row-sum form and to supply the functions at the remaining real types. Fix a coordinate form \(s\) of a primary type \(P\), and take its identity self-connection \(l\). At each address, the first two comparisons give buffer coordinates \[ z_1=s(h_P(a))+\Delta_{l1}(a),\qquad z_2=s(h_P(a))+\Delta_{l2}(a). \] Their sum cancels the two copies of \(s(h_P(a))\) over \(\F\). The third comparison, with destination the same coordinate at the same address, gives \begin{equation} s(h_P(a))=\Delta_{l1}(a)+\Delta_{l2}(a)+\Delta_{l3}(a). \label{eq:self-connection-row-sum} \end{equation} Each term on the right has row-sum form on the full product. Hence every coordinate of every primary \(h_P\) has row-sum form, and therefore so does the vector function itself. Either self-connection copy suffices for \(A\). For each private buffer \(B_l\), prescribe on \(D_l\) its coordinates \[ h_{B_l,j}(a)=o(h_P(a))+\Delta_{lj}(a),\qquad j=1,2. \] These are the unique coordinates of its image-consistency set on that domain. They have row-sum form there. Extend each adjacent-coordinate term arbitrarily from its allowed pair of factors to \(\{0,1\}^2\); their sums define row-sum functions on the full address product. This extension changes no comparison, because the buffer occurs only in its three schemas on \(D_l\). Give the dummy the zero function. On each comparison domain, every scalar form appearing in a comparison now has the singleton value prescribed by Equation~\eqref{eq:image-consistency}; the dummy's zero form also has its required singleton image. Thus these row-sum functions satisfy all identities in \eqref{eq:global-offsets}. Proposition~\ref{prop:global-offsets} supplies global offsets, and Proposition~\ref{prop:isomorphism} gives \(G(\beta)\cong G(0)\). Therefore \(H\cong G(0)\), as required. \end{proof} \subsection{Nonacceptance: an equivalent nonisomorphic mate} \begin{proposition} \label{prop:rejection} If \(M\) does not accept \(w\), then there is a choice of square bits \(\beta\) such that \(G(\beta)\equiv_r G(0)\) but \(G(\beta)\not\cong G(0)\). \end{proposition} \begin{proof} Choose comparison constants \(b_e\in\F\) as follows. All are zero except the constant of the third comparison of one of the two identity self-connections at \(A\), which is one. Form the special twist of Theorem~\ref{thm:special-twist}: on each wire put \(b_e\) on its last link and zero on its other links, and on a square in row \(i\) use that link constant multiplied by \(\delta_i\), where \(\delta_r=1\) and all other \(\delta_i=0\). Then \(\Delta_e(a)=b_e\) on every comparison domain. We first rule out an isomorphism. In a hypothetical solution of \eqref{eq:global-offsets}, the first two comparisons of either broadcast self-connection would copy \(h_A(a)\) into both coordinates of that connection's buffer. Their sum would be zero. The unshifted copy's third comparison would force \(h_A(a)=0\), whereas the shifted copy's third comparison would force \(h_A(a)=1\). This contradiction holds at every address. Propositions~\ref{prop:global-offsets} and \ref{prop:isomorphism} therefore show that \(G(\beta)\not\cong G(0)\). To prove equivalence, it suffices by Theorem~\ref{thm:special-twist} to construct nonempty image-consistency sets. Evaluate truth only in the original acyclic circuit. At a scalar gate use \(\{0\}\) if it is true and \(\F\) if it is false. At an AND gate, use the product subset of \(\F^2\) whose coordinate is fixed to zero if its corresponding port is true and is free otherwise. Its output sum image is \(\{0\}\) exactly when both ports are true, and is \(\F\) otherwise. Thus every gate output has image \(\{0\}\) if true and \(\F\) if false. Give both \(A\) and the dummy the full set \(\F\) at every address. The seed comparisons hold, since a seed is true and the image of the zero form at the dummy is \(\{0\}\). Consider any unshifted directed connection \(l\). A singleton source image is necessarily \(\{0\}\), and its destination image is then also \(\{0\}\). For an original circuit edge this follows because a true source makes the destination scalar or input port true. For an identity self-connection it is immediate. All tests are false in the present case, and all broadcast sources have full images, so those added connections produce no further singleton-source case. In the singleton-source case choose \[ Q_{B_l,a}=\{(0,0)\}. \] Its two coordinate images and its sum image satisfy all three comparisons. In every other case, including the shifted broadcast self-connection, the source image is \(\F\). Let \(D'=s(Q_{R,\sigma_l(a)})\) be the nonempty destination image, and choose \begin{equation} Q_{B_l,a}=\{(u,v)\in\F^2:u+v\in D'+b_{l3}\}. \label{eq:rejecting-buffer-set} \end{equation} Both coordinate projections of this set are \(\F\), and its sum image is exactly \(D'+b_{l3}\). Since \(b_{l1}=b_{l2}=0\) throughout, all three comparisons again hold. This includes a full source image and a singleton destination image: the buffer may have two correlated coordinates without either projection being a singleton. That possibility is why image consistency does not imply a global pointwise solution here. These choices define each private buffer on its active domain. Extend it by arbitrary nonempty sets outside that domain, where it occurs in no comparison. We have obtained nonempty sets at every real type and address satisfying \eqref{eq:image-consistency} with shifts \(b_e\). Theorem~\ref{thm:special-twist} therefore gives \(G(\beta)\equiv_r G(0)\). \end{proof} \subsection{Polynomial size and the main theorem} The circuit description uses \(O_M((r+1)^2+m)\) schemas and requests, and the added directed connections use only \(O_M(r+1)\) schemas. Buffering adds a constant number of real types and comparison schemas per connection. Since \(r\ge m\), there are \(O_M((r+1)^2)\) real types and comparisons. Subdividing each comparison wire into \(4(r+1)+1\) links gives \(O_M((r+1)^3)\) layout types and links. For each row and type there are at most four horizontal label pairs, and for each row and link at most four matched label pairs defining squares. The dimensions are at most two and the legal valuation classes have bounded size. Consequently the number \(J\) of colors and the number \(N\) of base vertices both satisfy \[ J,N=O_M((r+1)^4). \] The color-removing leaves add at most \(NJ(N+1)\) vertices, so the uncolored graph has order \(O_M((r+1)^{12})\). All its local data can be generated from coordinate tables and adjacent pairs of coordinate labels. Enumerating the constant-dimensional valuations, the private leaf indices, and finally every pair of output vertices constructs the full binary adjacency matrix in polynomial time in \(r+m\). There is no enumeration of full computation addresses. The graph is nonempty and simple, and the positive integer \(r=2p(m)+4\) can be computed and written in binary in polynomial time. \begin{proof}[Proof of Theorem~\ref{thm:main}] Proposition~\ref{prop:upper} gives membership in \(\mathrm{EXPTIME}\). For hardness, fix any language in \(\mathrm{EXPTIME}\) and its machine \(M\) as above. The construction \eqref{eq:reduction-output} is a deterministic polynomial-time map from its input words to graph--parameter pairs. If \(M\) accepts, Proposition~\ref{prop:acceptance} says that \(r\)-WL identifies \(G(0)\), so its dimension is at most \(r\). If \(M\) does not accept, Proposition~\ref{prop:rejection} supplies an equivalent nonisomorphic graph, so \(r\)-WL does not identify \(G(0)\). By monotonicity of identification in the dimension, the dimension of \(G(0)\) is then greater than \(r\). Thus acceptance maps exactly to the YES instances of the dimension problem. Since the language was arbitrary, the problem is \(\mathrm{EXPTIME}\)-hard under deterministic polynomial-time many-one reductions, and hence \(\mathrm{EXPTIME}\)-complete. \end{proof} \begin{corollary}\label{cor:unary} The identification problem of Theorem~\ref{thm:main} remains EXPTIME-complete when the positive dimension is encoded in unary. \end{corollary} \begin{proof} For membership, convert the unary dimension to binary and apply Proposition~\ref{prop:upper}. For hardness, the reduction above outputs \(r=2p(m)+4\), whose value is polynomial in the source input length \(m\). Writing \(r\) in unary therefore preserves polynomial-time constructibility and the same acceptance equivalence. \end{proof} ==== END The-complexity-of-identifying-a-graph-by-Weisfeiler-Leman-refinement//sections/07-identification.tex ====