# A General Computational Approach for Counting Labeled Graphs
## 3 Methods  
This section first presents a general recursive formula to estimate the number of labeled graphs; details for specific graph properties, e.g., degree distribution, follow afterwards. Equation (1) provides a recursive formula to estimate the number of graphs, \(|c_{\phi_{i}}(x_{k})|\), with specific value(s), \(x_{k}\), for particular graph properties associated with \(\phi_{i}\):  
\[|c_{\phi_{i}}(x_{k})|=r_{\phi_{i}}(x_{k},x_{k-1})*|c_{\phi_{i}}(x_{k-1})|, \tag{1}\]  
where \(r_{\phi_{i}}(x_{k},x_{k-1})\) is the ratio between the sizes of fibers \(c_{\phi_{i}}(x_{k})\) and \(c_{\phi_{i}}(x_{k-1})\), i.e.,  
\[r_{\phi_{i}}(x_{k},x_{k-1})=\frac{|c_{\phi_{i}}(x_{k})|}{|c_{\phi_{i}}(x_{k-1} )|}. \tag{2}\]  
[PERSON] et al. [13] provides equations to calculate \(r_{\phi}(x_{i},x_{i-1})\) for a range of graph properties including number of edges, classification mixing, degree distribution, degree mixing, and number of triangles (controlling for degree mixing) when \(x_{i}\) and \(x_{i+1}\) are specified such that there exists graphs \(G_{i}\) and \(G_{i-1}\) where:  
\( \begin{array}{ll}s1&G_{i}\text{ and }G_{i-1}\text{ differ by the presence or absence of a single edge;}\\ s2&\phi_{i}(G_{i})=x_{i}\text{; and}\\ s3&\phi_{i}(G_{i-1})=x_{i-1}.\end{array} \)  
To make use of the recursive formula and previous work by [PERSON] et al. [13], it is necessary to specify a sequence of values \(\{x_{0},\ldots,x_{k}\}\) such that there exists graphs \(\{G_{0},\ldots,G_{k}\}\) where each consecutive pair satisfies \(s1-s3\). In addition, we need to be able to calculate \(|c_{\phi_{i}}(x_{0})|\). Although there is no constraint on \(x_{0}\), it is often useful to set \(x_{0}\) equal to the specific value of the graph properties associated with the empty graph; hence, typically, \(|c_{\phi}(x_{0})|=1\). Throughout this paper, we follow this approach. In the sections below, we provide details for calculating \(|c_{\phi_{i}}(x)|\) for when \(\phi_{i}\) and \(x\) are associated with a given number of edges, degree distribution, degree sequence, classification mixing matrix, and degree mixing matrix. Graph Enumeration Problem: Calculate the Number of Labeled Graphs of Size \(n\) with \(m\) Edges  
In this section, we calculate \(|c_{\phi_{i}}(m)|\). To address this graph enumeration problem, we specify the following sequence of number of edges for the recursive procedure: \(x_{0},\ldots,x_{k}=m\) where \(x_{i}=i\). Theorem 3.1 proves that there exists a collection of graphs that is consistent with this specification of number of edges, i.e., there exists a collection of graphs \(G_{0},\ldots,G_{k}\) where each consecutive pair satisfies \(s1-s3\) for \(\phi_{1}\). Theorem 3.1: _For a sequence of number of edges: \(x_{0},\ldots,x_{k}\) where \(x_{i}=i\) and \(k\leq{n\choose 2}\), there exists a collection of graphs \(G_{0},\ldots,G_{k}\) where each consecutive pair satisfies \(s1-s3\) for \(\phi_{1}\) and \(G_{i}\in\mathcal{G}_{n}\) for all \(i\in\{0,\ldots,k\}\)._  
Proof: Let \(E=\{e_{1},\ldots,e_{k}\}\) be a set of distinct edges among vertices \(\{1,\ldots,n\}\); this is possible because \(k\leq{n\choose 2}\). Let \(G_{i}\) denote the graph formed with the first \(i\) edges from \(E\), i.e., \(G_{i}\) contains edges \(\{e_{1},\ldots,e_{i}\}\). Based on the definition of \(G_{i}\), \(\phi_{1}(G_{i})=x_{i}=i\), \(\phi_{1}(G_{i-1})=x_{i-1}=i-1\), and \(G_{i}\) and \(G_{i-1}\) differ by a single edge. Since \(x_{0},\ldots,x_{k}\) satisfies \(s1-s3\), we can use results from [PERSON] et al. [13] to calculate \(r_{\phi_{1}}(x_{i},x_{i-1})\) as shown below:  
\[r_{\phi_{1}}(x_{i},x_{i-1})=\frac{{n\choose 2}-x_{i-1}}{x_{i}}. \tag{3}\]Using Equation (3) along with the specification of \(x_{0},\ldots,x_{k}=m\) as \(x_{i}=i\) and \(|c_{\phi_{1}}(x_{0})|=1\), it is possible to calculate \(|c_{\phi_{1}}(m)|\). Section 4.1.1 provides a numerical example for calculating \(|c_{\phi_{1}}(m)|\) when \(m=10\), while Section 4.1.2 provides a comparison between the recursive formula and a previously established formula.