## 2 Materials and Methods
### Tree-Extensions
#### 2.3.2. MILPs for Rank-2 Chemical Graphs  
We present an outline of our MILP \(\mathcal{M}(x,g;\mathcal{C}_{2})\) in Step 4 of the framework. For integers \(d_{\max},n^{*},\mathrm{cs}^{*},\mathrm{ch}^{*},\theta^{*}\in\mathbb{Z}\), let \(\mathcal{H}(d_{\max},n^{*},\mathrm{cs}^{*},\mathrm{ch}^{*},\theta^{*})\) denote the set of rank-2 graphs \(H\) such that the degree of each core vertex is at most 4, the degree of each non-core vertex is at most \(d_{\max}\), \(n(H)=n^{*}\), \(\mathrm{cs}(H)=\mathrm{cs}^{*}\), \(\mathrm{ch}(H)=\mathrm{ch}^{*}\) and \(\theta(H)=\theta^{*}\). In this paper, we obtain the following result. **Theorem 2**. : _Let \(\Lambda\) be a set of chemical elements, \(\Gamma\) be a set of adjacency-configurations, where \(|\Lambda|\leq|\Gamma|\), and \(k=2|\Lambda|+2|\Gamma|+15\). Given integers \(d_{\max}\in\{3,4\}\), \(n^{*}\geq 3\), \(\mathrm{cs}^{*}\geq 3\)\(\mathrm{ch}^{*}\geq 0\) and \(\theta^{*}\), there is an MILP \(\mathcal{M}(x,g;\mathcal{C}_{2})\) that consists of variable vectors \(x\in\mathbb{R}^{k}\) and \(g\in\mathbb{R}^{q}\) for some integer \(q=O(|\Gamma|\cdot\mathrm{cs}^{*}\cdot(d_{\max}-1)^{\mathrm{ch}^{*}})\) and a set \(\mathcal{C}_{2}\) of \(O(|\Gamma|+\mathrm{cs}^{*}\cdot(d_{\max}-1)^{\mathrm{ch}^{*}})\) constraints on these variables such that: \((x^{*},g^{*})\) is feasible to \(\mathcal{M}(x,g;\mathcal{C}_{2})\) if and only if \(g^{*}\) forms a rank-\(2\) chemical graph \(G^{*}=(H,\alpha,\beta)\in\mathcal{G}(\Lambda,\Gamma)\) such that \(H\in\mathcal{H}(d_{\max},n^{*},\mathrm{cs}^{*},\mathrm{ch}^{*},\theta^{*})\) and \(f(G^{*})=x^{*}\)._  
Note that our MILP requires only \(O(n^{*})\) variables and constraints when the maximum core height of a subtree in the non-core of \(G^{*}\) and \(|\Gamma|\) are constant. We formulate an MILP in Theorem 2 so that such a graph \(H\) is selected as a subgraph of the scheme graph. We explain the basic idea of our MILP. Define  
\[t^{*}\triangleq\mathrm{cs}^{*}-s^{*},\]  
\[c^{*}\triangleq|E_{1}\cup E_{2}|\text{ for }(K,\mathcal{E}=(E_{1},E_{2},E_{3})),\]  
\[n_{\text{tree}}\triangleq 1+2((d_{\max}-1)^{\mathrm{ch}^{*}}-1)/(d_{\max}-2)\text{ and }n_{\text{in}}\triangleq 1+2((d_{\max}-1)^{\mathrm{ch}^{*}-1}-1)/(d_{\max}-2),\]  
where \(n_{\text{tree}}\) and \(n_{\text{in}}\) are the numbers of vertices and non-leaf vertices in the rooted tree \(T(d_{\max}-2,d_{\max}-1,\mathrm{ch}^{*})\), respectively. The MILP mainly consists of the following three types of constraints. 1. Constraints for selecting a rank-2 graph \(H\) as a subgraph of the \((t^{*},\mathrm{ch}^{*},d_{\max})\)-tree-extension of the scheme graph \((K,\mathcal{E})\);
2. Constraints for assigning chemical elements to vertices and multiplicity to edges to determine a chemical graph \(G=(H,\alpha,\beta)\);
3. Constraints for computing descriptors from the selected rank-2 chemical graph \(G\); and
4. Constraints for reducing the number of rank-2 chemical graphs that are isomorphic to each other but can be represented by the above constraints. Figure 9: **(a)** An example of an extension of the scheme graph; **(b)** an example of a rank-2 graph \(H\) with \(n(H)=21\), \(\mathrm{cs}(H)=9\), \(\mathrm{ch}(H)=2\) and \(\theta(H)=1\), where the labels of some vertices and edges indicate the corresponding vertices and edges in the \((t^{*},\mathrm{ch}^{*},d_{\max})\)-tree-extension for \(\mathrm{cs}^{*}=\mathrm{cs}(H)\), \(\mathrm{ch}^{*}=\mathrm{ch}(H)\), \(s^{*}=4\), \(t^{*}=\mathrm{cs}^{*}-s^{*}\) and \(d_{\max}=3\); **(c)** a subgraph \(H^{\prime}\) of \((t^{*}=5,\mathrm{ch}^{*}=2,d_{\max}=3)\)-tree-extension isomorphic to the rank-2 graph \(H\) in **(b)**. In the constraints of 1, we treat each edge in the tree-extension as a directed edge because describing some condition for \(H\) to belong to \(\mathcal{H}(d_{\max},n^{*},\mathrm{cs}^{*},\mathrm{ch}^{*},\theta^{*})\) becomes slightly easier than the case of undirected graphs. More formally we prepare the following. 1.