Table of Contents
Fetching ...

GraphFSA: A Finite State Automaton Framework for Algorithmic Learning on Graphs

Florian Grötschla, Joël Mathys, Christoffer Raun, Roger Wattenhofer

TL;DR

This work proposes a novel framework: GraphFSA (Graph Finite State Automaton), designed to learn a finite state automaton that runs on each node of a given graph.

Abstract

Many graph algorithms can be viewed as sets of rules that are iteratively applied, with the number of iterations dependent on the size and complexity of the input graph. Existing machine learning architectures often struggle to represent these algorithmic decisions as discrete state transitions. Therefore, we propose a novel framework: GraphFSA (Graph Finite State Automaton). GraphFSA is designed to learn a finite state automaton that runs on each node of a given graph. We test GraphFSA on cellular automata problems, showcasing its abilities in a straightforward algorithmic setting. For a comprehensive empirical evaluation of our framework, we create a diverse range of synthetic problems. As our main application, we then focus on learning more elaborate graph algorithms. Our findings suggest that GraphFSA exhibits strong generalization and extrapolation abilities, presenting an alternative approach to represent these algorithms.

GraphFSA: A Finite State Automaton Framework for Algorithmic Learning on Graphs

TL;DR

This work proposes a novel framework: GraphFSA (Graph Finite State Automaton), designed to learn a finite state automaton that runs on each node of a given graph.

Abstract

Many graph algorithms can be viewed as sets of rules that are iteratively applied, with the number of iterations dependent on the size and complexity of the input graph. Existing machine learning architectures often struggle to represent these algorithmic decisions as discrete state transitions. Therefore, we propose a novel framework: GraphFSA (Graph Finite State Automaton). GraphFSA is designed to learn a finite state automaton that runs on each node of a given graph. We test GraphFSA on cellular automata problems, showcasing its abilities in a straightforward algorithmic setting. For a comprehensive empirical evaluation of our framework, we create a diverse range of synthetic problems. As our main application, we then focus on learning more elaborate graph algorithms. Our findings suggest that GraphFSA exhibits strong generalization and extrapolation abilities, presenting an alternative approach to represent these algorithms.
Paper Structure (49 sections, 4 equations, 9 figures, 8 tables)

This paper contains 49 sections, 4 equations, 9 figures, 8 tables.

Figures (9)

  • Figure 1: Illustration of the GraphFSA framework: Each node has its own state, represented by its color. Furthermore, each node runs the same Finite State Automaton, determining its next state depending on the neighborhood information. On the left, an example graph is shown with the aggregation next to it. In this example, the aggregator can distinguish if there is a node of a certain color/state in the neighborhood. In general, the aggregator can be any function that maps a state multiset to a finite set of values. State transitions are determined by the FSA depicted in the middle, which chooses chooses the next state based on the states appearing in the neighborhood and the old state. An example of the transition that is taken by the red node on the bottom right of the graph is shown. Note that the green state is final and does not have any outgoing transitions.
  • Figure 2: Original topology (left), nodes that GraphFSA can distinguish with 2+ aggregation (i.e., distinguish neighbors as 0, 1 or more than 2) (middle) and 1-WL color classes (right). More specifically, for GraphFSA, nodes cannot differentiate if they have 2 or 3 neighbors of a kind. In contrast, 1-WL can further distinguish the two nodes.
  • Figure 3: Partial Visualization of a learned GraphFSA model for the Distance problem. The root node starts in state $s_1$ (left), whereas all other nodes start in state $s_0$ (right). The final states $f_0,f_1$ represent even and odd distances to the root, respectively. Aggregation values are presented as $[f_0, f_1, s_0, s_1]$ where we apply the counting aggregation with bounding parameter $b=1$. We can verify on the right that the nodes wait until they observe a final state in their neighborhood and then transition to the other final state. A full visualization of the same automaton can be found in the Appendix.
  • Figure 4: We study learning cellular automata as the simplest form of algorithmic behavior, which can lead to complex and intricate behavior patterns when assembled in a network. The left shows Conway's Game of Life, which we can learn on general topologies such as the hexagonal grid due to the graph representation. A WireWorld automata is depicted on the right, which can be used to simulate transistors and electrical circuits. It shows the electron head (blue) and tail (red) transitioning through different wires (yellow).
  • Figure 5: Complete Visualization of a learned GraphFSA model for the Distance problem. The root node starts in state $s_1$, whereas all other nodes start in state $s_0$. The final states $f_0,f_1$ represent even and odd distances to the root respectively. Aggregation values are presented as $[f_0, f_1, s_0, s_1]$ where we apply the counting aggregation with bounding parameter $b=1$.
  • ...and 4 more figures