Graph Neural Networks and 3-dimensional topology

We test the efficiency of applying geometric deep learning to the problems in low-dimensional topology in a certain simple setting. Specifically, we consider the class of 3-manifolds described by plumbing graphs and use graph neural networks (GNN) for the problem of deciding whether a pair of graphs give homeomorphic 3-manifolds. We use supervised learning to train a GNN that provides the answer to such a question with high accuracy. Moreover, we consider reinforcement learning by a GNN to find a sequence of Neumann moves that relates the pair of graphs if the answer is positive. The setting can be understood as a toy model of the problem of deciding whether a pair of Kirby diagrams give diffeomorphic 3-or 4-manifolds.


Introduction and Summary
Geometric Deep Learning (GDL) [1] is an area of Machine Learning (ML) that has been under very active development during the last few years.It combines various approaches to ML problems involving data that has some underlying geometric structure.The neural networks used in GDL are designed to naturally take into account the symmetries and the locality of the data.It has been successfully applied to problems involving computer vision, molecule properties, social or citation networks, particle physics, etc (see [2] for a survey).It is natural to apply GDL techniques also to mathematical problems in topology.In general, ML has been already used in various problems in low-dimensional topology, knot theory in particular, [3,4,5,6,7,8,9,10,11,12], as well as various physics-related problems in geometry (for a recent survey see [13]).However, the used neural network models were mostly not specific to GDL.
The goal of this paper is to test the efficiency of GDL in a very simple setting in low-dimensional topology.Namely, we consider a special class of 3-manifolds known as plumbed, or graph, 3-manifolds.Those are 3-manifolds that are specified by a choice of a graph with particular features assigned to edges and vertices.Such 3-manifolds are therefore very well suited for analysis by Graph Neural Networks (GNN).GNN is one of the most important and used types of neural networks used in GDL.In general, GNN are designed to process data represented by graphs.
In this paper, we use GNNs for the following problems involving plumbed 3-manifolds.Different (meaning not isomorphic) graphs can correspond to equivalent, i.e. homeomorphic, 3-manifolds.Note that in 3 dimensions (or less) any topological manifold has a unique smooth structure and the notions of homeomorphism and diffeomorphism are equivalent.It is known that a pair of graphs that produce two equivalent 3-manifolds must be related by a sequence of certain moves, commonly known as Neumann moves [14].These moves establish a certain equivalence relation on the graphs (in addition to the standard graph isomorphism).First, we consider a neural network that, as the input has a pair of plumbing graphs, and, as the output gives the decision whether the graphs correspond to homeomorphic 3-manifolds or not, i.e. whether the two graphs are equivalent, or not, in the sense described above.Supervised Learning (SL) is then used to train the network.The training dataset consists of randomly generated graph pairs, for which it is known whether the corresponding 3-manifolds are homeomorphic or not.The trained neural network, up until the very last layer, can be understood to produce an approximate topological invariant of plumbed 3-manifolds.
Second, we consider a neural network for which the input is a plumbing graph and the output is a sequence of Neumann moves that "simplifies" the graph according to a certain criterion.The aim is to build a neural network such that if it is applied to equivalent graphs it simplifies them to the same graph.If the result is successful this can be used to provide an explicit demonstration that a given pair of Figure 1: An example of a plumbing graph.graphs give two homeomorphic 3-manifolds.Reinforcement Learning (RL) is used to train the network.For both cases, SL and RL, we consider different architectures of the neural networks and compare their performance.
Note that in principle there is an algorithm for determining whether two plumbing graphs give homeomorphic 3-manifolds or not, which was already presented in [14].It involves bringing both graphs to a certain normal form (which is, in a sense, similar to the "simplification" process in the RL setup mentioned above) and then checking that normal forms are the same (i.e.isomorphic graphs).However, it is known that just checking isomorphism of graphs already goes beyond polynomial time.The plumbing graphs can be considered as a particular class of more general Kirby diagrams that can be used to describe arbitrary closed oriented 3-manifolds, with Neumann moves being generalized to the so-called Kirby moves.Even in this case, in principle there exists an algorithm of checking whether two Kirby diagrams produce homeomorphic 3-manifolds or not [15].There is a also of version of Kirby diagrams and moves for smooth 4-manifolds.Moreover, in this case, however, an algorithm for the recognition of diffeomorphic pairs does not exist.In 4 dimensions the notion of diffeomorphism and homeomorphism are not the same.In particular, there exist pairs of manifolds that are homeomorphic but not diffeomorphic.While the classification of 4-manifolds up to homeomorphisms (with certain assumptions on the fundamental group) is relatively not difficult, classification up to diffeomorphisms is an important open question.The setup with plumbed 3-manifolds that we consider in this paper can be understood as a toy model for the problem of recognition of diffeomorphic pairs of general 3-and 4-manifolds, for which one can try to apply neural networks with similar architecture in the future.
The rest of the paper is organized as follows.In Section 2 we review basic preliminaries about plumbed 3-manifolds and Graph Neural Networks needed for the analysis that follows.In Section 3 we consider various GNN architectures for supervised learning of whether a pair of plumbing graphs provide homeomorphic 3-manifolds or not.In Section 4 we consider reinforcement learning of the process of simplification of a plumbing graph representing a fixed (up to a homeomorphism) 3-manifold.Finally, we conclude with Section 5 where we discuss the obtained results and mention possible further directions.The Appendix A contains some basic algorithms that are specific to the problems considered in this paper.

