Graph
A graph is a triple
G=(V,E,W)
where
- V is an index set,
- E⊆V×V,
- W:E→R.
The graph is unweighted if
W:E→{0,1}.
Undirected Graph
Undirected graphs can be defined similarly to the definition above. Keeping the same definition as a graph above, except changing the collection of edges,
E⊆{{i,j}:i,j∈V}
However, every undirected graph can be embedded by a directed graph with the new set of edges,
Edir={(i,j),(j,i)∣{i,j}∈E}.
Note that this is still technically incompatible with the undirected graph definition above as Edir is a set of ordered pairs, and not sets. For the rest of these notes I will treat undirected graphs as the directed graph embedding the same structure to avoid inconsistencies.
Graph Signal
For ∣V∣=n, a graph signal is a function
x:V→R.
Here, the signals of the entire graph can be represented in one vector,
x∈Rn.
Each element in this vector corresponds to the signal in the respective node. So x is the signal for the entire graph, not a single node. It's worth noting here that GNNs, going forward, can embed higher dimensional vector per node and will not be restricted to scalar values.
Neighbourhood
Na={j∈V s.t. (a,j)∈E}
Or, in directed graphs,
Naout={j∈V s.t. (a,j)∈E}
Nain={j∈V s.t. (j,a)∈E}
Adjacency Matrix
For ∣V∣=n, the adjacency matrix A∈Rn×n has elements
Aij={W(i,j),0,(i,j)∈E,otherwise.
Degree
For undirected graphs,
d(i)=j∈V∑Aij.
For directed graphs,
dout(i)=j∈V∑Aij,din(i)=j∈V∑Aji.