Squarefree Cycle Positional Encoding
Implementation & benchmark of arXiv:2608.06372 — Squarefree Matrix Formulas for the CWR Invariant of Alternating Knots and Links
Source paper: Squarefree Matrix Formulas for the CWR Invariant of Alternating Knots and Links arXiv:2608.06372 ⓘ · analyzed Aug 31, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Augment every graph node with weighted participation in simple cycles of lengths 3 through K, computed using the paper's squarefree trace construction. Feed these features into a graph transformer or message-passing network so nodes with identical local degrees and ordinary spectral statistics can still be distinguished by their exact loop environment.
Formulas
Mathematical statement
Let G=(V,E) be a finite undirected simple loopless graph with symmetric weighted adjacency matrix A, where A_{ij}=a_{ij} if {i,j} is in E and A_{ij}=0 otherwise. Introduce independent commuting vertex variables x_1,...,x_n and X=diag(x_1,...,x_n). A term in tr((XA)^k) corresponds to a length-k closed walk and contains the product of variables of its visited vertices. Let SF[p] retain only monomials in p in which every variable has exponent at most one. For k>=3, every unoriented simple k-cycle is represented by 2k directed closed walks, so C_k(x)=(1/(2k))SF[tr((XA)^k)] is the weighted simple-cycle polynomial. Its derivative at x_i=1 gives node-level cycle participation p_{i,k}. The log-determinant identity -log det(I-tXA)=sum_{k>=1} t^k tr((XA)^k)/k provides an equivalent coefficient-generating form.
Implementation notes
1. Integration point: modify the input embedding of a graph neural network. For each graph with n nodes and weighted adjacency A, append the vector z_i=(z_{i,3},...,z_{i,K}) to the original feature h_i before the first message-passing or graph-transformer layer; optionally append graph-level totals C_k(1) after pooling. 2. Pseudocode: construct A; set p[i,k]=0 and total[k]=0; for each k in 3..K, enumerate simple cycles with DFS using the smallest vertex as a canonical start and one canonical orientation; compute q=product of the edge weights around the cycle; add q to p[i,k] for every node i in that cycle and to total[k]. Normalize with z[i,k]=log(1+p[i,k]/(epsilon+total[k]/n)), concatenate z to h_i, and run the unchanged GNN. For small dense graphs, an alternative is symbolic propagation of tr((XA)^k), retaining monomials represented by distinct vertex bitmasks. 3. The paper supplies the 2k normalization, squarefree criterion, and trace/log-determinant identities. The engineer computes cycle lists exactly; no theorem constants are estimated. For K<=5, use exact DFS on small graphs; for larger K use capped DFS or randomized simple-cycle sampling. 4. First experiment: train a 5-layer GIN and a graph transformer on MUTAG, PROTEINS, and a synthetic degree-matched dataset whose classes differ only in triangle or 4-cycle counts. Compare the baseline, Laplacian eigenvector features, and these features at equal parameter count. Success is higher held-out accuracy, especially on the degree-matched task, with feature computation below 10% of training time for graphs of at most 100 nodes.
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.