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.
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
- Data structure
- Depth-first search
- Deque
- Dijkstra's algorithm
- Directed acyclic graph
- Divide and conquer
- Doubly linked list
- Dynamic array
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.