liveBook · Manning

Edge

As explained in Graph Neural Networks in Action

An edge is a graph element representing a relationship or connection between nodes and optionally carrying attributes or properties.

An edge, also called a link, represents a relationship between two nodes in a graph. Where a table records features in rows and columns, edges make connections explicit so they can be analyzed alongside the entities they connect. section 1.2.1

Defining edges means deciding what a connection should express:

  • Choose a relationship supported by the data. Passengers might be linked because they are family members, share a cabin, or traveled together; links inferred from names or ticket numbers may require assumptions. section 1.2.5
  • Choose whether direction matters. In an undirected graph, a connection from A to B also connects B to A; its adjacency matrix is symmetric. section 1.2.1
  • Choose whether every connection has equal strength. A binary adjacency matrix records presence with 1 and absence with 0; a larger value can instead give an edge more weight. Edges can also carry attributes, such as investment size or timing. section 1.2.1 section 1.4.1
Table 1.1 The adjacency matrix for the simple graph in figure 1.1
A
B
C
D
E
A
0
1
0
0
1
B
1
0
1
1
1
C
0
1
0
1
0
D
0
1
1
0
1
E
1
1
0
1
0

The adjacency matrix shows the same undirected connections in both directions: its upper-right entries mirror its lower-left entries. section 1.2.1

Turning referrals into edges

Represent job candidates as nodes and referrals between them as edges. If referral direction and repeated referrals are ignored, the result is an undirected, unweighted network. Those choices simplify the graph but discard information that another project might need. section 8.1.1

Edge selection is an early GNN project decision, not just a formatting step. Decide which relationships and features belong in the graph before storage, preprocessing, data splitting, and model training. Shared activities can supply useful edges even when no formal relationship is recorded—for example, connecting investors who co-invest in a company. section 1.4.1 section 1.5.1

How Graph Neural Networks in Action covers it

How deep it goes
Defines links, illustrates binary and weighted adjacency entries, and discusses graph-construction choices without specifying edge-level model internals.
Examples
Uses passenger family and cabin ties, investor co-investment, and job-candidate referrals to illustrate possible edges.
What it assumes
Introduces nodes and edges through simple connections, using familiar tabular data as a contrast.
What you can do after
Build it from scratch by choosing relationships, direction, weights, and attributes before preparing a graph for a GNN.
How it connects
Connects nodes, adjacency matrices, undirected graphs, edge weights, edge attributes, and graph neural networks.

Also explained in

Compare how 18 books explain edge →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Neural Networks in Action. The section links point to the parts of the book it draws on.