liveBook · Manning

Cycle

Also called loop

A cycle is a path in a graph that starts and ends at the same vertex.

How 6 Manning books explain it

Grokking Data Structures

A cycle is a path in a graph that starts and ends at the same vertex.

How it is used
Uses cycle detection to determine whether a graph is acyclic.
How deep it goes
Defines cycles through paths, distinguishes loops, and explains DFS color states for detecting them.
Examples
Uses a follower graph involving Giraffe, Crocodile, and Monkey to show both longer and smaller cycles.
What you can do after
Diagnose/debug with it by recognizing cycles and applying DFS color marking to test graph acyclicity.

Read how Grokking Data Structures explains cycle →

Optimization Algorithms: AI techniques for design, planning, and control problems

A cycle is a closed path in a graph that begins and ends at the same vertex.

How it is used
Supports graph classification and dependency analysis, especially when checking whether task schedules contain circular precedence constraints.
How deep it goes
Defines cycles and contrasts them with acyclic graphs, but does not develop cycle-detection algorithms beyond an acyclicity check.
Examples
Uses a small NetworkX graph with vertices 1, 2, and 3 forming a cycle, alongside a directed acyclic scheduling graph.
What you can do after
Evaluate graph structure by recognizing cycles and verifying whether a directed graph is acyclic with NetworkX.

Read how Optimization Algorithms: AI techniques for design, planning, and control problems explains cycle →

Graph Neural Networks in Action

A cycle is a graph path that begins and ends at the same node without repeating intermediate nodes.

How it is used
Classifies graph structure and flags cyclic patterns during data validation for graph analytics and machine learning.
How deep it goes
Defines return paths, contrasts cyclic and acyclic graphs, and stops short of algorithmic cycle detection.
Examples
Uses the path A-E-D-C-B-A and an isolated candidate group whose relationships form a cycle.
What you can do after
Diagnose graph data by identifying cycles and checking whether analytical tools handle isolated cyclic groups.

Read how Graph Neural Networks in Action explains cycle →

100 Java Mistakes and How to Avoid Them

A cycle is a path in a graph or linked data structure that eventually returns to an element already visited.

How it is used
Frames cycles as a hazard when recursively traversing structures expected to be trees or directed acyclic graphs.
How deep it goes
Explains repeated state, stack growth, StackOverflowError, visited-node tracking, and self-referential collection behavior.
Examples
Uses self-referential lists, indirect collection cycles, recursive tree traversal, and finite-versus-infinite recursion diagrams.
What you can do after
Diagnose infinite recursion by checking for cycles, track visited elements when cycles are legal, or repair unintended structure mutations.

Read how 100 Java Mistakes and How to Avoid Them explains cycle →

Algorithms Every Programmer Should Know

A closed path in a graph that returns to its starting vertex.

How it is used
Explains how cycles distinguish interconnected graphs from hierarchical trees and affect graph traversal.
How deep it goes
Defines cycles and explains the traversal problem they cause, stopping at the use of a visited set.
Examples
Uses a closed-loop graph and illustrates DFS and BFS paths through it.
What you can do after
Understand how cycles can make DFS or BFS revisit nodes and why traversals track visited nodes.

Read how Algorithms Every Programmer Should Know explains cycle →

Outlier Detection in Python

A recurring temporal pattern in which values or behavior repeat over successive periods.

How it is used
Uses recurring patterns to provide temporal context for time-series outlier detection.
How deep it goes
Explains variable-length repetition, contrasts seasonality, and applies decomposition without deriving its internals.
Examples
Uses temperatures, network traffic, sales calendars, and regularly repeating spikes as concrete cases.
What you can do after
Apply it via time-series decomposition to separate recurring structure from residual behavior and assess contextual anomalies.

Read how Outlier Detection in Python explains cycle →

Also covered in

What to know first

Related concepts

Questions about cycle

What is cycle?

A cycle is a path in a graph that starts and ends at the same vertex.

Which Manning books explain cycle?

Grokking Data Structures, Optimization Algorithms: AI techniques for design, planning, and control problems, Graph Neural Networks in Action, 100 Java Mistakes and How to Avoid Them, Algorithms Every Programmer Should Know and Outlier Detection in Python.

What should I know before learning cycle?

Manning books that teach cycle usually introduce edge, directed acyclic graph, node and Python first.

What is the difference between cycle and tree?

A cycle is a path in a graph that starts and ends at the same vertex. A tree is a connected, acyclic structure of nodes organized through parent-child relationships, typically around a single root.

What kinds of cycle are there?

Kinds of cycle include negative-weight cycle.

What is cycle a kind of?

Cycle is a kind of edge. An edge is a connection between two vertices or nodes in a graph or related structure, representing a relationship and optionally carrying direction, labels, or weights.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.