On the Expressive Power of Linear Algebra on Graphs

Floris Geerts

TL;DR

This paper explores the expressive power of graph query languages based on linear algebra, specifically the MATLANG system. It characterizes when two graphs are considered equivalent by different subsets of MATLANG operations, revealing how fundamental linear algebra operations like matrix multiplication and trace can distinguish graph structures. The findings provide a complete picture of how these algebraic operations map to graph properties, offering a new perspective on graph query expressiveness beyond traditional logic-based approaches.

What Problem Does This Paper Address?

Traditional graph query languages are often based on logic (e.g., first-order logic, fixpoint logic). However, there's a growing interest in leveraging linear algebra for querying graph data, especially given its prominence in machine learning. This paper addresses the question of how expressive linear algebra-based graph query languages are, specifically focusing on MATLANG, a matrix query language. The core problem is to understand what kinds of graph properties can be captured and distinguished by different combinations of linear algebra operations. This is framed as characterizing graph equivalence: when do two graphs behave identically with respect to a given set of MATLANG operations? This helps bridge the gap between algebraic manipulation of graph representations and the logical properties they encode.

Methods

The paper investigates graph equivalence by analyzing various fragments of MATLANG, each defined by a specific set of allowed linear algebra operations. These fragments are denoted as ML(L), where L is the list of operations. The authors systematically examine how adding or removing operations like matrix multiplication (·), trace (tr), conjugate transposition (*), the all-ones vector (1), and diagonalization (diag) affects the language's ability to distinguish graphs.

The core methodology involves:

  • Defining Equivalence: Two graphs are ML(L)-equivalent if their adjacency matrices produce the same output for all "sentences" (expressions evaluating to a scalar) in ML(L).
  • Characterizing Fragments: For each fragment ML(L), the paper establishes a characterization of ML(L)-equivalence in terms of known graph properties or algebraic conditions on their adjacency matrices. These characterizations often involve concepts from spectral graph theory (e.g., co-spectrality, main spectrum) and matrix properties (e.g., doubly stochastic matrices, orthogonal matrices).
  • Algebraic Simulation: The proofs often rely on showing that certain graph properties or logical queries can be simulated using expressions within the specific MATLANG fragment. This involves algebraic manipulation of adjacency matrices and their properties.
  • Examples and Counterexamples: The paper uses specific graph examples to illustrate when different fragments can distinguish graphs and when they cannot, providing concrete evidence for their theoretical results.

Datasets

Not discussed in the paper. The paper focuses on theoretical characterizations of graph equivalence using abstract graph structures and their adjacency matrices, rather than empirical evaluation on specific datasets.

Key Insights and Ideas

  • Linear Algebra as a Query Language: The paper demonstrates that linear algebra operations, when composed, can form powerful query languages for graphs, offering an alternative to logic-based approaches.
  • Hierarchical Expressiveness: Different subsets of linear algebra operations yield a hierarchy of expressive power. For instance, ML(·, tr) captures co-spectrality, while adding the '1' vector extends this to counting walks.
  • Connection to Graph Properties: Each MATLANG fragment corresponds to a specific notion of graph equivalence, which in turn maps to well-studied graph invariants and properties like co-spectrality, number of walks, equitable partitions, and stable edge colorings.
  • Impact of Specific Operations:
    • Matrix multiplication and trace (ML(·, tr)) are sufficient to characterize co-spectral graphs and graphs with the same number of closed walks.
  • Adding the all-ones vector (ML(·, *, 1)) allows counting all walks, not just closed ones.
  • The diag operation is crucial for capturing properties related to equitable partitions and C²-equivalence.
  • The Schur-Hadamard product (element-wise matrix multiplication) significantly increases expressive power, enabling distinctions that were previously impossible.
  • MATLANG's Power: The full MATLANG language (with all operations considered) is shown to be equivalent to C³-equivalence, a three-variable fragment of logic with counting.

Key Results

The paper provides characterizations for graph equivalence under various MATLANG fragments:

  • ML(·, tr): Equivalence corresponds to being co-spectral (same eigenvalues) and having the same number of closed walks of any length.
  • ML(·, *, 1): Equivalence corresponds to having the same number of walks of any length.
  • ML(·, tr, 1): Equivalence corresponds to being co-spectral and having the same number of closed and non-closed walks of any length.
  • ML(·, *, 1, diag): Equivalence corresponds to having a common equitable partition, which is equivalent to C²-equivalence and fractional isomorphism.
  • ML(·, tr, 1, diag): Equivalence combines co-spectrality with having a common equitable partition.
  • Full MATLANG: Equivalence corresponds to C³-equivalence.

The paper also shows that adding basic operations like addition, scalar multiplication, and conjugate transposition (under certain conditions) does not increase the expressive power of these fragments.

Limitations and Future Work

  • Directed Graphs and Multiple Inputs: The current work focuses on undirected graphs and single-input expressions. Extending these results to directed graphs (with asymmetric adjacency matrices) and queries with multiple matrix inputs is identified as a significant area for future work.
  • Generalization Beyond Graphs: The authors suggest exploring the expressiveness of MATLANG for general matrices, not just adjacency matrices.
  • Connection to Logic: While connections to logic (like C² and C³) are established, further exploration of links to rank logics, fixed-point logics with counting, and logic-based graph query languages is suggested.
  • MATLANG + inv: The impact of adding a matrix inverse operation (inv) to MATLANG is noted as an open question, particularly for smaller fragments.
  • Local Properties: Investigating notions of locality for MATLANG expressions, similar to those studied in logic, is proposed.
  • Non-deterministic Semantics: The paper mentions MATLANG extensions with an "eigen" operator that introduces non-determinism. Studying graph equivalence with deterministic fragments supporting such operators is left for future work.

Summary updated

BibTeX
@article{geerts2021expressive,
  author = {Floris Geerts},
  title = {{On the Expressive Power of Linear Algebra on Graphs}},
  journal = {Theory Comput. Syst.},
  year = {2021},
  doi = {10.1007/s00224-020-09990-9},
}
Figure