A data structure of nodes and edges used to model relational data in AI.
A graph is a mathematical structure composed of vertices (nodes) and edges (connections between nodes), forming a flexible framework for representing relationships among entities. Unlike tabular or sequential data, graphs capture the topology of interactions directly — whether those entities are users in a social network, atoms in a molecule, or routers in a communication network. Edges can be directed or undirected, weighted or unweighted, and graphs can encode rich structural information that flat data formats cannot easily express.
In machine learning, graphs serve as both input representations and computational scaffolding. As input, they allow models to reason over relational data where the connections between entities carry as much meaning as the entities themselves. As computational structures, graphs underpin frameworks like computational graphs used in automatic differentiation, where operations and their dependencies are traced as directed acyclic graphs (DAGs) to enable efficient gradient computation during backpropagation.
The most significant recent development in graph-based ML is the rise of graph neural networks (GNNs), which extend deep learning to non-Euclidean domains. GNNs operate by iteratively aggregating feature information from a node's neighbors, allowing the model to learn representations that reflect both local structure and global context. This paradigm has proven powerful across diverse applications: predicting molecular properties in drug discovery, detecting fraudulent transactions in financial networks, improving traffic forecasting, and powering knowledge graph completion tasks.
Graphs matter in AI because many real-world problems are fundamentally relational, and forcing relational data into non-relational formats loses critical structural information. As datasets grow more interconnected — spanning social platforms, biological systems, and infrastructure networks — graph-based methods have become essential tools for capturing the full complexity of the world. The ability to learn directly from structure, rather than hand-engineering relational features, represents a meaningful expansion of what machine learning systems can model and understand.