AI engineering glossary · Data structures algorithms

What is connected components?

Connected components: The maximal groups of vertices in an undirected graph in which every vertex can reach every other through some path. They are found by running breadth-first or depth-first search from each unvisited vertex.

Level: intermediateTopic: Data structures algorithms

Connected components: an example

A friendship graph with two separate clusters of people who never interact has 2 connected components.

Related terms

More Data structures algorithms terms

Where you learn it

Connected components is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.