Plumbed 3-manifolds
In this section we review basic facts about plumbed 3-manifolds, also known as graph 3-manifolds.For a more detailed exposition we refer to the original paper [14].First, let us describe how to build a 3manifold from a plumbing graph, or simply a plumbing.For convenience, we restrict ourselves to the case when the graph is a tree, i.e., the graph is connected and acyclic.We will also consider the case of genus zero plumbings only.In this setting, apart from the graph itself, the only additional information that one needs to specify is the set of integer weights w(v) ∈ Z labeling vertices v ∈ V (V denotes set of all vertices of the graph), also referred to as framings in the context of topology.A typical plumbing graph looks like the one shown in Figure 1.The weights w(v), together with standard graph data can be naturally encoded in an |V | × |V | matrix a with integral elements a ij as follows.Outside of the diagonal this matrix coincides with the standard adjacency matrix of the graph (i.e. a ij = 1 if i ̸ = j ∈ V are connected by an edge, and a ij = 0 otherwise).The diagonal elements are given by the weights: a ii = w(i).
One can build a 3-manifold corresponding to such a plumbing graph as follows.First, consider a graph containing a single vertex with weight p ∈ Z and no edges.To such a one-vertex graph we associate lens space 3-manifold L(|p|, ±1), where the sign of ±1 coincides with the sign of p.It can be described as a quotient of the standard unit 3-sphere ) transformation.This 3-manifold can be equivalently understood as a circle fibration over S 2 base with Euler number p.More explicitly, it can be constructed as follows.Let us start with two copies of D 2 × S 1 (where D 2 denotes 2-dimensional disk), that can be viewed as trivial circle fibrations over D 2 .We then can glue two D 2 's along the common boundary ∂D 2 ∼ = S 1 into S 2 (so that each D 2 can be understood as a hemisphere), with the S 1 fibers along the two boundaries being glued with relative rotation specified by a certain map f : ∂D 2 ∼ = S 1 → SO(2) ∼ = S 1 .The homotopy class of such a map is completely determined by the "winding number".The homeomorphism class of the resulting closed 3-manifold only depends on this number.To obtain the lens space L(p, 1) one takes the winding number to be p.
Next, consider a vertex with weight p being a part of a general tree plumbing (as, for example, the one shown in Figure 1).For each edge coming out of the vertex, we remove a single S 1 fiber (over some generic point in the S 2 base) of the fibration together with its tubular neighborhood.The neighborhood can be chosen to be the restriction of the fibration to a small disk in the S 2 base that contains the chosen point.Such an operation, out of the original lens space L(p, 1), produces a 3-manifold that has a boundary component ∂D 2 × S 1 ∼ = S 1 × S 1 = T 2 for each edge coming out of the vertex.Having an edge between a pair of vertices in the graph then corresponds to gluing two T 2 boundary components in the way that the two circles, the fiber S 1 and the boundary S 1 of the small disk on the base, are swapped (with the orientation of one of the circles reversed, so that the resulting 3-manifold is orientable).Performing such operations to all the vertices and edges of the graph one obtains a 3-manifold that has no boundary components.This is the 3-manifold that one associates to the plumbing graph.
Equivalently, to a plumbing graph one can associate Dehn surgery diagram, in the way that each vertex v ∈ V corresponds to an unknot framed by w(v) and the presence of an edge between two vertices signifies that the corresponding unknots form a Hopf link.
Applying the prescription described above to different graphs may result in homeomorphic 3-manifolds.In [14] it was proved that this happens if and only if the graphs can be related by a sequence of local graph transformations, or moves, now commonly known as Neumann moves, shown in Figure 2.

