Homomorphism-Vector Positional Encoding
Implementation & benchmark of arXiv:2608.13382 — A Dense Weisfeiler-Leman Algorithm for Deciding Bounded-Cliquewidth Homomorphism Indistinguishability
Source paper: A Dense Weisfeiler-Leman Algorithm for Deciding Bounded-Cliquewidth Homomorphism Indistinguishability arXiv:2608.13382 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Augment a graph neural network with structural features computed from counts of small pattern homomorphisms whose pattern vertices are constrained to lie in selected vertex subsets. Unlike ordinary local aggregation, these features encode dense subgraph structure and can separate graphs or node sets that have identical low-order neighborhood statistics. Use a small learned bank of pattern graphs and sampled subset tuples so the method remains practical.
Formulas
Mathematical statement
The paper represents each k-partitioned pattern graph \(\boldsymbol{F}\) by a homomorphism vector \(\boldsymbol{F}_G\in\mathbb{Q}^{P(G)^k}\), where \(G=(V,E)\) is the input graph, \(P(G)=2^V\) is its powerset, \(\boldsymbol{D}=(D_1,\ldots,D_k)\in P(G)^k\) is a tuple of vertex subsets, and \(C_1,\ldots,C_k\) are the corresponding pattern blocks. Equation (1) is \(\boldsymbol{F}_G(\boldsymbol{D})=\left|\{h:F\to G\mid h(C_i)\subseteq D_i\text{ for all }i\in[k]\}\right|\), where a graph homomorphism \(h\) maps every pattern edge to an edge of \(G\). Equivalently, if \(F=(U,E_F)\), \(\boldsymbol{F}_G(\boldsymbol{D})=\sum_{h:U\to V}\prod_{(u,v)\in E_F}\mathbf{1}[(h(u),h(v))\in E]\prod_{i=1}^k\prod_{u\in C_i}\mathbf{1}[h(u)\in D_i]\). The neural adaptation uses \(z_F(\boldsymbol{D})=\log(1+\boldsymbol{F}_G(\boldsymbol{D}))\), optionally normalized by the number of admissible mappings. The transferable property is that these coordinates are compositional structural invariants indexed by subset tuples, rather than ordinary vertex-local messages.
Implementation notes
(1) Integration point: add a structural positional-encoding branch before the first graph transformer or message-passing layer. The branch outputs one vector per vertex and is concatenated to the original node embedding; alternatively feed it as an additive bias to graph-attention logits. Choose a small pattern bank \(\mathcal{B}\), for example all colored graphs with 1--4 pattern vertices and up to 2 blocks, including isolated vertices, edges, wedges, triangles, 4-cycles, and two disjoint edges. Sample \(S\) subset tuples \(\boldsymbol{D}^{(s)}=(D_1^{(s)},\ldots,D_k^{(s)})\) per graph using random Bernoulli masks with several densities.
(2) Pseudocode: for each pattern \(F\in\mathcal{B}\) and subset tuple \(\boldsymbol{D}\), compute \(c_F[\boldsymbol{D}]\) by enumerating assignments for patterns of at most four vertices, or by dynamic programming over pattern vertices; reject assignments violating an edge or block-membership constraint. Set \(z_F[\boldsymbol{D}]=\log(1+c_F[\boldsymbol{D}])/\log(1+\prod_i|D_i|^{|C_i|})\). Pool each sampled tuple into its member vertices: \(q_v=\sum_{s:v\in D_1^{(s)}\cup\cdots\cup D_k^{(s)}}\alpha_s\,\mathrm{MLP}(z_{F\in\mathcal{B}}[\boldsymbol{D}^{(s)}],\mathrm{mean}_{u\in\cup_iD_i^{(s)}}x_u)\), then return \(\mathrm{MLP}([x_v,q_v])\). The homomorphism-count definition is the paper-derived computation; the logarithm, normalization, subset sampling, and learnable pooling are engineering adaptations.
(3) Exact counts are feasible for small patterns and graphs; for larger patterns estimate counts by Monte Carlo assignments or color-coded dynamic programming. Cache all subset masks and reuse counts across minibatch augmentations. Monitor the coefficient of variation of estimated counts and increase samples only when it is high.
(4) First experiment: use a 5-layer GIN and a 4-layer graph transformer on dense synthetic graphs, strongly regular graphs, Erdős–Rényi graphs, and a molecular benchmark such as ZINC. Compare the baseline, standard degree/triangle features, and this branch at equal parameter count. The primary signal is higher accuracy or better graph-isomorphism discrimination at equal depth; a useful target is at least 5 percentage points on regular-graph classification and improved validation accuracy on dense graph tasks without increasing message-passing layers.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.