Introduction to GNNs
To understand GNNs, we will start with reviewing the graph data structure. That said, so what is a graph? In computer science, it refers to a data structure containing two components: nodes (or vertices) and edges, where nodes typically represent things or objects, such as a person, place, or thing, and edges connect the nodes, for example, by representing the relationship between the nodes. Figure 6.1 shows a graph with persons as nodes and their relationships as edges. Note that the edges are drawn as arrows, which indicates that this is a directed graph wherein there is a strict order in relationships (B is the parent of A, not the other way round). Undirected graphs, on the other hand, have edges that can be traversed both ways (think of the sibling relationship) and are drawn as straight lines between nodes.
Figure 6.1: Example graph containing people (nodes) and their relationships (edges)
In technical terms, a graph can be represented as
...