Graph neural networks
Here we provide a brief review on some of GNNs for a later purpose.There are 3 main computational modules to build a typical GNN architecture: propagation modules, sampling modules and pooling modules.Since in this paper we will use only convolution operators, which are one of the most frequently used propagation modules, we focus on some of convolution operators.For a broad review on various modules, we refer the reader to [16].
Convolution operators are motivated by convolutional neural networks (CNN), which have achieved a notable progress in various areas.In general, the role of convolution operators can be described as node features of node i in the k-th layer and e j,i ∈ R D denotes edge features of the edge connecting from node j to node i.We also note that over a neighborhood N (i) of node i is a differentiable, permutation invariant function such as sum, mean and max, and γ and ϕ denote differentiable functions such as Multi Layer Perceptrons (MLPs).
Among various convolution operators existing in the literature, the following will appear in the next sections.
• Graph Embedding Network (GEN) [17] GEN is designed for deep graph similarity learning and embeds each graph into a vector, called a graph embedding.More explicitly, it first computes initial node embeddings x (1) i from the node features x (0) i

through MLP
x then it executes the single message propagation to compute node embeddings x i by the information in its local neighbourhood Once the node embeddings x (2) i are computed, an aggregator computes a graph embedding by aggregating the set of node embeddings.In Section 3.1, we describe the details of the aggregator which we will apply not only to GEN but also the other models GCN and GAT.

• Graph Convolutional Network (GCN)
GCN is introduced in [18] as a variant of convolutional neural networks for graphs.It operates as the following formula: where z i is the output for the i-th node, Θ is a matrix of filter parameters, and di is the degree of i-th node.
• Graph Attention Network (GAT) GAT is proposed in [19], which incorporates the attention mechanism into the message propagation.The mechanism of GAT can be formulated as Here the attention coefficients α are given by , where the attention mechanism a is implemented by a single-layer feedfoward neural network, and ∥ is the concatenation operator.

Supervised Learning
In this section we use supervised learning to decide whether or not two plumbing graphs represent a same plumbed 3-manifold.We build 3 models GEN+GAT, GCN+GCN and GCN+GAT and examine their performance for the task. 3

Models
All the models are designed to have two convolution operators, one aggregation layer and one classification layer.The models are named by concatenating the names of two convolution operators.For a fair comparison, we use the common aggregation layer and the classification layer, and all the layers have the same dimensions for both input and output.
Since we have already reviewed the convolution operators in Section 2.2, let us now elaborate on the common aggregation layer and classification layer.The aggregator computes a graph embedding by aggregating all of its node embeddings, passed from convolution operators.We use the aggregation layer proposed in [22], which is formulated by where h G is a graph-level output and ⊙ denotes element-wise multiplication.
The classification layer plays a role to determine, for a given pair of plumbing graphs, whether or not they are equivalent.This layer has the concatenation of two graph embeddings as its input and classifies into two classes, class 0 and class 1.Here class 1 means two plumbing graphs are equivalent while class 0 denotes they are inequivalent.We implement the classification layer by using MLP with two hidden layers.
A detailed information of the architecture for 3 models are presented in Table 1.For each layer in the table, the first element in the bracket followed by a name of model denotes the dimension of input vectors of the layer while the second one denotes the dimension of output embedding.

