Graphs are probably the most versatile and the most important construction when we refer to representation. They are astonishly ubiquitous. We can describe practically any system of relations or interactions as a graph. This is true at nano scales where we can model individual molecules, to micro scale where we can look at different interactions between biological entities like molecules, drugs and proteins modelled in interactomes, to finally concluding at macro scale by modelling social graphs of people.
Conceptualization: When we think of a graph, we think about a system of relations and interactions between its elements.
A graph is a collection of vertices and edges, each edge links a pair of vertices, defining a relationship of incidence between vertices and edges. There are several variations on the idea.
Let
-
$$V^{2}$$ is the cartesian product of$$V$$ with itself, the sed of ordered pairs$$(x,y)$$ of vertices. -
$$\Delta_{V}$$ is the diagonal subset of$$V$$ , the set of pairs$$(x,x)$$ , so that its complement$$V^2 \setminus \Delta_V$$ is the set of pairs as above where$$x \neq y$$ . -
$$\left\langle{V \atop 2}\right\rangle$$ is the quotient set of$$V^{2}$$ in which$$(x,y)$$ is identified with$$(y,x)$$ , the set of unordered pairs$${x,y}$$ of vertices.
This brings us with the following types of graphs according to their ordering:
- Undirected graphs
- Directed graphs
- Undirected graphs as directed graphs with an involution
We can also attach some features to the nodes that will be modeled as d-dimensional vectors. For example, in a social network graph, each node might contain information relative to the user of the node such as age, height, sex... For the sake of simplicity we are going to ignore possible features linked to edges, but they could exist.
Machine Learners | Labeling RAAM (1994) | Backpropagation through structure (1996) | Graph Neural Networks (2008) | Gated GNN (2015) |
Graph Theorists | Weisfeiler-Lehman kernels (2009) | k-GNN | GIN (2019) | Provably powerful GNN |
Chemists | ChemNet (1995) | Neural descriptors (1997) | Molecular graph net (2005) | Molecular fingerprints (2017) |
The term graph neural networks first appeared in a series of papers by the group of research conformed by M. Gore and F. Scarselli. But graph theory research argue that graph neural networks are just a rebranding of a graph isomorphism test called the Weisfeiler-Lehman test (1968). This test address a classical graph theory problem that tries to determine if 2 graphs are isomorphic or have the same connectivity up to reordering the nodes.
NOTE: Nowadays there isn't any algorithm that can compute and solve the Weisfeiler-Lehman Test in polynomial time. Only solvable in polynomial time up to graphs with 9 nodes. Indeed this problem was proved to have a computational solution in quasi-polynomial
The key structure of a graph or a set is that it's unordered. We don't have a canonical way to order its nodes. Thus when we number the nodes of an graph, for example the above one, we are partially cheating.
It's convenient because we can now organize the nodes features into a matrix of dimensions
The adjacency matrix for a graph with
The representation of the adjacency matrix depends on the selected ordering to the set of nodes.
Conclusion: If we number the nodes differently implies that the rows of the feature matrix and corresponding rows and columns of the adjacency matrix will be permuted accordingly. We denote this permutation matrix by
NOTE: The representation differs with respect to the type of the object. The permutation group acts differently on vectors and matrices.
Strong precondition needed: In order to implement a function acting on a graph that produces a single output for the entire graph, it's mandatory to assert that this single value generated output is unaffected by the chosen ordering of the input nodes. Independently of the ordering of the nodes, the computed output for the same graph must be always the same, although the nodes were or not rearranged.
In this scenario it's convenient that the output of the function changes harmoniously to the fluctuations in the input with the reordering of the nodes. $$ F(PX,PAP^{\top})= PF(X,A) $$
A multiset is like a set, just allowing that the elements have multiplicities. Thus the multiset
It is common to define them in terms of sets and functions.
A
This is the main operation of a classical Graph Neural Network architecture.
Question: How this operation works? Answer: For each node in the graph we look at the neighbors and take the feature vectors that together conforms the multiset. Even though the indices of the neighbors are unique, the feature vectors are not necessarily unique.
NOTE: In this example, we have the blue feature repeated twice. Two nodes have the same feature vector. In this scenario we dealing with a multiset. (See section 5.1 Multiset)
Now we try to aggregate these features together with the feature vector of the node itself. It must be done in a permutation invariant way because we don't have a canonical ordering of the neighbors on a graph.
If we apply this
This local aggregation function on GNN typically looks as follows:
-
$$\textcolor{Cyan}{permutation : invariant : aggregation : operator, : e.g. : sum}$$ : It is often sum or maximal. -
$$\color{Orange}{learnable :functions} : \Psi$$ :-
$$\psi$$ : This function transforms the neighbors features. It's a non linear function that depends on both feature vectors of node$$i$$ and$$j$$ . Its output can be seen as a message that is sent from node$$j$$ to update node$$i$$ . That's why this architecture is also called message passing graph neural networks. -
$$\phi$$ : Updates the features of node$$i$$ using the aggregated features of the neighbors.
-
-
$$\textcolor{DarkOrchid}{new : feature : of : node : i}$$ :$$f : x_i \to x'_{i}$$