What is a graph?

Stephen M. Walker II · Co-Founder / CEO

What is a graph?

A graph is a mathematical structure that consists of nodes (also called vertices) and edges connecting them. It can be used to represent relationships between objects or data points, making it useful in various fields such as computer science, social networks, and transportation systems. Graphs can be directed or undirected, weighted or unweighted, and cyclic or acyclic, depending on the nature of the connections between nodes. This page covers the basic structure, components, and representations of a graph; the formal study of graph algorithms and theorems falls under graph theory.

What are the components of a graph?

The components of a graph are its nodes (vertices) and edges. Nodes represent objects or data points, while edges represent relationships between them. In a directed graph, each edge has an orientation indicating the direction of the relationship, while in an undirected graph, edges have no orientation. Weighted graphs assign numerical values to edges, representing the strength or cost of the relationship, while unweighted graphs do not.

What are the properties of a graph?

The properties of a graph include its order (number of nodes), size (number of edges), degree (number of edges connected to a node), and connectivity (ability to reach all other nodes from any given node). Other important properties include cycle detection, pathfinding, and clustering.

How can a graph be represented?

A graph can be represented in various ways, including adjacency matrices, adjacency lists, and edge lists. In an adjacency matrix, each row and column represents a node, with a 1 indicating the presence of an edge between them and a 0 indicating its absence. In an adjacency list, each node is associated with a list of nodes it is connected to. In an edge list, each edge is represented as a pair of nodes it connects.

What are the operations that can be performed on a graph?

Operations that can be performed on a graph include traversal (visiting all nodes in the graph), pathfinding (finding the shortest or most efficient path between two nodes), and clustering (grouping nodes based on their similarity). Other common operations include cycle detection, topological sorting, and graph coloring.

More terms

Continue exploring the glossary.

Learn how teams define, measure, and improve LLM systems.

Glossary term

What is AI Quality Control?

AI Quality is determined by evaluating an AI system's performance, societal impact, operational compatibility, and data quality. Performance is measured by the accuracy and generalization of the AI model's predictions, along with its robustness, fairness, and privacy. Societal impact considers ethical implications, including bias and fairness. Operational compatibility ensures the AI system integrates well within its environment, and data quality is critical for the model's predictive power and reliability.
Read term

December 8, 2023

Human in the Loop (HITL)

Human-in-the-loop (HITL) is a blend of supervised machine learning and active learning, where humans are involved in both the training and testing stages of building an algorithm. This approach combines the strengths of AI and human intelligence, creating a continuous feedback loop that enhances the accuracy and effectiveness of the system. HITL is used in various contexts, including deep learning, AI projects, and machine learning.
Read term

It's time to build

Collaborate with your team on reliable Generative AI features.
Want expert guidance? Book a 1:1 onboarding session from your dashboard.

Talk to sales