Experimental Settings
For training and validation, we put together datasets including 80,000 random pairs of plumbings generated by algorithms presented in Appendix A. More explicitly, the datasets consists of • 40,000 pairs of equivalent plumbings generated by EquivPair, Algorithm 3, with N max = 40.
To generate a pair of equivalent plumbings, the algorithm starts with a random plumbing created by RandomPlumbing, Algorithm 1, and iteratively applies Neumann moves using RandomNeumann-Move, Algorithm 2, up to N max times, to each plumbing in the pair.
It has a similar process to EquivPair, but it starts with a pair of inequivalent plumbings, each of which is separately generated by RandomPlumbing. 4 10,000 pairs of inequivalent plumbings generated by TweakPair, Algorithm 5, with N max = 40.This algorithm generates a pair of inequivalent plumbings, one of which is obtained by tweaking the other.Here, by tweaking a plumbing, we mean that we make a small change of the weight (or node feature) of a randomly chosen node in the plumbing.Since tweaking is different from Neumann moves, this process creates an inequivalent plumbing to the original one.After tweaking, it also applies RandomNeumannMove iteratively up to N max .These pairs are added into the datasets in order for the models to make the decision boundary more accurate, since for a pair generated by InequivPair, two plumbings might be quiet different due to random generators.We divide the datasets into training and validation sets by the ratio 8:2.We train our models on training sets containing 64,000 pairs of plumbings up to 150 epochs.For each model, we use cross-entropy loss for a loss function and Adam for an optimizer with the learning rate 0.001.

Results
The comparison of the performance between 3 models is plotted in Figure 3.We find that GEN+GAT model significantly outperforms the other models GCN+GAT and GCN+GCN.The model GCN+GAT seems to outperform GCN+GCN by few percent, but the performance difference is negligible. 5e have also tried other models such as GEN+GEN, GEN+GCN and GAT+GAT to figure out which convolution operators has an important role.The model GEN+GCN shows similar performance with GEN+GAT, but slightly underperforms, and the performance of GAT+GAT is somewhere between that of GEN+GAT and GCN+GAT.This means that GEN plays a significant role to evaluate equivalence or inequivalence for a pair of plumbing graphs.However, we found that GEN+GEN does not perform as good as GEN+GAT or GEN+GCN.
We used the following datasets to test our models: • Test set 1 It contains 5,000 pairs of equivalent plumbing graphs generated by EquivPair with N max = 40 and 5,000 pairs of inequivalent plumbings generated by InequivPair with N max = 40.
• Test set 2 This dataset is similar to Test set 1, but with N max = 60.

• Test set 3
This set is also similar to Test set 1, but with N max = 80.
• Test set 4 It contains 64 pairs of plumbings generated in a manual way such that, for each pair, the determinants of adjacency matrices (with weights on the diagonal) of two plumbings are the same.We use this Test set in order to check that graph embeddings from the models are not just functions of the determinant of the adjacency matrix of a plumbing.All types of Neumann moves have the property that it preserves the determinant of the adjacency matrix of the plumbing, which is the order of the first homology group of the corresponding 3-manifold.We wish graph embeddings to not depend on the determinant only, but be more sophisticated (approximate) invariants of plumbed 3-manifolds.
The results are depicted in Figure 4 and they enlighten us with the following two points.The first point is that the accuracy for Test set 2 and Test set 3 is almost the same level as Test set 1 even though Test set 2 and 3 contain plumbing pairs with larger N max than Test set 1. It is perhaps surprising that

