[Paper Review] Algebraic Combinatorics in Mathematical Chemistry. Methods and Algorithms. II. Program Implementation of the Weisfeiler-Leman Algorithm
This paper presents an efficient C implementation of the Weisfeiler-Leman stabilization algorithm for computing the minimal cellular algebra $ W(A) $ of a graph's adjacency matrix $ A $, which serves as a powerful invariant for graph symmetry perception. The method partitions vertices and ordered pairs into equivalence classes based on 3-vertex configurations, yielding the automorphism partition for most molecular graphs when $ W(\Gamma) $ is Schurian, thus enabling robust chemical structure analysis without explicitly computing $ \mathrm{Aut}(\Gamma) $.
The stabilization algorithm of Weisfeiler and Leman has as an input any square matrix A of order n and returns the minimal cellular (coherent) algebra W(A) which includes A. In case when A=A(G) is the adjacency matrix of a graph G the algorithm examines all configurations in G having three vertices and, according to this information, partitions vertices and ordered pairs of vertices into equivalence classes. The resulting construction allows to associate to each graph G a matrix algebra W(G):= W(A(G))$ which is an invariant of the graph G. For many classes of graphs, in particular for most of the molecular graphs, the algebra W(G) coincides with the centralizer algebra of the automorphism group aut(G). In such a case the partition returned by the stabilization algorithm is equal to the partition into orbits of aut(G). We give algebraic and combinatorial descriptions of the Weisfeiler--Leman algorithm and present an efficient computer implementation of the algorithm written in C. The results obtained by testing the program on a considerable number of examples of graphs, in particular on some chemical molecular graphs, are also included.
Motivation & Objective
- To develop a practical, efficient program implementation of the Weisfeiler-Leman stabilization algorithm for use in mathematical chemistry.
- To compute the minimal cellular algebra $ W(A) $ associated with a graph’s adjacency matrix $ A $, which acts as an invariant for graph symmetry classification.
- To test the algorithm on molecular graphs and demonstrate its ability to recover the automorphism partition when $ W(\Gamma) $ is Schurian.
- To provide a computationally feasible alternative to explicit automorphism group computation for chemical structure analysis.
- To support chemists with a tool that classifies atoms and bonds via invariants derived from higher-order configurations, avoiding reliance on heuristic valency-based methods.
Proposed method
- The algorithm takes any square matrix $ A $ of order $ n $ as input and computes the minimal cellular (coherent) algebra $ W(A) $ containing $ A $, which is an invariant of the underlying graph.
- For a graph $ \Gamma $, the algorithm partitions vertices and ordered pairs of vertices by analyzing all ordered triples of vertices, refining colorings based on local configurations.
- The stabilization process iteratively refines a coloring of vertices and arcs until no further refinement is possible, producing a stable coloring that corresponds to the orbit partition under $ \mathrm{Aut}(\Gamma) $ when $ W(\Gamma) $ is Schurian.
- The implementation uses dynamic memory management and hashing techniques to efficiently store and update color classes, with optimizations to reduce computational overhead.
- The algorithm is implemented in C and tested on a range of graphs, including molecular graphs, with performance evaluated on graphs of moderate size.
- An alternative strategy is proposed: alternating stabilization steps of depth 2 and 3 to reduce complexity while maintaining accuracy, avoiding full iterative refinement.
Experimental results
Research questions
- RQ1Can the Weisfeiler-Leman stabilization algorithm be efficiently implemented in C to compute cellular algebras for molecular graphs?
- RQ2Under what conditions does the Weisfeiler-Leman partition coincide with the automorphism group's orbit partition?
- RQ3How does the algorithm perform on chemical graphs, especially regular or symmetric ones where valency-based methods fail?
- RQ4Can alternating depth-2 and depth-3 stabilization steps reduce computational cost while preserving correctness?
- RQ5What is the relationship between the cellular algebra $ W(\Gamma) $ and the centralizer algebra of $ \mathrm{Aut}(\Gamma) $, and when is $ W(\Gamma) $ Schurian?
Key findings
- The Weisfeiler-Leman algorithm successfully computes the minimal cellular algebra $ W(A) $ for any input matrix $ A $, which is an invariant of the graph.
- For most molecular graphs, the resulting partition of vertices and ordered pairs corresponds exactly to the orbits of $ \mathrm{Aut}(\Gamma) $, provided $ W(\Gamma) $ is Schurian.
- The C implementation demonstrates practical efficiency on graphs with several thousand vertices, enabling application to real chemical structures.
- The algorithm outperforms purely valency-based heuristics by considering 3-vertex configurations, thus resolving cases where regular graphs fail under simpler methods.
- Stabilization of depth $ t \geq 4 $ is insufficient in general to recover the automorphism partition, as shown by counterexamples in the literature.
- Alternating depth-2 and depth-3 stabilization steps offer a promising path toward faster computation without sacrificing correctness in the Schurian case.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.