The number of connected components in the context of cyclomatic complexity Cyclomatic Complexity is defined with reference to the control flow graph of the program through this formula (borrowed from Wikipedia):
M = E − N + 2P,
where
E = the number of edges of the graph.
N = the number of nodes of the graph.
P = the number of connected components.

I can't understand the last. What is &quot;the number of connected components&quot; in this context? Wikipedia itself uses the notion of (connected) components in relation to undirected graphs only.
There is also the concept of strongly connected component: a directed graph is said to be strongly connected if every vertex is reachable from every other vertex. So one can guess that the number of connected components is the number of strongly connected components of the control flow graph. Is it right? If not, can someone provide samples of control flow graphs with differerent numbers of connected components?
When they say connected component, they mean a weakly connected component. Take a look at the third formula they provide in the Wiki.

For a single program (or subroutine or method), P is always equal to 1. So a simpler formula for a single subroutine is M = E − N + 2.

This implies that for $P &gt; 1$ is used for multiple programs. In other words, it is used for programs with multiple start points with distinct end points.
So for the first formula, it takes in consideration of multiple programs, subroutines, or methods that are completely disconnected from each other (i.e. they do not call upon or interfere with each other) in a single program control graph.
The following is an example where the first formula would be applied. Here $M = 9 - 8 + 2*2 = 5$.