Reinforcement Learning
In this section, we consider reinforcement learning of a neural network that allows, for a given pair of plumbings, not only to recognize whether they are equivalent or not, but also to find out their simplest representations.

State space
In our RL environment, the plumbing graph defines the state and the state space is infinity.In order to handle the start state and terminal stats in an easy way, we set the start state for an episode is set to be a plumbing generated by RandomPlumbing, Algorithm 1, with number of nodes equal to 10, then applying Neumann moves N = 15 times.Between two equivalent plumbings, we define a relation as follows: for two equivalent states s 1 and s 2 , one state is said to be simpler than the other if where f (s) for a state s is defined by It is easy to check that this relation is well-defined in a set of all equivalent plumbings.One might think that number of nodes in a state is enough to decide which state is simpler.The reason why we add the sum of the absolute values of the weights of nodes is to make the simplest state generically The right-hand side plumbing is simpler than the left one in the sense of (4.1).unique 6 .For example, two plumbings depicted in Figure 5 have same number of nodes and it is easy to check that they are equivalent by applying 2 Neumann moves.In this example, we say that the plumbing on the right-hand side is simpler than the other from (4.1).By using this comparison relation, we set the terminal state to be a state equal to or simper than the initial state in the episode.We also terminate each episode after taking 15 time steps.

Action space
An action for the agent in a state is defined to be a Neumann move applied to one of the nodes.There are 8 possible Neumann moves: 5 blow-up moves and 3 blow-down moves.However, blow-down moves are not always available for all nodes and this could raise a problem that there might be too many of such illegal actions.Therefore, we incorporate 3 blow-down moves into one such that it takes an available blow-down if the corresponding node satisfies one of three following conditions: • the degree of the node is 2 and its weight is equal to ±1, • the degree of the node is 1 and its weight is equal to ±1, • the degree of the node is 1 and its weight is equal to 0.
Then, for a given state, the total number of possible actions is equal to 6 (5 blow-up moves and 1 blow-down move) times number of nodes in the state.If the agent takes an illegal action, then the next state remains the same state as the current state and the agent will be punished with a negative reward, on which we will elaborate soon.

Rewards
Since the goal for the RL agent is to find out the simplest representation for an initial state, it is natural to use −f (s ′ ) as a reward (or punishment +f (s ′ )) for taking an action in the current state s, where s ′ denotes the next state obtained by taking an action to the current state s.Since all the rewards are negative and simpler state is less punished, it helps the agent not only make the current representation as simple as possible, but also do this job as fast as possible.It is also important to note that some states must get a new blow-up node in order to be simplified, which means the agent has to sacrifice the immediate reward at some time steps to maximize the total return.As we have seen previously, there are some illegal actions in the action space for each state.The reward for such illegal actions is set to be equal to −2f (s ′ ) for the next state s ′ , which remains the same as the current state s as we have discussed above.
We set the discount factor as γ = 0.99, very close to 1.

The deep RL algorithm
We remind that the RL task is to obtain the simplest representation from a given initial state by using Neumann moves.To accomplish this task, we used Asynchronous Advantage Actor-Critic (A3C) [23] as an RL algorithm, which is the asynchronous version of Actor-Critic (AC) [24], with feedforward GNNs.A3C executes multiple local AC agents asynchronously in parallel to decorrelate the local agent's data into a more stationary process.It also provides practical benefits of being able to use only multi-core CPU, not having to rely on specialized hardware such as GPUs.
The Actor network defines the policy function π(a|s), whose output shows the probability of taking action a in state s, while the Critic network is to approximate the value function V π (s), which represents the expected return from state s.Since the inputs of the Actor and Critic are plumbing graphs, in the context of GNNs, the Actor network can be thought as the GNNs for node-level action-selection problem and the Critic is for graph-level estimation problem.The architecture of the Actor is designed by using two graph convolutional layers GCN+GCN and one single-layer feedforward neural network.The Critic has a similar structure, but it has an extra aggregation layer, for which we used a simple mean function.We have also tried GEN+GAT and GEN+GCN for the convolutional layers in the Actor and Critic networks.They seemed to perform well, but it takes a bit longer time for training than GCN+GCN.Since the results with GCN+GCN were already pretty good, we ended up using GCN+GCN.
We trained the agents for 8 × 10 4 episodes using 8 CPU cores and no GPU, which takes around 8 hours.We used Adam optimizer with learning rate 5 × 10 −4 .For a comparison, we have also implemented Deep Q-Network (DQN) [25] with feedforward GNNs GCN+GCN with the same settings as those for A3C.

