liveBook · Manning

Node

As explained in Graph Neural Networks in Action

A node is a discrete element in a graph structure that can represent an entity such as an atom.

A node, also called a vertex, is an individual element of a graph. It represents an entity; an edge represents a relationship between entities. Nodes can carry features, such as a person’s age in a social network. Choose a graph representation when relationships matter alongside the properties of individual records. section 1.2.1 section 1.2.5

To turn data into a graph for a GNN:

  • Decide what counts as an entity. A passenger might be one node, or a graph might also contain nodes for cabins and families. section 1.2.5
  • Assign features to nodes and define edges from meaningful relationships. Passenger edges might represent family ties or a shared cabin; inferred ties may require assumptions or additional data. section 1.2.1 section 1.2.5
  • Prepare the resulting graph for training and inference, including sampling, batching, and train/validation/test splits that preserve its structure. section 1.5.1

Candidates and referrals

In a staffing network, each job candidate is a node and each referral is an edge. Treating referrals as undirected and ignoring repeats produces an unweighted graph. Those choices simplify the representation, but they also discard referral direction and frequency. section 8.1.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 lists nodes along both axes. An entry of 1 marks an edge between two nodes; its symmetry shows that the illustrated graph is undirected. section 1.2.1

A node need not correspond to an obvious row in a table. Investors can be nodes connected by co-investment; documents can be nodes connected by citations or shared topics. The useful test is whether the chosen entities and edges make relationships relevant to the task explicit. section 1.4.1

How Graph Neural Networks in Action covers it

How deep it goes
Defines nodes and features, then walks through entity selection and graph preparation without specifying a node data structure in code.
Examples
Uses passengers and cabins, co-investing investors, and job candidates linked by referrals to illustrate node choices.
What it assumes
Introduces nodes and edges from zero while working from familiar entity records and their attributes.
What you can do after
Build it from scratch by choosing entities as nodes, assigning features, and defining edges before GNN preprocessing.
How it connects
Connects nodes to edges, node features, adjacency matrices, tabular-to-graph conversion, and GNN preprocessing.

Also explained in

Compare how 19 books explain node →

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.