AI Glossary / Graphs and symbolic AI / Beginner
Node
Definition
A node is an individual element of a graph or tree, often representing an entity, state, variable, or operation. Connections between nodes are called edges. The exact meaning of a node depends on the model: a node might represent a person in a social network, a position in a search problem, or a test in a decision tree.
What it means
The word describes a structural role rather than a particular kind of real-world object. A graph becomes useful when its designer states what the nodes represent and what their connections mean. Drawing circles and lines alone does not establish those meanings.
Nodes can also carry attributes such as a name, type, capacity, or feature vector. Their identity should be distinguished from those attributes. Two different people can share the same name, while one person can change a displayed name without becoming a different entity. Good graph modeling keeps these cases separate.
How it works
A graph is commonly described using a set of vertices, or nodes, and a set of edges connecting them. In an undirected graph, a connection has no preferred direction. In a directed graph, edges have a source and destination. A node's neighbors are defined by the relevant edge relationships.
Trees add particular structural restrictions and terminology, such as root, parent, child, and leaf. A search-tree node may record a state together with the path or parent through which the search reached it. Consequently, two search nodes can represent the same underlying state reached by different routes.
Graph software stores node identifiers and associated data. The chosen graph type determines whether features such as parallel edges or self-loops are allowed. These implementation choices must match the intended model rather than being inferred from the informal word node.
Three practical examples
- Knowledge graphs: represent products, documents, organizations, or concepts as nodes connected by typed relationships.
- Search algorithms: represent possible states or search records while exploring routes toward a goal.
- Machine learning: use nodes in decision trees or graph models, where each node has a role defined by that particular architecture.
Think of it this way
Think of pins on a map, with threads showing connections. Each pin identifies something in the model, while its label provides additional information.
The analogy is limited because nodes need not represent physical locations. They can represent abstract propositions or computations, and their position in a diagram may be chosen only for readability. A visually central node is not necessarily important according to any graph metric.
Worked example
Build an undirected collaboration graph with four nodes: Ava, Ben, Cora, and Dev. Add edges Ava - Ben, Ava - Cora, and Ben - Cora. Dev has no edges.
The graph contains four nodes and three edges. Ava, Ben, and Cora each have degree two because each connects to the other two. Dev has degree zero and is called an isolated node. The sum of degrees is 2+2+2+0=6, twice the number of edges, as expected for this simple undirected graph.
Now suppose a second person named Ava joins. Using the displayed name as the sole identifier could merge two people into one node. Instead, use distinct identifiers, such as person_17 and person_42, with “Ava” as a shared name attribute. The graph then contains five people even though it has only four distinct displayed names.
Finally, consider a search that reaches location C by paths A→B→C and A→D→C. These may create two search-tree nodes carrying state C, because they have different parents and paths. A graph-search method may detect the repeated state and decide how to handle it. Counting search records is therefore not always the same as counting distinct modeled states.
Illustrative case study
Fictional case: a service company connects customer records in a support knowledge graph. Its first import uses names as node keys, causing unrelated customers with identical names to share one history.
The team switches to stable identifiers and treats names as editable attributes. It also defines whether an edge means “same household,” “contacted support,” or “owns product,” instead of placing all connections into one undifferentiated relation. The fictional case illustrates identity and relationship design; it does not claim a measured service improvement.
Common misconceptions and mistakes
A node is not automatically a neuron, a computer, or a database record. Those are possible meanings in particular systems. Context is needed before interpreting a diagram or an algorithm description.
Do not confuse a node with an edge. A supplier can be a node, while “supplies to” is a relationship represented by an edge. Some modeling tasks can represent relationships as nodes too, but that is an explicit modeling choice.
Also, node count alone says little about difficulty or quality. Edge density, graph structure, attributes, and the algorithm's task can matter just as much. A small graph with poorly defined identities can be less useful than a larger well-defined one.
Business use
Clear node definitions are essential when connecting business information across systems. Specify the represented entity type, identifier rules, attribute ownership, and merge policy. These decisions affect counts, search results, and downstream learning.
Before using graph analytics, inspect representative nodes and their neighbors with domain experts. Confirm that an edge means what the analysis assumes. A centrality score or recommendation can be mathematically correct yet misleading if separate entities were merged or different relationship types were combined without justification.
People also ask
Is a node the same as a vertex?
In graph terminology, the words are commonly used interchangeably.
Can a node exist without any edges?
Yes. It is an isolated node, and it still counts as part of the graph.
Can two search nodes contain the same state?
Yes. Different paths can produce separate search records for the same underlying state.
Check your understanding
A graph has nodes P, Q, and R, with only edge P - Q. How many nodes are present, and what is R's degree?
Answer: There are three nodes, and R has degree zero.
Related terms
- Graph
- Tree (abstract data type)
- Neighbor
- State space
- Search tree
- vertex
- edge
- tree
- degree
- node attribute
- entity resolution
Learn next
model a small familiar network and write one sentence defining its nodes and another defining its edges. Then compare directed and undirected versions and observe how neighbor relationships change.
More in Graphs and symbolic AI
- Newton-Raphson - Newton-Raphson is an iterative numerical method for finding a root of a function: an input x for which f(x)=0.
- No-good - A no-good is a combination of variable assignments that cannot be extended into a valid solution of a constraint satisfaction problem.
- No-regret learning - No-regret learning is a way of making repeated decisions so that the learner's average performance approaches that of a specified hindsight benchmark.
- Noise-based logic - Noise-based logic is a research approach in which distinguishable noise signals represent logical values and specially designed operations manipulate those...
- Non-randomness - Non-randomness, in the supplied graph-analysis context, is a spectral measure intended to characterize structure in a network relative to a random-graph model.
- Nonlinear constraints - Nonlinear constraints are restrictions on decision variables that involve relationships beyond linear combinations, such as products of variables, squares...
Sources
NetworkX's official Graph documentation explains nodes, edges, identifiers, attributes, and graph-type behavior: https://networkx.org/documentation/stable/reference/classes/graph.html
The collaboration graph and fictional customer case are original illustrations. The article distinguishes general graph nodes from the additional path information often held by search-tree nodes.
Previous: No-U-turn sampler Next: Node Classification