Results
Our RL agents can be used to find the simplest representative in the equivalence class of a given plumbing graph.Furthermore, it also can be used to check whether a pair of plumbing graphs represents the same 3-manifold or not.For the latter purpose, we run the RL agents on a pair of plumbings to get the simplest representations for two plumbings, then we compare those to decide whether two equivalent plumbings are isomorphic or not.This process provides us with another advantage that, given two equivalent plumbings, we can get a sequence of Neumann moves that change one plumbing into the other, even though such sequence of Neumann moves is not necessarily the optimal one between two plumbings.From this perspective, we are going to check the performance of the RL agents by running them on pairs of plumbings that represent the same 3-manifolds.
For the initial inputs of the agents, we generate 10,000 random pairs of plumbings by EQUIVPAIR, Algorithm 3, but with a fixed number of Neumann moves N ∈ {20, 40, 60, 80, 100}.At each time step, the agents choose a Neumann move and apply it to each plumbing in a pair, then we get another pair of plumbings as the next input for the agents.After taking each action, we compare two plumbings and check if they are isomorphic.If yes, we consider it as the success of finding out a sequence of Neumann moves connecting two plumbings in the initial pair.Otherwise, we move on to the next step and we repeat the process until the number of time steps exceeds 5N .We define the accuracy of the performance as the ratio the number of successes divided by the number of total episodes.An example of a pair of equivalent graphs with the successful result by the A3C trained agent is shown in Figure 9.
The results of the RL agents is presented in Figure 6.The plot on the left in Figure 6 shows the accuracy comparison between A3C and DQN.The accuracy for A3C tends to slightly decrease as N gets larger, but it's around 93% for all pairs of plumbings.However, the accuracy for DQN drops significantly from around 86% to 42% when N increases from N = 20 to N = 100.
On the right in Figure 6, we show the average number of actions that the agent takes until obtaining a pair of exactly same two plumbings from an initial pair of equivalent plumbings.For A3C agent, the average numbers of actions do not exceed around 1.35 times N , which means the trained A3C agent has a good efficiency to make a plumbing simpler.The DQN agent needs similar number of actions to the A3C for N = 20 and N = 40.However, it takes almost twice as many number of actions as A3C for larger N .We have also studied the distribution of Neumann moves (or actions) that the A3C agent performs before and after training to simplify plumbings generated with N = 100.In Figure 7, we plot the number of each Neumann move taken by the agent divided by N .In the plot, moves 1-5 denote blow-up moves and moves 6-8 denote blow-down moves.
It is natural to observe that all blue dots in Figure 7 lay on the line y = 0.125, because the untrained agent takes each action equally often from a uniform distribution.On the other hand, red dots for trained agent show that the agent takes blow-down moves (moves 6-8) with a probability of around 75% and takes blow-up moves (moves 1-5) with the remaining probability.This makes sense from the fact that blow-down moves can actually make the plumbing simpler and get a less punishment than blow-up moves.Especially, we see that the move 7, blow-down move of type (b), is the most frequent action and the move 1, blow-up move of type (a), is the least frequent action.This is explained by the fact that the move 1 is not helpful for the agent to get a simpler plumbing.
Before we jump into the conclusion, it is interesting to check whether or not the trained A3C agent is indeed maximizing the total return instead of immediate rewards by a simple example depicted in 8.The left plumbing in Figure 8 is a standard representation that realizes a 3-manifold known as a Brieskorn 3-sphere Σ(2, 3, 5), while the plumbing on the right represents a homeomorphic 3-manifold which can also be considered as the boundary of the E 8 manifold.As one can see immediately, the plumbing on the right in Figure 8 does not have nodes available for blow-down moves.Therefore, in order to get the left plumbing from the right one, the RL agent should take appropriate blow-up moves first, then taking available blow-down moves.This is why we take this example for the test.We notice that 6 actions are needed to turn one plumbing into the other in an optimal way.
The trained A3C agent successfully simplify the E 8 plumbing to the plumbing Σ(2, 3, 5) by taking 16 actions, while the trained DQN does not find a solution until the number of actions exceeds 50.This test ensures that the A3C agent indeed pursues not short-term rewards, but its maximal long-term return.

