An undirected edge represents a connection that works equally in both directions between two nodes. Its source and target labels identify the endpoints, but their order does not change the relationship. section 12.1
Represent undirected edges by following these practical rules:
- Store one edge for each connected node pair in an edge list with source and target columns. section 12.1
- Treat source and target interchangeably when the relationship has no meaningful direction. section 12.1
- Attach a weight when the connection has measurable strength, such as the number of shared scenes. section 12.1
- Duplicate each edge in both directions when converting it for an adjacency matrix, producing symmetric matrix entries. section 12.2
Shared scenes in Romeo and Juliet
An edge connecting Lady Capulet and the Nurse has weight 1 because they share one scene. The Nurse and Juliet Capulet have weight 2. Either character can appear as source or target. section 12.1
Figure 12.2 Network edges have a source and a target. In directed networks, the direction of the connection is meaningful and often represented by an arrow. In undirected networks, there’s no specific direction to the relationship.
Compare undirected edges with directed edges: arrows express meaningful direction only for the directed case. section 12.1
Figure 12.4 Adjacency matrix of Romeo and Juliet. The characters, or nodes, are listed along the x-axis and y-axis, while the number of scenes they share, the edges, are communicated by the filled grid squares. The darker the square, the more scenes the two characters share. Adjacency matrices of undirected networks are symmetric, but they can also visualize directed networks, for which they become asymmetric.
See how undirected edges become symmetric filled cells in an adjacency matrix, with darker cells representing larger weights. section 12.2
