SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\begin{array}{l} \mathcal {N} ^ {s _ {1}} (v) = \left\{\mathcal {I} (u) \mid u \in \mathcal {N} (v) \cap V _ {1} ^ {s _ {1}} \right\} \\ = \left\{\mathcal {I} (u) \mid u \in \mathcal {N} (v) \cap V _ {1} ^ {s _ {1}} \cap V _ {1} ^ {s _ {2}} \right\} \\ = \left\{\mathcal {I} (u) \mid u \in \left(\mathcal {N} (v) \cap V _ {1} ^ {s _ {2}}\right) \cap V _ {1} ^ {s _ {1}} \right\} \\ = \left\{\mathcal {I} (u) \mid u \in \mathcal {N} (v) \cap V _ {1} ^ {s _ {2}}, \mathcal {I} (u) <   s _ {1} \right\} \\ = \left\{\mathcal {I} (u) \mid u \in \mathcal {N} (v) \cap V _ {1} ^ {s _ {2}} \right\} \cap [ s _ {1} ] \\ = \mathcal {N} ^ {s _ {2}} (v) \cap [ s _ {1} ] \\ \end{array}
$$
where the second equation uses the fact that  $V_{1}^{s_{1}} \subset V_{1}^{s_{2}}$ , and the fourth equation holds since  $u \in V_{1}^{s_{1}} \Leftrightarrow \mathcal{I}(u) < s_{1}$  (using Property 1).
Proof. By the definition of lexicographical order for multisets, denote the corresponding sequence to  $A, B, A \cap [m], B \cap [m]$  by  $a, b, a^m, b^m \in S(M, L)$ , respectively. Then it is equivalent to show that:
$$
L O (a) \leq L O (b) \Rightarrow L O (a ^ {m}) \leq L O (b ^ {m}), \forall m = 1, 2, \dots , M
$$
Let  $a = (a_{1}, a_{2}, \ldots, a_{L})$  and  $b = (b_{1}, b_{2}, \ldots, b_{L})$ . If  $LO(a) = LO(b)$ , then  $a = b$  and  $a^{m} = b^{m}$ . Thus  $LO(a^{m}) = LO(b^{m})$ . Otherwise, if  $LO(a) < LO(b)$ , then there exists  $1 \leq l \leq L$  such that:
$$
\left\{ \begin{array}{l} a _ {i} = b _ {i}, \quad \forall 1 \leq i <   l \\ a _ {l} <   b _ {l} \end{array} \right.
$$
If  $m \leq a_l$ , then  $a^m = b^m$ , which means  $LO(a^m) = LO(b^m)$ . Otherwise, if  $m > a_l$ , then  $a^m$  and  $b^m$  share the same first  $l - 1$  elements. But the  $l$ -th element of  $a^m$  is  $a_l$ , while the  $l$ -th element of  $b_m$  is either  $b_l$  or  $M$ . In both cases, we have  $LO(a^m) < LO(b^m)$ .
Proof. Case 1: If  $\mathcal{I}(u) < \mathcal{I}(v) < s$ , then:
$$
\mathcal {I} ^ {s} (u) = \mathcal {I} (u) <   \mathcal {I} (v) = \mathcal {I} ^ {s} (v)
$$
Case 2: If  $\mathcal{I}(u) < s \leq \mathcal{I}(v)$ , then  $\mathcal{I}^s(u) = \mathcal{I}(u)$  and:
$$
\mathcal {I} ^ {s} (v) \geq s > \mathcal {I} (u) = \mathcal {I} ^ {s} (u)
$$
where Property 1 is used.
Case 3: If  $s \leq \mathcal{I}(u) < \mathcal{I}(v)$ , at  $\mathcal{I}(u)$ -th iteration,  $u$  is chosen to be indexed  $\mathcal{I}(u)$ . Thus:
$$
L O \left(\mathcal {N} _ {t} ^ {\mathcal {I} (u)} (u)\right) \leq L O \left(\mathcal {N} _ {t} ^ {\mathcal {I} (u)} (v)\right)
$$
According to the definition of  $\mathcal{N}^{\mathcal{I}(u)}(\cdot)$  and  $\mathcal{N}_t^{\mathcal{I}(u)}(\cdot)$ , we have:
$$
\mathcal {N} ^ {\mathcal {I} (u)} (u) = \mathcal {N} _ {t} ^ {\mathcal {I} (u)} (u) \cap [ \mathcal {I} (u) ], \mathcal {N} ^ {\mathcal {I} (u)} (v) = \mathcal {N} _ {t} ^ {\mathcal {I} (u)} (v) \cap [ \mathcal {I} (u) ]
$$
Using Property 3 (with  $A = \mathcal{N}_t^{\mathcal{I}(u)}(u), B = \mathcal{N}_t^{\mathcal{I}(u)}(v), m = \mathcal{I}(u)$ ) yields:
$$
L O (\mathcal {N} ^ {\mathcal {I} (u)} (u)) \leq L O (\mathcal {N} ^ {\mathcal {I} (u)} (v))
$$
Apply Property 2 (with  $s_1 = s, s_2 = \mathcal{I}(u)$ ) for  $u$  and  $v$ , we have:
$$
\mathcal {N} ^ {s} (u) = \mathcal {N} ^ {\mathcal {I} (u)} (u) \cap [ s ], \mathcal {N} ^ {s} (v) = \mathcal {N} ^ {\mathcal {I} (u)} (v) \cap [ s ]
$$
Using Property 3 again (with  $A = N^{\mathcal{I}(u)}(u)$ ,  $B = N^{\mathcal{I}(u)}(v)$ ,  $m = s$ ) gives:
$$
L O (\mathcal {N} ^ {s} (u)) \leq L O (\mathcal {N} ^ {s} (v))
$$
Recall the definition of  $\mathcal{I}^s (\cdot)$ , we have:
$$
\mathcal {I} ^ {s} (u) \leq \mathcal {I} ^ {s} (v)
$$
Lemma 2. For any undirected, connected graph  $G = (V, E)$ , if one indexing of  $G$  sastifties (S3), then it satisfies (S1).
Proof. Node 0 itself is a connected graph. Assume that the subgraph induced by nodes  $\{0,1,\ldots ,v\}$  is connected, it suffices to show that the subgraph induced by nodes  $\{0,1,\dots ,v + 1\}$  is connected. Equivalently, we need to prove that there exists  $u < v + 1$  such that  $A_{u,v + 1} = 1$ .
Assume that  $A_{u,v + 1} = 0$ ,  $\forall u < v + 1$ . Since  $G$  is connected, there exists  $v' > v + 1$  such that:
$$
\exists u <   v + 1, s. t. A _ {u, v ^ {\prime}} = 1
$$
Then we know:
$$
\mathcal {N} (v + 1) \cap [ v + 1 ] = \emptyset , \mathcal {N} (v ^ {\prime}) \cap [ v + 1 ] \neq \emptyset
$$
Recall the definition of  $LO(\cdot)$ , we obtain that:
$$
L O \left(\mathcal {N} (v + 1) \cap [ v + 1 ]\right) > L O \left(\mathcal {N} \left(v ^ {\prime}\right) \cap [ v + 1 ]\right) \quad (> )
$$
Since the indexing satisfies (S3), then we have:
$$
L O (\mathcal {N} (w) \backslash \{w + 1 \}) \leq L O (\mathcal {N} (w + 1) \backslash \{w \}), \forall v <   w <   v ^ {\prime}
$$
Applying Property 3:
$$
L O ((\mathcal {N} (w) \backslash \{w + 1 \}) \cap [ v + 1 ]) \leq L O ((\mathcal {N} (w + 1) \backslash \{w \}) \cap [ v + 1 ]), \forall v <   w <   v ^ {\prime}
$$
Note that  $w > v$ . Therefore,
$$
L O (\mathcal {N} (w) \cap [ v + 1 ]) \leq L O (\mathcal {N} (w + 1) \cap [ v + 1 ]), \forall v <   w <   v ^ {\prime}
$$
Choosing  $w = v + 1$  gives:
$$
L O (\mathcal {N} (v + 1) \cap [ v + 1 ]) \leq L O (\mathcal {N} (v ^ {\prime}) \cap [ v + 1 ]) \quad (\leq)
$$
The contradiction between  $(>)$  and  $(\leq)$  completes the proof.
A.2 Example for applying Algorithm 1
Given a graph with  $N = 6$  nodes as shown in Figure 4, where  $v_{0}$  is already indexed 0. We provide details of Algorithm 1 by indexing the rest 5 nodes step by step for further illustration.
Before indexing, we first calculate the neighbor sets for each node:
$$
\mathcal {N} (v _ {0}) = \left\{v _ {1}, v _ {2}, v _ {3}, v _ {4}, v _ {5} \right\}, \mathcal {N} (v _ {1}) = \left\{v _ {0}, v _ {2}, v _ {3}, v _ {4} \right\}, \mathcal {N} (v _ {2}) = \left\{v _ {0}, v _ {1}, v _ {5} \right\}
$$
$$
\mathcal {N} (v _ {3}) = \left\{v _ {0}, v _ {1}, v _ {4} \right\}, \mathcal {N} (v _ {4}) = \left\{v _ {0}, v _ {1}, v _ {3} \right\}, \mathcal {N} (v _ {5}) = \left\{v _ {0}, v _ {2} \right\}
$$
$$
s = \mathbf {1}: V _ {1} ^ {1} = \left\{v _ {0} \right\}, V _ {2} ^ {1} = \left\{v _ {1}, v _ {2}, v _ {3}, v _ {4}, v _ {5} \right\}
$$
Figure 4:  $V_{1}^{1} = \{v_{0}\}$
Obtain indexed neighbors to each unindexed node:
$$
\mathcal {N} ^ {1} (v _ {1}) = \{0 \}, \mathcal {N} ^ {1} (v _ {2}) = \{0 \}, \mathcal {N} ^ {1} (v _ {3}) = \{0 \}, \mathcal {N} ^ {1} (v _ {4}) = \{0 \}, \mathcal {N} ^ {1} (v _ {5}) = \{0 \}
$$
Rank all unindexed nodes:
$$
r a n k (v _ {1}) = r a n k (v _ {2}) = r a n k (v _ {3}) = r a n k (v _ {4}) = r a n k (v _ {5}) = 0
$$
Assign a temporary index to each node based on previous indexes (for indexed nodes) and ranks (for unindexed nodes):
$$
\mathcal {I} ^ {1} (v _ {0}) = 0, \mathcal {I} ^ {1} (v _ {1}) = 1, \mathcal {I} ^ {1} (v _ {2}) = 1, \mathcal {I} ^ {1} (v _ {3}) = 1, \mathcal {I} ^ {1} (v _ {4}) = 1, \mathcal {I} ^ {1} (v _ {5}) = 1
$$
After having indexes for all nodes, define temporary neighbor sets:
$$
\mathcal {N} _ {t} ^ {1} (v _ {1}) = \{0, 1, 1, 1 \}, \mathcal {N} _ {t} ^ {1} (v _ {2}) = \{0, 1, 1 \}, \mathcal {N} _ {t} ^ {1} (v _ {3}) = \{0, 1, 1 \},
$$
$$
\mathcal {N} _ {t} ^ {1} (v _ {4}) = \{0, 1, 1 \}, \mathcal {N} _ {t} ^ {1} (v _ {5}) = \{0, 1 \}
$$
Based on the temporary neighbor sets,  $v_{1}$  is chosen to be indexed 1 (i.e.,  $\mathcal{I}(v_1) = 1$ ).
$$
s = 2: V _ {1} ^ {2} = \left\{v _ {0}, v _ {1} \right\}, V _ {2} ^ {2} = \left\{v _ {2}, v _ {3}, v _ {4}, v _ {5} \right\}
$$
Figure 5:  $V_{1}^{2} = \{v_{0}, v_{1}\}$
$$
\mathcal {N} ^ {2} (v _ {2}) = \{0, 1 \}, \mathcal {N} ^ {2} (v _ {3}) = \{0, 1 \}, \mathcal {N} ^ {2} (v _ {4}) = \{0, 1 \}, \mathcal {N} ^ {2} (v _ {5}) = \{0 \}
$$
$$
r a n k (v _ {2}) = r a n k (v _ {3}) = r a n k (v _ {4}) = 0, r a n k (v _ {5}) = 1
$$
$$
\mathcal {I} ^ {2} (v _ {2}) = 2, \mathcal {I} ^ {2} (v _ {3}) = 2, \mathcal {I} ^ {2} (v _ {4}) = 2, \mathcal {I} ^ {2} (v _ {5}) = 3
$$
$$
\mathcal {N} _ {t} ^ {2} (v _ {2}) = \{0, 1, 3 \}, \mathcal {N} _ {t} ^ {2} (v _ {3}) = \{0, 1, 2 \}, \mathcal {N} _ {t} ^ {2} (v _ {4}) = \{0, 1, 2 \}, \mathcal {N} _ {t} ^ {2} (v _ {5}) = \{0, 2 \}
$$
Based on the temporary neighbor sets, both  $v_{3}$  and  $v_{4}$  can be chosen to be indexed 2. Without loss of generality, let  $\mathcal{I}(v_3) = 2$ .
Note: This step explains why temporary indexes and neighbor sets should be added into Algorithm 1. Otherwise,  $v_{2}$  is also valid to be index 2, following which  $v_{3}, v_{4}, v_{5}$  will be indexed 3, 4, 5. Then the neighbor set for  $\mathcal{I}(v_{2}) = 2$  is  $\{0, 1, 5\}$  while the neighbor set for  $\mathcal{I}(v_{3}) = 3$  is  $\{0, 1, 4\}$ , which violates constraints (S3).
$$
s = 3: V _ {1} ^ {3} = \left\{v _ {0}, v _ {1}, v _ {3} \right\}, V _ {2} ^ {3} = \left\{v _ {2}, v _ {4}, v _ {5} \right\}
$$
Figure 6:  $V_{1}^{3} = \{v_{0}, v_{1}, v_{3}\}$
$$
\mathcal {N} ^ {3} (v _ {2}) = \{0, 1 \}, \mathcal {N} ^ {3} (v _ {4}) = \{0, 1, 2 \}, \mathcal {N} ^ {3} (v _ {5}) = \{0 \}
$$
$$
r a n k (v _ {2}) = 1, r a n k (v _ {4}) = 0, r a n k (v _ {5}) = 2
$$
$$
\mathcal {I} ^ {3} (v _ {2}) = 4, \mathcal {I} ^ {3} (v _ {4}) = 3, \mathcal {I} ^ {3} (v _ {5}) = 5
$$
$$
\mathcal {N} _ {t} ^ {3} (v _ {2}) = \{0, 1, 5 \}, \mathcal {N} _ {t} ^ {3} (v _ {4}) = \{0, 1, 2 \}, \mathcal {N} _ {t} ^ {3} (v _ {5}) = \{0, 4 \}
$$
Based on the temporary neighbor sets,  $v_{4}$  is chosen to be indexed 3 (i.e.,  $\mathcal{I}(v_4) = 3$ ).
$$
s = 4: V _ {1} ^ {4} = \left\{v _ {0}, v _ {1}, v _ {3}, v _ {4} \right\}, V _ {2} ^ {4} = \left\{v _ {2}, v _ {5} \right\}
$$
Figure 7:  $V_{1}^{4} = \{v_{0}, v_{1}, v_{3}, v_{4}\}$
$$
\mathcal {N} ^ {4} (v _ {2}) = \{0, 1 \}, \mathcal {N} ^ {4} (v _ {5}) = \{0 \}
$$
$$
r a n k (v _ {2}) = 0, r a n k (v _ {5}) = 1
$$
$$
\mathcal {I} ^ {4} (v _ {2}) = 4, \mathcal {I} ^ {4} (v _ {5}) = 5
$$
$$
\mathcal {N} _ {t} ^ {4} (v _ {2}) = \{0, 1, 5 \}, \mathcal {N} _ {t} ^ {4} (v _ {5}) = \{0, 4 \}
$$
Based on the temporary neighbor sets,  $v_{2}$  is chosen to be indexed 4 (i.e.,  $\mathcal{I}(v_2) = 4$ ).
$$
s = 5: V _ {1} ^ {5} = \left\{v _ {0}, v _ {1}, v _ {2}, v _ {3}, v _ {4} \right\}, V _ {2} ^ {4} = \left\{v _ {5} \right\}
$$
Figure 8:  $V_{1}^{5} = \{v_{0}, v_{1}, v_{2}, v_{3}, v_{4}\}$
Since there is only node  $v_{5}$  unindexed, without running the algorithm we still know that  $v_{5}$  is chosen to be indexed 5 (i.e.,  $\mathcal{I}(v_{5}) = 5$ ).
Figure 9:  $V_{1}^{6} = \{v_{0}, v_{1}, v_{2}, v_{3}, v_{4}, v_{5}\}$
B MIP formulation for CAMD: details
In this part, we provide details of the MIP formulation for CAMD, including parameters, variables and constraints. Especially, we use atom set  $\{C,N,O,S\}$  as an example to help illuminate. The number of nodes  $N$  exclude hydrogen atoms since they are implicitly represented by  $N^{h}$  features.
B.1 Parameters
Table 2: List of parameters
Parameter	Description	Value
N	number of nodes
F	number of features	16
Nt	number of atom types	4
Nn	number of neighbors	5
Nh	number of hydrogen	5
It	index for Nt	{0,1,2,3}
In	index for Nn	{4,5,6,7,8}
Ih	index for Nh	{9,10,11,12,13}
Idb	index for double bond	14
Itb	index for triple bond	15
Atom	atom types	{C,N,O,S}
Cov	covalence of atom	{4,3,2,2}
B.2 Variables
Table 3: List of variables for atom features
Xv,f	Type	Xv,f	#Neighbors	Xv,f	#Hydrogen
0	C	4	0	9	0
1	N	5	1	10	1
2	O	6	2	11	2
3	S	7	3	12	3
8	4	13	4
For the existence and types of bonds, we add the following extra features and variables:
-  $X_{v,I^{db}}, v \in [N]$ : if atom  $v$  is included in at least one double bond.
-  $X_{v,I^{tb}}, v \in [N]$ : if atom  $v$  is included in at least one triple bond.
-  $A_{u,v}, u \neq v \in [N]$ : if there is one bond between atom  $u$  and  $v$ .
-  $A_{v,v}, v \in [N]$ : if node  $v$  exists.
-  $DB_{u,v}, u \neq v \in [N]$ : if there is one double bond between atom  $u$  and  $v$ .
-  $TB_{u,v}, u \neq v \in [N]$ : if there is one triple bond between atom  $u$  and  $v$ .
Remark: Variables  $A_{v,v}$  admits us to design molecules with at most  $N$  atoms, which brings flexibility in real-world applications. In our experiments, however, we fix them to consider possible structures with exact  $N$  atoms. Therefore, constraints (C2) are replaced by:
$$
A _ {v, v} = 1, \forall v \in [ N ]
$$
Without this replacement, we can add an extra term on (C26) to exclude non-existing nodes and only index existing node:
$$
\sum_ {f \in [ F ]} 2 ^ {F - f - 1} \cdot X _ {0, f} \leq \sum_ {f \in [ F ]} 2 ^ {F - f - 1} \cdot X _ {v, f} + 2 ^ {F} \cdot (1 - A _ {v, v}), \forall v \in [ N ] \backslash \{0 \}
$$
B.3 Constraints
- There are at least two atoms and one bond between them:
$$
A _ {0, 0} = A _ {1, 1} = A _ {0, 1} = 1 \tag {C1}
$$
- Atoms with smaller indexes exist:
$$
A _ {v, v} \geq A _ {v + 1, v + 1}, \forall v \in [ N - 1 ] \tag {C2}
$$
- The adjacency matrix  $A$  is symmetric:
$$
A _ {u, v} = A _ {v, u}, \forall u, v \in [ N ], u <   v \tag {C3}
$$
- Atom  $v$  is linked to other atoms if and only if it exists:
$$
(N - 1) \cdot A _ {v, v} \geq \sum_ {u \neq v} A _ {u, v}, \forall v \in [ N ] \tag {C4}
$$
Note:  $N - 1$  here is a big-M constant.
- If atom  $v$  exists, then it has to be linked with at least one atom with smaller index:
$$
A _ {v, v} \leq \sum_ {u <   v} A _ {u, v}, \forall v \in [ N ] \tag {C5}
$$
- Atom  $v$  cannot have a double bond with it self:
$$
D B _ {v, v} = 0, \forall v \in [ N ] \tag {C6}
$$
DB is also symmetric:
$$
D B _ {u, v} = D B _ {v, u}, \forall u, v \in [ N ], u <   v \tag {C7}
$$
- Atom  $v$  cannot have a triple bond with it self:
$$
T B _ {v, v} = 0, \forall v \in [ N ] \tag {C8}
$$
- TB is also symmetric:
$$
T B _ {u, v} = T B _ {v, u}, \forall u, v \in [ N ], u <   v \tag {C9}
$$
- There is at most one bond type between two atoms:
$$
D B _ {u, v} + T B _ {u, v} \leq A _ {u, v}, \forall u, v \in [ N ], u <   v \tag {C10}
$$
- If atom  $v$  exists, then it has only one type:
$$
A _ {v, v} = \sum_ {f \in I ^ {t}} X _ {v, f}, \forall v \in [ N ] \tag {C11}
$$
- If atom  $v$  exists, then it has only number of neighbors:
$$
A _ {v, v} = \sum_ {f \in I ^ {n}} X _ {v, f}, \forall v \in [ N ] \tag {C12}
$$
- If atom  $v$  exists, then it has only one number of hydrogen:
$$
A _ {v, v} = \sum_ {f \in I ^ {h}} X _ {v, f}, \forall v \in [ N ] \tag {C13}
$$
- The number of neighbors of atom  $v$  equals to its degree:
$$
\sum_ {u \neq v} A _ {u, v} = \sum_ {i \in [ N ^ {n} ]} i \cdot X _ {v, I _ {i} ^ {n}}, \forall v \in [ N ] \tag {C14}
$$
- If there is possibly one double bond between atom  $u$  and  $v$ , then the double bond feature of both atoms should be 1 and these two atoms are linked:
$$
3 \cdot D B _ {u, v} \leq X _ {u, I ^ {d b}} + X _ {v, I ^ {d b}} + A _ {u, v}, \forall u, v \in [ N ], u <   v \tag {C15}
$$
- If there is possibly one triple bond between atom  $u$  and  $v$ , then the triple bond feature of both atoms should be 1 and these two atoms are linked:
$$
3 \cdot T B _ {u, v} \leq X _ {u, I ^ {t b}} + X _ {v, I ^ {t b}} + A _ {u, v}, \forall u, v \in [ N ], u <   v \tag {C16}
$$
- The maximal number of double bonds for atom  $v$  is limited by its covalence:
$$
\sum_ {u \in [ N ]} D B _ {u, v} \leq \sum_ {i \in [ N ^ {t} ]} \left\lfloor \frac {\operatorname {C o v} _ {i}}{2} \right\rfloor \cdot X _ {v, I _ {i} ^ {t}}, \forall v \in [ N ] \tag {C17}
$$
- The maximal number of triple bonds for atom  $v$  is limited by its covalence:
$$
\sum_ {u \in [ N ]} T B _ {u, v} \leq \sum_ {i \in [ N ^ {t} ]} \left\lfloor \frac {\operatorname {C o v} _ {i}}{3} \right\rfloor \cdot X _ {v, I _ {i} ^ {t}}, \forall v \in [ N ] \tag {C18}
$$
- If atom  $v$  is not linked with other atoms with double bond, then its double bond feature should be 0:
$$
X _ {v, I ^ {d b}} \leq \sum_ {u \in [ N ]} D B _ {u, v}, \forall v \in [ N ] \tag {C19}
$$
- If atom  $v$  is not linked with other atoms with triple bond, then its triple bond feature should be 0:
$$
X _ {v, I ^ {t b}} \leq \sum_ {u \in [ N ]} T B _ {u, v}, \forall v \in [ N ] \tag {C20}
$$
- The covalence of atom  $v$  equals to the sum of its neighbors, hydrogen, double bonds, and triple bonds:
$$
\begin{array}{l} \sum_ {i \in [ N ^ {t} ]} C o v _ {i} \cdot X _ {v, I _ {i} ^ {t}} = \sum_ {i \in [ N ^ {n} ]} i \cdot X _ {v, I _ {i} ^ {n}} + \sum_ {i \in [ N ^ {h} ]} i \cdot X _ {i, I _ {i} ^ {h}} \\ + \sum_ {u \in [ N ]} D B _ {u, v} + \sum_ {u \in [ N ]} 2 \cdot T B _ {u, v}, \forall v \in [ N ] \tag {C21} \\ \end{array}
$$
- Practically, there could be bounds for each type of atom:
$$
L B _ {A t o m _ {i}} \leq \sum_ {v \in [ N ]} X _ {v, I _ {i} ^ {t}} \leq U B _ {A t o m _ {i}}, \forall i \in [ N ^ {t} ] \tag {C22}
$$
- Practically, there could be bounds for number of double bonds:
$$
L B _ {d b} \leq \sum_ {v \in [ N ]} \sum_ {u <   v} D B _ {u, v} \leq U B _ {d b} \tag {C23}
$$
- Practically, there could be bounds for number of triple bonds:
$$
L B _ {t b} \leq \sum_ {v \in [ N ]} \sum_ {u <   v} T B _ {u, v} \leq U B _ {t b} \tag {C24}
$$
- Practically, there could be bounds for number of rings. Since we force the connectivity,  $N - 1$  bonds are needed to form a tree and then each extra bond forms a ring. Therefore, we can bound the number of rings by:
$$
L B _ {r i n g} \leq \sum_ {v \in [ N ]} \sum_ {u <   v} A _ {u, v} - (N - 1) \leq U B _ {r i n g} \tag {C25}
$$
C Implementation details and more results
C.1 Dataset preparation
Both datasets used in this paper are available in python package chemprop [38]. Molecular features (133 atom features and 14 bond features) are extracted from their SMILES representations. Based on the these features and our definition for variables in Appendix B.2, we calculate  $F = 16$  (since both datasets have 4 types of atoms) features for each atom, construct adjacency matrix  $A$  as well as double and triple bond matrices  $DB$  and  $TB$ . In this part, we first briefly introduce these datasets and then provide details about how to preprocess them.
QM7 dataset: Consist of 6,830 molecules with at most 7 heavy atoms  $C,N,O,S$ . One quantum mechanics property is provided for each molecule. We filter the dataset and remove three types of incompatible molecules: (1) molecules with aromaticity (i.e., with float electron(s) inside a ring); (2) molecules constraints  $S$  atom with covalence 6 (since one type of atom can only have one covalence in our formulation); (3) molecules with non-zero radical electrons. After preprocessing, there are 5,822 molecules left with properties re-scaled to  $0 \sim 1$ .
To calculate the bounds needed in constraints (C22) - (C25), we check all molecules in QM7 dataset. The maximal ratios between the number of N,O and S atoms and the total atoms are  $3/7, 1/3, 1/7$ , respectively, while the minimal ratio between the number of C atoms and the total atoms is  $1/2$ . The maximal ratios between the number of double bonds, triple bonds, rings and the number of atoms are  $3/7, 3/7, 3/7$ , respectively. Therefore, we set the following bounds:
$$
L B _ {C} = \left\lceil \frac {N}{2} \right\rceil , U B _ {N} = \max  \left(1, \left\lfloor \frac {3 N}{7} \right\rfloor\right), U B _ {O} = \max  \left(1, \left\lfloor \frac {N}{3} \right\rfloor\right), U B _ {S} = \max  \left(1, \left\lfloor \frac {N}{7} \right\rfloor\right)
$$
$$
U B _ {d b} = \left\lfloor \frac {N}{2} \right\rfloor , U B _ {t b} = \left\lfloor \frac {N}{2} \right\rfloor , U B _ {r i n g} = \left\lfloor \frac {N}{2} \right\rfloor
$$
QM9 dataset: Consist of 133,885 molecules with at most 9 heavy atoms  $C,N,O,F$ . 12 quantum mechanics properties are provided for each molecule. We filter the dataset and remove two types of incompatible molecules: (1) molecules with aromaticity; (2) molecules with non-zero radical electrons. After preprocessing, there are 108,723 molecules left. Among these features, we choose one property  $U_{0}$ , which denotes the internal energy at 0K. These properties are re-scaled to  $0 \sim 1$ .
Similarly, we set the following bounds for the experiments on the QM9 dataset:
$$
L B _ {C} = \left\lceil \frac {N}{5} \right\rceil , U B _ {N} = \left\lfloor \frac {3 N}{5} \right\rfloor , U B _ {O} = \left\lfloor \frac {4 N}{7} \right\rfloor , U B _ {F} = \left\lfloor \frac {4 N}{5} \right\rfloor
$$
$$
U B _ {d b} = \left\lfloor \frac {N}{2} \right\rfloor , U B _ {t b} = \left\lfloor \frac {N}{2} \right\rfloor , U B _ {r i n g} = \left\lfloor \frac {2 N}{3} \right\rfloor
$$
C.2 Training of GNNs
For QM7 dataset, the GNN's structure is shown in Table 4. For each run, we first randomly shuffle the dataset, then use the first 5000 elements to train and the last 822 elements to test. Each model is trained for 100 iterations with learning rate 0.01 and batch size 64. The average training  $(l_{1})$  loss is 0.0241 and test loss is 0.0285.
Table 4: Structure of GNN for QM7 dataset
index	layer	in features	out features	activation
1	SAGEConv	16	16	ReLU
2	SAGEConv	16	32	ReLU
3	Pooling	32N	32	None
4	Linear	32	16	ReLU
5	Linear	16	4	ReLU
6	Linear	4	1	None
For QM9 dataset, the GNN's structure is shown in Table 5. We apply the same experimental set-up as before, but with a larger number of channels to fit this much larger dataset. For each run, after randomly shuffled, the first 80000 elements are used to train and the last 28723 elements are used to test. The average training loss is 0.0036 and test loss is 0.0036.
Table 5: Structure of GNN for QM9 dataset
index	layer	in features	out features	activation
1	SAGEConv	16	32	ReLU
2	SAGEConv	32	64	ReLU
3	Pooling	64N	64	None
4	Linear	64	16	ReLU
5	Linear	16	4	ReLU
6	Linear	4	1	None
For both datasets, the trained GNNs achieve comparable accuracy to the state-of-the-art methods [38]. Note that this comparison is unfair since we preprocess each dataset and remove some incompatible molecules. Also, we only choose one property to train and then optimize. However, low losses mean that the trained GNNs approximate true properties well.
C.3 Full experimental results
We report full experimental results in this section. For each dataset with a given  $N$  and a formulation, numbers of variables (\#varc: continuous, #varb: binary) and constraints (#con) after presolve stage in Gurobi are first reported. Then we count the number of successful runs (i.e., achieving optimality) #run. For all successful runs, we provide the mean, 25th percentile  $(Q_{1})$ , and 75th percentile  $(Q_{3})$  of the running time timetol as well as the first time to find the optimal solution time opt. The time limit for each run is 10 hours. Except for the time limit and random seed, we use the default setting in Gurobi for other parameters such as the tolerance.
Table 6: Numerical results for QM7 dataset.
N	method	#varc	#varb	#con	#run	time tol (s)	time opt (s)
mean	Q1	Q3	mean	Q1	Q3
4	bilinear	616	411	1812	50	477	314	579	101	13	147
bilinear+BrS	616	383	1755	50	149	115	167	94	66	131
big-M	792	281	1838	50	514	206	722	130	15	150
big-M+BrS	760	269	1748	50	114	91	128	53	13	94
5	bilinear	840	611	2776	37	9365	3551	9029	471	169	339
bilinear+BrS	840	565	2679	50	659	282	652	198	136	257
big-M	1142	359	2795	50	6369	1424	9703	729	74	616
big-M+BrS	1097	346	2660	50	501	266	660	205	91	281
6	bilinear	1096	828	3893	2	23853	22081	25627	389	373	396
bilinear+BrS	1064	747	3602	48	6400	1748	6225	1751	334	2154
big-M	1628	436	4018	10	21484	16095	24848	14368	9966	19930
big-M+BrS	1505	420	3665	47	4700	1656	3759	1156	515	1440
7	bilinear	1384	1076	5193	0	*	*	*	*	*	*
bilinear+BrS	1320	950	4684	47	12989	4651	19229	3366	497	4587
big-M	2134	516	5364	0	*	*	*	*	*	*
big-M+BrS	1943	495	4806	49	10802	4159	16101	4008	64	5251
8	bilinear	1704	1355	6676	0	*	*	*	*	*	*
bilinear+BrS	1608	1181	5941	12	16219	7623	22951	3082	90	223
big-M	2676	599	6869	0	*	*	*	*	*	*
big-M+BrS	2390	572	6040	12	6606	2132	3120	2854	55	87