Conclusion
In this paper we have examined the GNN approach to the problems in 3-dimensional topology, which ask whether two given plumbing graphs represent a same 3-manifold or not, and whether or not it is possible to find out the sequence of Neumann moves that connects two plumbings if they are equivalent.
In Section 3, we used supervised learning to solve the binary classification of whether or not a pair of plumbings is equivalent.We built 3 models by combining graph convolution operators GEN, GCN and GAT, together with a certain graph aggregation module and an MLP as a classifier.We found that GEN+GAT model outperformed GCN+GCN and GCN+GAT models on randomly generated training datasets with maximal number N max = 40 of applied Neumann moves.GEN+GAT achieved about 95% accuracy while accuracy for the others is below 80%.We also tested those 3 models on randomly generated testsets with larger N max = 60 and N max = 80.Even though those models were trained by a training sets with N max = 40, it is an interesting point that, on such testsets, they still performed on a similar level to their training performance.
In Section 4, we utilized reinforcement learning to find out the sequence of Neumann moves that relates to a given pair of equivalent plumbings.We trained the agent such that it could find the simplest representation of a plumbing by using Neumann moves as its actions.We define the simplicity as a certain linear combination of number of nodes and sum of the absolute value of node features.We ran the trained agent on each of two equivalent plumbings until it arrived at two isomorphic plumbings.In this way, we can construct a sequence of Neumann moves connecting two equivalent plumbings.Using A3C algorithm, we see that the agent can find a sequence of Neumann moves in over 90% of randomly generated equivalent plumbing pairs even with N max = 100.This outperforms the DQN agent by a factor of around 1.5 when N = 60, and by more than a factor of 2 when N = 100.

Future work
In this paper we have used Geometric Deep Learning, GNN in particular, in the problem of classification of 3-manifolds up to homeomorphisms.We restricted to a special simple class of 3-manifolds corresponding to tree plumbing graphs.We hope to apply similar neural network models for more general 3-manifolds and also 4-manifolds in the future.One direct generalization would be considering 3-manifolds corresponding to general plumbing graphs described in [14], possibly disconnected, with loops, and with nontrivial genera assigned to the vertices 7 .This, in particular, would involve considering extra features associated to the vertices and also to the edges of graphs, as well as additional set of moves relating equivalent graphs.A more interesting generalization would be considering general Kirby diagrams for 3-manifolds.A Kirby diagram of a 3-manifold is a planar diagram of a link with an integer framing number assigned to each link component.The 3-manifold corresponding to the diagram is then obtained by performing Dehn surgery on this framed link.Two diagrams produce homeomorphic 3-manifolds if and only if they can be related by a sequence of Reidemeister moves (that do not change the isotopy class of the link) together with the so-called Kirby, or equivalently, Fenn-Rourke moves that do change the link but not the resulting 3-manifold (up to homeomorphism).Such a diagram can be understood as a 4-regular plane graph with additional data specifying the types of crossings in the link diagram and the framings of the link components.Alternatively, one can consider Tait graph associated to a checkboard coloring of the link diagram.For practical purposes, this presentation most likely will be more efficient.The Reidemeister, as well as Kirby/Fenn-Rourke moves then can be understood again as certain local operations on graphs associated with Kirby diagrams.The main new challenge would be incorporating the structure of the planar embedding of the graph in GNN.This can be done, for example, by specifying the cyclic order of edges at each vertex, or cyclic order of edges for each face of the plane graph.This additional structure should be taken into account in the layers of the network.This is not considered in most standard GNN architectures.A further step would be the problem of recognizing whether a pair of Kirby diagrams for 4-manifolds produces a diffeomorphic pair.Such Kirby diagrams are again framed link diagrams that also contain special "dotted" link components.There is a corresponding set of local Kirby moves that relate diagrams realizing diffeomorphic 4-manifold.For a comprehensive reference about the Kirby diagrams of 3-and 4-manifold we refer to [26].
have the same process, in which they apply Neumann moves iteratively up to N max times to each plumbing in the initial pair.Then they return the resulting pair as well as a variable, named label, which will be used for classification problem in Section 3. Notice that label = 1 for EquivPair and label = −1 for InequivPair.

