Basic graph formalization¶
A network is commonly represented as a graph , where is the set of nodes and is the set of edges.
Adjacency matrix¶
The adjacency matrix stores whether an edge exists between each pair of nodes:
The adjacency matrix requires space, but it allows constant-time edge lookup and makes linear algebra tools directly applicable.
One key relation is
where is an eigenvalue and is the corresponding eigenvector.
Adjacency list¶
The adjacency list representation stores, for each node, the set of its neighbors. It is more space-efficient for sparse graphs and typically requires space in an undirected graph because each edge is recorded twice.
Directed and weighted graphs¶
For a directed graph,
means there is an edge .
The number of incoming edges to node is its in-degree, and the number of outgoing edges is its out-degree.
In weighted graphs, edges carry magnitudes rather than just binary presence. In undirected weighted networks, the strength of node is
In directed weighted networks, we distinguish in-strength and out-strength.