AI engineering glossary · Data structures algorithms

What is cycle detection?

Cycle detection: Determining whether a graph contains a path that starts and ends at the same vertex. In directed graphs it is done with depth-first search by watching for an edge pointing back to a vertex on the current path.

Level: intermediateTopic: Data structures algorithms

Cycle detection: an example

If task A needs B, B needs C and C needs A, cycle detection reports a circular dependency that blocks the build.

Related terms

More Data structures algorithms terms

Where you learn it

Cycle detection 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.