• TweakPair
This algorithm generates an inequivalent pair of plumbings, but with the same graph structure.One plumbing is generated by RandomPlumbing, and the other is obtained by tweaking a copy of the first plumbing, i.e., by making a small change to a feature of a randomly chosen node.These two plumbings form an initial pair.Since the adjacency matrices of two plumbings are same, they have the same graph structure.However, due to the small change, two plumbings are inequivalent.Then the algorithm has the same structure as in EquivPair and InequivPair to apply random Neumann moves iteratively to each plumbing in the initial pair.

Figure 2 :
Figure 2: There are 3 different types of Neumann moves, which preserve the resulting 3-manifold up to homeomorphism.Considering the sign, one can count 8 Neumann moves.Among them, there are 5 blowup moves (by which a new vertex is created) and 3 blow-down moves (by which one or two vertices are annihilated).
Loss comparison on validation sets.

Figure 3 :
Figure 3: Overview of the performance and loss comparison between GEN+GAT, GCN+GAT and GCN+GCN models.

Figure 5 :
Figure 5: Two plumbings are equivalent and they have same number of nodes.The right-hand side plumbing is simpler than the left one in the sense of (4.1).

Figure 7 :
Figure 7: Comparison of the number of Neumann moves taken by a trained A3C agent and an untrained A3C agent to simplify plumbing.The values shown are the total number of Neumann moves of a given type divided by the total number of actions performed, aggregated over multiple examples.

Algorithm 1 Algorithm 2 Figure 9 :
Figure 9: An example of a pair of equivalent plumbing graphs generated by EQUIVPAIR with the number of Neumann moves fixed to N = 40.The graphs are successfully recognized as equivalent both by the RL agent trained by A3C algorithm considered in Section 4 and the GEN+GAT neural network considered in Section 3.
respect to the action of cyclic group Z |p| or order |p|, generated by (z 1 , z 2 ) → (z 1 e

Table 1 :
The architecture of 3 models with parameter values.
Figure 4: Performance comparison between 3 models, GEN+GAT, GCN+GAT and GCN+GCN on various Test sets.The error bars are not displayed in the figure since the standard errors on Test set 1, 2, and 3 are too small (smaller than 0.7) to notice.The standard errors on Test set 4 are about 2.64, 6.25, and 6.20 for GEN+GAT, GCN+GAT and GCN+GCN models, respectively.
such somewhat counter-intuitive property holds even for GCN+GAT and GCN+GCN models, which show less training accuracy than GEN+GAT.The second point is that GEN+GAT model still outperforms the others for Test set 4 and it can distinguish correctly even inequivalent pairs with the same determinants.Since GEN is designed for graph similarity learning and to have a good generalization, we can see that the model GEN+GAT outperforms significantly the others GCN+GCN and GCN+GAT, designed for general classification problems (with a relatively small number of classes), on various Test sets.