liveBook · Manning

Recurrence

As explained in Advanced Algorithms and Data Structures

A recurrence relation is an equation that defines a sequence or function in terms of values for preceding or smaller instances.

A recurrence relation defines a sequence or function from preceding or smaller instances. In recursive algorithm analysis, it expresses how a problem's running time grows as recursive calls generate smaller inputs. section 15.2.4

Analyze a recursive algorithm by identifying:

  • The recursive branching pattern, such as calls over every remaining vertex and edge. section 15.2.4
  • The base case, which determines the recurrence's initial value. section 15.2.4
  • The resulting growth rate and whether repeated subproblems make the algorithm impractical. section 15.2.4

Factorial growth

For T(n) = n · T(n−1) with T(0) = 1, the solution is T(n) = n!. A recursive graph algorithm with vertex and edge branching grows even faster, restricting it to small graphs. section 15.2.4

T(n,m) = n * T(n-1, m) + m * T(n, m-1)
T(0,0) = 1
T(0,*)=1
T(*,0)=1

Inspect the two-variable recurrence and its boundary conditions for a graph algorithm that removes vertices or edges recursively. section 15.2.4

How Advanced Algorithms and Data Structures covers it

How deep it goes
Defines recurrences, identifies base cases, and solves a factorial example, but defers broader solution techniques to an appendix.
Examples
Uses graph planarity testing, T(n)=nT(n−1) with T(0)=1, and a three-vertex recursion example.
What it assumes
Assumes familiarity with recursive calls, base cases, graphs, and running-time analysis.
What you can do after
Diagnose recursive algorithms by deriving growth rates and recognizing factorial behavior that limits practical input size.
How it connects
Connects recurrence relations with recursion trees, base cases, running time, factorial growth, and repeated computation.

Also explained in

Compare how 3 books explain recurrence →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.