Counting Cycles in a Random Graph
In the binomial random graph \(G(n,p)\), each possible edge is chosen independently with probability \(p\). A useful way to study short cycles is to count how many cycles of each length the random graph contains, then add those counts. The calculation combines two ingredients: the number of possible cycles on the vertex set, and the probability that all edges of any one such cycle are present.
Throughout, graphs are finite and simple. A cycle of length \(k\) is an unoriented cycle with \(k\) distinct vertices, where changing the starting vertex or reversing the direction does not produce a new cycle. In \(G(n,p)\), take \(V=\{1,\ldots,n\}\); every unordered pair of distinct vertices is a possible edge, and each is included independently with probability \(p\), where \(0\le p\le1\).
The Expected Number of Cycles of a Fixed Length
First count the possible cycles before any edges are randomly selected. An ordered list of \(k\) distinct vertices specifies a cycle by joining consecutive vertices and joining the last back to the first. But each unoriented cycle is represented by \(2k\) such lists: there are \(k\) choices of starting point and two directions of traversal. Therefore the number of candidate cycles is \((n)_k/(2k)\), where \((n)_k=n(n-1)\cdots(n-k+1)\).
Proof. Let \(\mathcal{C}_k\) be the set of candidate cycles of length \(k\). For each \(C\in\mathcal{C}_k\), define \(I_C=1\) if all edges of \(C\) are present and \(I_C=0\) otherwise. Then \(X_k=\sum_{C\in\mathcal{C}_k} I_C\). The \(k\) edges of a candidate cycle are distinct, and edge selections are independent, so \(\mathbb{E}[I_C]=p^k\). By linearity of expectation, which does not require the indicators for different cycles to be independent, $$ \mathbb{E}[X_k]=\sum_{C\in\mathcal{C}_k}\mathbb{E}[I_C] =|\mathcal{C}_k|p^k =\frac{(n)_k}{2k}p^k. $$ If \(k>n\), there are not \(k\) distinct vertices available, so no cycle of length \(k\) exists. \(\square\)
The factor \(2k\) is essential: the count concerns cycles as subgraphs, not ordered descriptions of cycles. The formula also remains valid at \(p=0\), when the expectation is zero, and at \(p=1\), when every candidate cycle is present.
Worked Example: Expected Counts in \(G(6,1/2)\)
Take \(V=\{1,2,3,4,5,6\}\), with each of the \(\binom{6}{2}=15\) possible edges included independently with probability \(p=1/2\). Compute the expected number of cycles of each possible length.
For length \(3\), the number of candidates is \((6)_3/(2\cdot3)=(6\cdot5\cdot4)/6=20\). Each triangle requires three edges, so its probability is \((1/2)^3=1/8\). Thus \(\mathbb{E}[X_3]=20/8=5/2\).
For length \(4\), the number of candidates is \((6)_4/(2\cdot4)=(6\cdot5\cdot4\cdot3)/8=360/8=45\). Each requires four edges, with probability \((1/2)^4=1/16\). Thus \(\mathbb{E}[X_4]=45/16\).
For length \(5\), the number of candidates is \((6)_5/(2\cdot5)=(6\cdot5\cdot4\cdot3\cdot2)/10=720/10=72\). Each requires five edges, with probability \((1/2)^5=1/32\). Thus \(\mathbb{E}[X_5]=72/32=9/4\).
For length \(6\), the number of candidates is \((6)_6/(2\cdot6)=720/12=60\). Each requires six edges, with probability \((1/2)^6=1/64\). Thus \(\mathbb{E}[X_6]=60/64=15/16\).
Check: Counting candidates another way gives \(\binom{6}{k}(k-1)!/2\), since a chosen \(k\)-vertex set has \((k-1)!/2\) cycles. For \(k=3,4,5,6\), this gives \(20,45,72,60\), respectively, matching the counts above. Their total expected number is \(5/2+45/16+9/4+15/16=40/16+45/16+36/16+15/16=136/16=17/2\).
Adding the Counts Below a Threshold
The total number of cycles shorter than \(g\) is the sum of the counts at each allowed length. Applying linearity of expectation gives an exact expression, even though cycles can share edges or vertices. Such overlaps can make the indicators dependent, but they do not affect the sum of their expectations.
Proof. By definition, \(X_{<g}=\sum_{k=3}^{\min(g-1,n)}X_k\). Taking expectations and using linearity gives \(\mathbb{E}[X_{<g}]=\sum_{k=3}^{\min(g-1,n)}\mathbb{E}[X_k]\). Substituting the fixed-length formula proves the expression. If the sum is empty, there are no lengths in the specified range and both sides are zero. \(\square\)
Since \((n)_k\le n^k\), writing \(q=np\) yields a convenient upper bound: $$ \mathbb{E}[X_{<g}] \le \sum_{k=3}^{\min(g-1,n)}\frac{q^k}{2k}. $$ This bound replaces the falling product in the exact count by \(n^k\). For \(0\le q<1\), the finite sum is at most the corresponding infinite sum. Because \(1/(2k)\le1/6\) for \(k\ge3\), the geometric-series formula gives $$ \mathbb{E}[X_{<g}] \le \frac{1}{6}\sum_{k=3}^{\infty}q^k =\frac{q^3}{6(1-q)}. $$ The condition \(q<1\) is needed for this infinite-series bound. When \(q=1\), or when \(q>1\), use the finite sum instead.
Worked Example: Summing Short-Cycle Counts in \(G(10,1/10)\)
Take \(V=\{1,\ldots,10\}\), with every possible edge independently present with probability \(p=1/10\). Set the threshold to \(g=5\), so only cycles of lengths \(3\) and \(4\) count toward \(X_{<5}\).
There are \((10)_3/6=(10\cdot9\cdot8)/6=720/6=120\) candidate triangles. Each has probability \((1/10)^3=1/1000\), so \(\mathbb{E}[X_3]=120/1000=3/25\).
There are \((10)_4/8=(10\cdot9\cdot8\cdot7)/8=5040/8=630\) candidate 4-cycles. Each has probability \((1/10)^4=1/10000\), so \(\mathbb{E}[X_4]=630/10000=63/1000\). Adding the two expectations gives $$ \mathbb{E}[X_{<5}]=\frac{120}{1000}+\frac{63}{1000}=\frac{183}{1000}. $$
Check: Here \(q=np=10\cdot(1/10)=1\). The general finite upper bound is \(1^3/6+1^4/8=1/6+1/8=7/24\). The exact expectation is smaller: \(183/1000<7/24\), since \(183\cdot24=4392<7000=7\cdot1000\). This verifies the estimate using the same threshold and both relevant lengths.
Fixed \(np\) and a Sparse Parameter Choice
When \(p=c/n\), with fixed \(c\ge0\) and \(n\ge c\), the quantity \(np\) stays equal to \(c\). For each fixed \(k\), the exact expectation can be written as $$ \mathbb{E}[X_k] =\frac{c^k}{2k}\prod_{i=0}^{k-1}\left(1-\frac{i}{n}\right). $$ As \(n\) grows, each factor in this finite product tends to \(1\), so the expected count tends to \(c^k/(2k)\). If \(g\) is fixed, there are only finitely many lengths in the sum, and therefore $$ \mathbb{E}[X_{<g}] \longrightarrow \sum_{k=3}^{g-1}\frac{c^k}{2k}. $$ When \(g=3\), this sum is empty and equals zero. The conclusion follows by taking the limit of each term in a finite sum; it does not require any independence between cycle indicators.
Another useful choice, for fixed \(g\ge4\), is \(p=n^{-1+1/(g-1)}\). For \(n\ge1\), this is a valid probability, and \(np=n^{1/(g-1)}\). The bound on the short-cycle expectation becomes $$ \mathbb{E}[X_{<g}] \le \sum_{k=3}^{\min(g-1,n)}\frac{n^{k/(g-1)}}{2k} \le n\sum_{k=3}^{g-1}\frac{1}{2k}. $$ The last inequality holds because \(k\le g-1\), so \(k/(g-1)\le1\), and \(n^{k/(g-1)}\le n\) for \(n\ge1\). For fixed \(g\), the right side is a constant depending on \(g\) times \(n\).
Worked Example: Estimating Short Cycles When \(g=6\)
Take the fixed threshold \(g=6\), vertex set \(V=\{1,\ldots,n\}\), and edge probability \(p=n^{-4/5}\) for \(n\ge1\). Cycles shorter than \(6\) have lengths \(3,4,5\), subject to the additional restriction \(k\le n\).
Here \(np=n\cdot n^{-4/5}=n^{1/5}\). For length \(3\), the upper-bound term is \((np)^3/6=n^{3/5}/6\). For length \(4\), it is \((np)^4/8=n^{4/5}/8\). For length \(5\), it is \((np)^5/10=n/10\). Thus $$ \mathbb{E}[X_{<6}] \le \frac{n^{3/5}}{6}+\frac{n^{4/5}}{8}+\frac{n}{10} \le \left(\frac16+\frac18+\frac1{10}\right)n =\frac{47}{120}n. $$ The second inequality uses \(n^{3/5}\le n\) and \(n^{4/5}\le n\) for \(n\ge1\); if \(n<5\), omitting unavailable lengths only decreases the bound.
Check: The coefficient is obtained with common denominator \(120\): \(1/6=20/120\), \(1/8=15/120\), and \(1/10=12/120\), so the sum is \(47/120\). For each included length, the bound used is \((n)_k\le n^k\), followed by \(n^k p^k=n^{k/5}\). This confirms each term and the final linear estimate.
A Common Counting Pitfall
Do not count rotations and reversals as different cycles. For example, on \(V=\{1,2,3,4,5\}\) with edge probability \(p=1/2\), an ordered triple of distinct vertices gives a description of a candidate triangle. There are \(5\cdot4\cdot3=60\) such descriptions, but each triangle is described \(2\cdot3=6\) times. The incorrect calculation \(60(1/2)^3=60/8=15/2\) treats all descriptions as different cycles. The correction is to divide the candidate count by \(6\): there are \(60/6=10\) distinct triangles, so the expected number is \(10(1/2)^3=10/8=5/4\). As a direct check, there are \(\binom{5}{3}=10\) vertex triples and exactly one triangle candidate on each triple.
Also distinguish an expected count from a guaranteed count. A positive expectation does not assert that every graph in the model has a cycle; it is an average over the random choices of edges. For estimating the average number of short cycles, count each possible cycle once and sum its probability of appearing. The calculation remains valid even when different cycles overlap.
Check Your Understanding
Use the cycle-count formula and its hypotheses to answer the following.
- For \(G(8,1/4)\), compute the expected number of 3-cycles from the candidate count and the probability that a particular triangle appears.
- For \(G(n,p)\), derive an upper bound for \(\mathbb{E}[X_{<g}]\) in terms of \(np\), and state the condition needed for the infinite geometric-series bound.
- Explain why the indicators for different cycles need not be independent for the sum formula for \(\mathbb{E}[X_{<g}]\) to hold.
- For fixed \(k\) and \(p=c/n\), rewrite the exact expectation using a finite product and find its limit as \(n\) grows.
- For \(g=5\) and \(p=n^{-3/4}\), use the finite-sum bound to give an upper bound proportional to \(n\) for the expected number of cycles shorter than \(5\).