DLGNet: Hyperedge Classification through Directed Line Graphs for Chemical Reactions

## Abstract

Abstract Graphs and hypergraphs provide powerful abstractions for modeling interactions among a set of entities of interest and have been attracting a growing interest in the literature thanks to many successful applications in several fields.
In particular, they are rapidly expanding in domains such as chemistry and biology, especially in the areas of drug discovery and molecule generation.
One of the areas witnessing the fasted growth is the chemical reactions field, where chemical reactions can be naturally encoded as directed hyperedges of a hypergraph.
In this paper, we address the chemical reaction classification problem by introducing the notion of a Directed Line Graph (DLG) associated with a given directed hypergraph. On top of it, we build the Directed Line Graph Network (DLGNet), the first spectral-based Graph Neural Network (GNN) expressly designed to operate on a hypergraph via its DLG transformation.
The foundation of DLGNet is a novel Hermitian matrix, the Directed Line Graph Laplacian 𝕃 → N subscript → 𝕃 𝑁 \mathbb{\vec{L}}_{N} over→ start_ARG blackboard_L end_ARG start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT , which compactly encodes the directionality of the interactions taking place within the directed hyperedges of the hypergraph thanks to the DLG representation. 𝕃 → N subscript → 𝕃 𝑁 \mathbb{\vec{L}}_{N} over→ start_ARG blackboard_L end_ARG start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT enjoys many desirable properties, including admitting an eigenvalue decomposition and being positive semidefinite, which make it well-suited for being adopted within a spectral-based GNN.
Through extensive experiments on chemical reaction datasets, we show that DLGNet significantly outperforms the existing approaches, achieving on a collection of real-world datasets an average relative-percentage-difference improvement of 33.01%, with a maximum improvement of 37.71%.

## 1 Introduction

In recent years, ground-breaking research in the graph-learning literature has been prompted by seminal works on GNNs such as Scarselli et al. (); Micheli (); Li et al. (); Kipf and Welling (); Veličković et al. ().
However, representing data solely through graphs, either undirected or directed, can be limiting in many real-world applications where more complex relationships exist. In such cases, generalizations of graphs known as hypergraphs, which allow for higher-order (group) relationships among the vertices, have emerged as powerful alternatives.
Hypergraphs extend the traditional concept of a graph by allowing hyperedges to connect an arbitrary number of nodes, thereby capturing both pairwise (dyadic) and group-wise (polyadic) interactions (Schaub et al., ).
This has naturally led to a new stream of research devoted to the investigation of Hypergraph Neural Networks (HNNs) (Feng et al., ; Chien et al., ; Huang and Yang, ; Wang et al., , ).

Among many successful applications, graph and hypergraph representations have recently been applied in chemistry and biology to address various tasks such as drug discovery (Bongini et al., ), molecule generation (Hoogeboom et al., ), and protein interaction modeling (Jha et al., ).
Several graph-based representations have also been developed and employed for the study of chemical reactions, which has applications in areas such as reaction engineering, retrosynthetic pathway design, and reaction feasibility evaluations.
In particular, retrosynthetic modeling, where a synthetic route is designed starting from the desired product and analyzed backward, benefits greatly from accurate reaction type identification. This capability enables the elimination of unfeasible pathways, thereby streamlining the discovery of efficient routes for chemical production. This is particularly important in industries such as pharmaceutical and material sciences, where optimizing synthetic routes can lead to significant cost savings and innovation.
A similar situation holds, in reaction feasibility analysis, where predicting the likelihood of a reaction’s success based on the molecular inputs is essential for designing scalable and efficient processes.

One of the most relevant techniques to model reactions is the directed graph (Fialkowski et al., ), where molecules are represented as nodes and the chemical reactions are represented as directed edges from reactants to products. Despite its popularity, such a directed graph model suffers from some key limitations. In particular, modeling each reaction as a collection of individual directed edges between each reactant-product pair fails to fully capture the complexity of multi-reactant or multi-product reactions, which are key to many important applications (Restrepo, ; Garcia-Chung et al., ).
To mitigate this issue, Chang () proposed a hypergraph representation in which molecules are nodes and each reaction is captured by a hyperedge. However, this model lacks a mechanism to represent the directionality of a reaction, thus failing to capture the reactant/product relationship within it.
As a further attempt, Restrepo () introduced a directed hypergraph representation which is able to model both the chemical reactions structure and their directionality, where directed hyperedges model the directional interactions between reagents (heads) and products (tails), better capturing the full complexity of chemical reactions.
Let us note that this literature only focuses on modeling reaction structures without considering any form of hypergraph learning methods. We set ourselves out to developing one in this paper.

In contrast to prior studies that address node classification or link prediction tasks (Dong et al., ; Wang et al., ; Zhao et al., ), in this work we tackle the reaction classification problem (i.e., the problem of predicting the reaction type of a given set of reactants and products) as a hyperedge classification task.

Figure: Figure 1: Transformation from the directed hypergraph (left) to the directed line graph (right). The hyperedges of $\vec{H}$ become the nodes of DLG$(\vec{H})$m and are connected if they overlap in $\vec{H}$. Complex-valued edge weights in DLG$(\vec{H})$ encode $\vec{H}$’s directionality, as detailed in Section 3.
Refer to caption: extracted/5913805/figures/HG7.png

With this goal in mind, we introduce the concept of
a directed line graph of a given directed hypergraph $\vec{H}$: the Directed Line Graph DLG($\vec{H}$).
In DLG($\vec{H}$), the vertices correspond to the hyperedges of $\vec{H}$, and a directed edge connects two vertices if the corresponding hyperedges in $\vec{H}$ share at least a vertex, as shown in Figure 1.
Since the nodes of DLG($\vec{H}$) correspond to hyperedges of $\vec{H}$, this modeling approach allows us to directly operate on hyperedge features, which are
critical for solving the reaction-classification task.
To this end, we define the Directed Line-Graph Laplacian $(\mathbb{\vec{L}}_{N})$, a Laplacian matrix which is specifically designed to capture both directed and undirected adjacency relationships between the hyperedges of $\vec{H}$ via its directed line graph DLG($\vec{H}$). We prove that $\mathbb{\vec{L}}_{N}$ enjoys different key properties, among which being Hermitian (i.e., being a complex-valued matrix with a symmetric real part and a skew-symmetric imaginary one) and positive semidefinite.
These properties allows us to introduce a spectral convolutional operator for DLG($\vec{H}$). Thanks to the association of DLG($\vec{H}$) with the original directed hypergraph $\vec{H}$, DLG($\vec{H}$) serves as the foundation of Directed Line Graph Network (DLGNet), the first (to our knowledge) spectral-based GNN designed for the convolution of hyperedge features rather than node features.

For the task of hyperedge classification for the prediction of chemical reaction classes, transitioning from a directed hypergraphs to a directed line graph representation proves to offer significant advantages, as evidenced by our experimental results. Specifically, DLGNet achieves an average relative percentage difference improvement of 33.01% over the second-best method across a collection of real-world datasets, with a maximum improvement of 37.71%. We also carry out an extensive set of ablation studies, which confirm the importance of the various components of DLGNet.

Main Contributions of This Work

- •
We introduce the first formal definition of
a directed line graph associated with a directed hypergraph $\vec{H}$: the Directed Line Graph DLG($\vec{H}$).
- •
We propose the Directed Line Graph Laplacian $\mathbb{\vec{L}}_{N}$, a Hermitian matrix that captures both directed and undirected relationships between the hyperedges of a directed hypergraph via its DLG. We also prove that $\mathbb{\vec{L}_{N}}$ possesses many desirable spectral properties.
- •
We introduce DLGNet, the first spectral-based Graph Neural Network specifically designed to operate on directed line graphs associated with directed hypergraphs by directly convolving hyperedge features rather than node features.
- •
We perform an extensive experimental evaluation on the chemical reaction-classification task on real-world datasets. Our results highlight the advantages of our approach compared to other methods presented in the literature.

## 2 Background

An undirected hypergraph is defined as an ordered pair $H=(V,E)$, with $n:=|V|$ and $m:=|E|$, where $V$ is the set of vertices (or nodes) and $E\subseteq 2^{V}\setminus\{\}$ is the (nonempty) set of hyperedges.
The weights of the hyperedges are stored in the diagonal matrix $W\in\mathbb{R}^{m\times m}$, where $w_{e}$ is the weight of hyperedge $e\in E$ (in the unweighted case we have $W=I$).
The vertex degree $d_{u}$ and hyperedge degree $\delta_{e}$ are defined as $d_{u}:=\sum_{e\in E:u\in e}|w_{e}|$ for $u\in V$, and $\delta_{e}:=|e|$ for $e\in E$. These degrees are stored in two diagonal matrices $D_{v}\in\mathbb{R}^{n\times n}$ and $D_{e}\in\mathbb{R}^{m\times m}.$
In the case of 2-uniform hypergraphs, the matrix $A\in\mathbb{R}^{n\times n}$ is defined such that $A_{uv}=w_{e}$ for each $e=\{u,v\}\in E$ and $A_{uv}=0$ otherwise; we refer to it as the adjacency matrix of the graph.
Hypergraphs where $\delta(e)=k$ for some $k\in\mathbb{N}$ for all $e\in E$ are called $k$-uniform.
Graphs are $2$-uniform hypergraphs.
Following Gallo et al. (), we define a directed hypergraph $\vec{H}$ as a hypergraph where each hyperedge $e\in E$ is partitioned in
a head set $H(e)$ and a tail set $T(e)$.
If $T(e)$ is empty, $e$ is an undirected hyperedge.

The relationship between vertices and hyperedges in a undirected hypergraph ${H}$ is classically represented via an incidence matrix $B$ of size $|V|\times|E|$, where
$B$ is defined as:

$$ ${B_{ve}}=\begin{cases}1&\text{if }v\in e\\ 0&\text{otherwise}\end{cases}\qquad v\in V,e\in E.$ (1) $$

From the incidence matrix $B$, one can derive the Signless Laplacian Matrix $Q$
as well as its normalized version $Q_{N}$ (Chung and Graham, ):

$$ $Q:=BWB^{\top}\qquad\qquad\qquad Q_{N}:=D_{v}^{-\frac{1}{2}}BWD_{e}^{-1}B^{\top }D_{v}^{-\frac{1}{2}},$ (2) $$

where $W,D_{e},D_{v}$ are the diagonal matrices defined above. Following Zhou et al. (), the Laplacian for a general undirected hypergraph is defined as follows:

$$ $\Delta:=I-Q_{N}.$ (3) $$

The Laplacian matrix encodes the hypergraph’s connectivity and hyperedge weights.

### 2.1 Graph Fourier and Graph Convolutions

Let $\mathcal{L}$ be a generic Laplacian matrix of a given 2-uniform hypergraph $H$.
We assume that $\mathcal{L}$ admits an eigenvalue decomposition $\mathcal{L}=U\Lambda U^{*}$, where $U\in\mathbb{C}^{n\times n}$ represents (in its columns) the eigenvectors, $U^{*}$ is its conjugate transpose, and $\Lambda\in\mathbb{R}^{n\times n}$ is the diagonal matrix containing the eigenvalues.
Let $x\in\mathbb{C}^{n}$ be a graph signal, i.e., a complex-valued function $x:V\rightarrow\mathbb{C}^{n}$ of the vertices of ${H}$.
We define $\hat{x}=\mathcal{F}(x)=U^{*}x$ as
the graph Fourier transform of $x$ and $\mathcal{F}^{-1}(\hat{x})=U\hat{x}$ its inverse transform.
The convolution $y\circledast x$ between $x$ and another graph signal $y\in\mathbb{C}^{n}$, acting as a filter, in the vertex space is defined in the frequency space as $y\circledast x=U\text{diag}(U^{*}y)U^{*}x$. Letting $\hat{Y}:=U\hat{G}U^{*}$ with $\hat{G}:=\text{diag}(U^{*}y)$, we can write $y\circledast x$ as the linear operator $\hat{Y}x$. See Shuman et al. () for more details.

In the context of GNNs, explicitly learning $y$ as a non-parametric filter presents two significant limitations.
Firstly, computing the eigenvalue decomposition of $\mathcal{L}$ can be computationally too expensive (Kipf and Welling, ).
Secondly, explicitly learning $y$ requires a number of parameters proportional to the input size, which becomes inefficient for high-dimensional tasks (Defferrard et al., ).
To address these issues, the GNN literature commonly employs filters where the graph Fourier transform is approximated as a degree-$K$ polynomial of $\Lambda$, with $K$ kept small for computational efficiency. For further details, we refer the reader to Kipf and Welling (); Defferrard et al. (); Huang et al. ().
This leads to a so-called localized filter, thanks to which the output (i.e., filtered) signal at a vertex $u\in V$ is a linear combination of the input signals within $K$ edges of $u$ (Shuman et al., ).
By employing various polynomial filters and setting $K=1$ (as commonly employed in the literature), such as Chebyshev polynomials as in Hammond et al. (); Kipf and Welling () or power monomials as used by Singh and Chen (), one obtains a parametric family of linear operators with two learnable parameters, $\theta_{0}$ and $\theta_{1}$: (^1^11 Following w.l.o.g. Singh and Chen (), we employ the approximation $\hat{G}=\sum_{k=0}^{K}\theta_{k}\Lambda^{k}$, from which we deduce $\hat{Y}x=U\hat{G}U^{*}x=U(\sum_{k=0}^{K}\theta_{k}\Lambda^{k})U^{*}x=\sum_{k=0 }^{K}\theta_{k}(U\Lambda^{k}U^{*})x=\sum_{k=0}^{K}\theta_{k}\mathcal{L}^{k}x$.)

$$ $\hat{Y}:=\theta_{0}I+\theta_{1}\mathcal{L}.$ (4) $$

## 3 The Directed Line Graph and Its Laplacian

The line graph $L(H)$ of a generic undirected hypergraph $H$ is classically defined as the undirected graph whose vertex set is the hyperedge set of $H$. In $L(H)$, two vertices $i,j$ are adjacent—i.e., $L(H)$ contains the edge $\{i,j\}$—if and only if their corresponding hyperedges $i,j$ have a nonempty intersection (Tyshkevich and Zverovich, ).
By construction, $L(H)$ is a 2-uniform graph.
Its adjacency matrix is defined as:

$$ $A(L(H)):=\mathbb{Q}-WD_{e},$ (5) $$

where $\mathbb{Q}:=B^{\top}B$ is, by construction, the Signless Laplacian of $L(H)$. (^2^22This follows from the fact that the incidence matrix of $L(H)$ is $B^{*}$.)
The normalized version of $\mathbb{Q}$ and the corresponding normalized Laplacian are defined as:

$$ $\mathbb{Q}:=W^{\frac{1}{2}}B^{\top}BW^{\frac{1}{2}}\qquad\qquad{\mathbb{Q}_{N} }:={D}_{e}^{-\frac{1}{2}}W^{\frac{1}{2}}{B}^{\top}{D}_{v}^{-1}{B}W^{\frac{1}{2 }}{D}_{e}^{-\frac{1}{2}}\qquad\qquad\mathbb{L}_{N}:=I-\mathbb{Q}_{N}.$ (6) $$

Notice that, from equation 2, one can define the weighted version of $B$ as $BW^{\frac{1}{2}}$. The definitions in equation 6 rely on the same matrix, but transposed.

To the best of our knowledge, the literature does not offer any formal definition for the line graph associated with a (weighted) directed hypergraph $\vec{H}$ (it does only for the undirected case).
The availability of such a definition could be crucial for tasks where the hyperedge direction is important.

To address this gap, we first define a
complex-valued incidence matrix $\vec{B}$ which preserves the inherent directionality of $\vec{H}$:

$$ $\vec{B}_{ve}:=\begin{cases}1&\text{if }v\in H(e),\\ -\text{i}&\text{if }v\in T(e),\\ 0&\text{otherwise}.\end{cases}\qquad v\in V,e\in E.$ (7) $$

Building on $\vec{B}$, we propose the following definition for the directed line graph associated with a directed hypergraph $\vec{H}$:

###### Definition 1 .

The Directed Line Graph $DLG(\vec{H})$ of a directed hypergraph $\vec{H}$ is a 2-uniform hypergraph whose vertex set corresponds to the hyperedge set of $\vec{H}$
and whose adjacency matrix is the following complex-valued skew-symmetric matrix:

$$ $A(DLG(\vec{H}))=W^{\frac{1}{2}}\vec{B}^{*}\vec{B}W^{\frac{1}{2}}-WD_{e}.$ (8) $$

Using equation 8 of definition 1 and equations 5–6, we obtain the following formulas for the normalized Signless Laplacian $\mathbb{\vec{Q}}_{N}$ and the normalized Laplacian $\mathbb{\vec{L}}_{N}$ of $DLG$, which we refer to by
Signless Directed Line-Graph and Directed Line Graph Laplacian:

$$ $\mathbb{\vec{Q}}_{N}:=\vec{D}_{e}^{-\frac{1}{2}}W^{\frac{1}{2}}\vec{B}^{*}\vec {D}_{v}^{-1}\vec{B}W^{\frac{1}{2}}\vec{D}_{e}^{-\frac{1}{2}}\qquad\mathbb{\vec {L}}_{N}:=I-\mathbb{\vec{Q}}_{N}.$ (9) $$

To better understand how $\mathbb{\vec{L}}_{N}$ encodes the directionality of $\vec{H}$, we illustrate its definition in scalar form for a pair of hyperedges $i,j\in E$ (which correspond to vertices in $DLG(\vec{H})$):

$$ $\displaystyle\mathbb{\vec{L}}_{N}(ij)=\left\{\begin{array}[]{lr}\displaystyle 1 -\sum_{u\in i}\frac{w_{i}}{d_{u}\delta_{i}}&i=j\\ \displaystyle\left(-\sum_{\begin{subarray}{c}u\in H(i)\cap H(j)\\ \vee u\in T(i)\cap T(j)\end{subarray}}\frac{w_{i}^{\frac{1}{2}}w_{j}^{\frac{1} {2}}}{d_{u}}-\text{i}\left(\sum_{\begin{subarray}{c}u\in H(i)\cap T(j)\end{ subarray}}\frac{w_{i}^{\frac{1}{2}}w_{j}^{\frac{1}{2}}}{d_{u}}-\sum_{\begin{ subarray}{c}u\in T(i)\cap H(j)\end{subarray}}\frac{w_{i}^{\frac{1}{2}}w_{j}^{ \frac{1}{2}}}{d_{u}}\right)\right)\frac{1}{\delta_{i}^{\frac{1}{2}}}\frac{1}{ \delta_{j}^{\frac{1}{2}}}&i\neq j\end{array}\right.$ (12) $$

When $i=j$, we are in the self-loop part of the equation and $\mathbb{\vec{L}}_{N}(ij)$ weights hyperedge $i$ proportionally to its weight $w_{i}$ and inversely proportionally to its density and the density of its nodes.
When $i\neq j$, $\mathbb{\vec{L}}_{N}(ij)$’s value depends on the interactions between the hyperedges of $\vec{H}$ (which correspond to the nodes of $DGL(\vec{H})$).
Let $u\in V$ be a node and $i,j\in E$ be two hyperedges in the hypergraph $\vec{H}$.
If $u$ belongs to the head set of both the hyperedges (i.e., $u\in H(i)\cap H(j)$) or to the tail set of both (i.e., $u\in T(i)\cap T(j)$), its contribution to the real part of $\mathbb{L}_{N}(ij)$, $\Re(\mathbb{\vec{L}}_{N}(ij))$, is negative.
For the undirected line graph associated with an undirected hypergraph, this is the only contribution, consistent with the behavior of $\mathbb{L}_{N}$ (as described in equation 6).
If $u$ takes opposite roles in hyperedges $i$ and $j$, i.e, it belongs to the head set in $i$ and to the tail set in $j$ or vice versa, it contributes to the imaginary part of $\mathbb{L}_{N}$, $\Im(\mathbb{\vec{L}}_{N}(ij)$, negatively when $u\in H(i)\cap T(j)$, and positively when $u\in T(i)\cap H(j)$.
Consequently $\Im(\mathbb{\vec{L}}_{N}(ij))$ coincides with the net contribution of all the vertices that are shared between the hyperedges $i$ and $j$.
An example illustrating the construction of $\mathbb{\vec{L}}_{N}$ for a directed line graph associated with a directed hypergraph is provided in Appendix F.
Let us point out that the behavior of Directed Line Graph Laplacian differs from every (to the best of our knowledge) Laplacian matrix previously proposed in literature (see Appendix A for more details).

With the following theorem, we show that $\mathbb{\vec{L}}_{N}$ is a generalization of $\mathbb{L}_{N}$ (defined in equation 6) from the undirected to the directed case:
\Copythm:generalizeHyper

###### Theorem 1 .

If $\vec{H}$ is undirected (i.e., $\vec{H}=H$), $\mathbb{\vec{L}}_{N}=\mathbb{L}_{N}$ and $\mathbb{\vec{Q}}_{N}=\mathbb{Q}_{N}$ holds.

The Directed Line Graph Laplacian enjoys several properties. First, to be able to adopt our Laplacian within a convolution operator in line with Kipf and Welling () and other literature approaches (Zhang et al., ; Fiorini et al., ), we must show that our Laplacian is positive semidefinite. For this, we work out the expression for the $2$-Dirichlet energy function associated with it. Such a function coincides with the Euclidean norm $||x||^{2}_{\mathbb{\vec{L}}_{N}}$ induced by $\mathbb{\vec{L}}_{N}$ for a signal $x\in\mathbb{C}^{n}$:
\Copythm:dirichlet

###### Theorem 2 .

Letting $\mathbf{1}$ be the indicator function, the Euclidean norm induced by $\mathbb{\vec{L}}_{N}$ of a complex-valued signal $x=a+\text{i}b\in\mathbb{C}^{n}$ reads:

$$ $\displaystyle\frac{1}{2}\sum_{u\in V}\frac{1}{d(u)}\sum_{i,j\in E}w(i)^{\frac{ 1}{2}}\Bigg{(}$ $\displaystyle\left(\left(\frac{a_{i}}{\delta(i)^{\frac{1}{2}}}-\frac{a_{j}}{ \delta(j)^{\frac{1}{2}}}\right)^{2}+\left(\frac{b_{i}}{\delta(i)^{\frac{1}{2}} }-\frac{b_{j}}{\delta(j)^{\frac{1}{2}}}\right)^{2}\right)\mathbf{1}_{u\in H(i) \cap H(j)\vee u\in T(i)\cap T(j)}$ $\displaystyle+\left(\left(\frac{a_{i}}{\delta(i)^{\frac{1}{2}}}-\frac{b_{j}}{ \delta(j)^{\frac{1}{2}}}\right)^{2}+\left(\frac{a_{j}}{\delta(j)^{\frac{1}{2}} }+\frac{b_{i}}{\delta(i)^{\frac{1}{2}}}\right)^{2}\right)\mathbf{1}_{u\in H(i) \cap T(j)}$ $\displaystyle+\left(\left(\frac{a_{i}}{\delta(i)^{\frac{1}{2}}}+\frac{b_{j}}{ \delta(j)^{\frac{1}{2}}}\right)^{2}+\left(\frac{a_{j}}{\delta(j)^{\frac{1}{2}} }-\frac{b_{i}}{\delta(i)^{\frac{1}{2}}}\right)^{2}\right)\mathbf{1}_{u\in T(i) \cap H(j)}\Bigg{)}w(j)^{\frac{1}{2}}.$ (13) $$

Since the function in Theorem 2 is a real-valued sum of squares, we deduce the following spectral property for $\mathbb{\vec{L}}_{N}$:
\Copythm:psdL

###### Corollary 1 .

$\mathbb{\vec{L}}_{N}$ is positive semidefinite.

From equation 9, we have that $\mathbb{\vec{L}}_{N}=I-\mathbb{\vec{Q}}_{N}$. Thanks to Theorem 3, we show next that $\mathbb{\vec{Q}}_{N}$ has a nonnegative spectrum:
\Copythm:psd

###### Theorem 3 .

$\mathbb{\vec{Q}}_{N}$ is positive semidefinite.

By applying Theorem 3 and Corollary 1, we can derive upper bounds on the spectra of $\mathbb{\vec{L}}_{N}$ and $\mathbb{\vec{Q}}_{N}$:
\Copythm:eigenvalues

###### Corollary 2 .

$\lambda_{\max}(\mathbb{\vec{L}}_{N})\leq 1$ and $\lambda_{\max}(\mathbb{\vec{Q}}_{N})\leq 1$.

The proofs of the theorems and corollaries of this section can be found in Appendix A.

###### Definition 1 .

###### Theorem 1 .

###### Theorem 2 .

###### Corollary 1 .

###### Theorem 3 .

###### Corollary 2 .

## 4 The Directed Line Graph Network (DLGNet)

The properties of the proposed Laplacian make it possible to derive a well-defined spectral convolution operator from it. In this work, this operator is integrated into the Directed Line Graph Network (DLGNet).
Specifically, based on equation 4, by setting $\mathcal{L}=\mathbb{\vec{L}}_{N}$, the convolution operator is defined as $\hat{Y}x=\theta_{0}I+\theta_{1}\mathbb{\vec{L}}_{N}$.
The advantage of adopting two parameters $\theta_{0},\theta_{1}$ within DLGNet’s localized filter is explained by the following result:
\Copythm:parameters

###### Proposition 1 .

The convolution operator derived from equation 4 by setting $\mathcal{L}=\mathbb{\vec{L}}_{N}$ with parameters $\theta_{0}$ and $\theta_{1}$
is the same as the convolution operator obtained by using $\mathcal{L}=\mathbb{\vec{Q}}_{N}$ with parameters are rewritten as $\theta_{0}^{\prime}=\theta_{0}+\theta_{1}$ and $\theta_{1}^{\prime}=-\theta_{1}$.

This shows that DLGNet, by selecting appropriate values for $\theta_{0}$ and $\theta_{1}$, can leverage either $\mathbb{\vec{L}}_{N}$ or $\mathbb{\vec{Q}}_{N}$ as convolution operator to maximize the performance on the task at hand.

We define $X\in\mathbb{C}^{m\times c_{0}}$ as a $c_{0}$-dimensional graph signal (a graph signal with $c_{0}$ input channels), which we compactly represent as a matrix.
This matrix serves as the feature matrix of the hyperedges of $\vec{H}$ which we construct from the feature matrix of the nodes $X^{\prime}\in\mathbb{C}^{n\times c_{0}}$ of $\vec{H}$. Specifically, inspired by the operation used in the reduction component for graph pooling (Grattarola et al., ), we define the feature matrix for the vertices of $DGL(\vec{H})$ as $X=\vec{B}^{*}X^{\prime}$. This approach combines features through summation, based on the topology defined by $\vec{B}$. See Appendix D for more details.

In our network, the scalar parameters $\theta_{0}$ and $\theta_{1}$ are subsumed by
two operators $\Theta_{0},\Theta_{1}\in\mathbb{C}^{c_{0}\times c}$ which we use to carry out a linear transformation on the feature matrix $X$. A similar transformation, which can also increase or decrease the number of channels of $X$, is adopted in other GNNs such as MagNet (Zhang et al., ).
DLGNet features $\ell$ convolutional layers. The output $Z\in\mathbb{C}^{m\times c^{\prime}}$ of any such layer adheres to the following equation:

$$ $Z(X)=\phi\left(IX\Theta_{0}+\mathbb{\vec{L}}_{N}X\Theta_{1}\right),$ (14) $$

where $\phi$ is the activation function. Following (Fiorini et al., , ), DLGNet employs a complex ReLU where $\phi(z)=z$ if $\Re(z)\geq 0$ and $\phi(z)=0$ otherwise, with $z\in\mathbb{C}$.
DLGNet also utilizes a residual connection for every convolutional layer except the first one, a choice which helps prevent oversmoothing and has been proven to be helpful in a number of works, including (He et al., ; Kipf and Welling, ).
After the convolutional layers, following Zhang et al. (), we apply an unwind operation where we transform $Z(X)\in\mathbb{C}^{m\times c^{\prime}}$ into $(\Re(Z(X))||\Im(Z(X)))\in\mathbb{R}^{n\times 2c^{\prime}}$, where $||$ is the concatenation operator.
To obtain the final results, DLGNet features $S$ linear layers, with the last one employing a Softmax activation function.

###### Proposition 1 .

#### Complexity of DLGNet.

Let us assume (w.l.o.g.) that each of DLGNet’s convolutional layers has $c$ input and output channels, while the last layer has $c$ input and $c^{\prime}$ output channels ($c^{\prime}$ is also the number of input channel to the linear layers). Let $d$ be number of output channel of the last linear layer (where $d$ is the number of classes to be predicted).
With $\ell$ convolutional layers and $S$ linear layers, DLGNet’s complexity is
$O(mnc_{0})+O(\ell(m^{2}c+mc^{2})+mc+(S-1)(mc^{\prime 2})+mc^{\prime}d+md)$.
Assuming $O(c)=O(c^{\prime})=O(d)=\bar{c}$, we have a complexity of $O(\ell(m^{2}\bar{c})+(\ell+S)(m\bar{c}^{2}))$.
This shows that DLGNet has a quadratic complexity w.r.t. the number of hyperpedges $m$ and the asymptotic number of channels $\bar{c}$.
For more details, see Appendix B.

## 5 Experimental results

We present three real-world datasets, the baseline models, and the results on the chemical reaction classification task, where we predict the reaction type based on a given set of molecules.

### 5.1 Datasets

We test DLGNet on the most common organic chemistry reaction classes, namely a variety of chemical transformations that are fundamental to both research and industrial chemistry.
Those include molecular rearrangements, such as the interconversion (substitution) or the elimination of molecular substituents, as well as the introduction of specific functional groups (e.g., acyl, alkyl, or aryl groups) in a chemical compound. Other important reactions classes involve the formation of certain bond-types (e.g., carbon-carbon: C–C) or structures (e.g., heterocyclic compounds), the change in the oxidation state of a molecular species (oxidation-reduction processes), and the protection/deprotection of functional groups, allowing to temporarily block a specific reactive site at a certain step in a synthetic route.
For our study, we rely on a standard dataset (Dataset-1) and additionally construct two new ones (Dataset-2 and Dataset-3):—see Figure 2.

Figure: Figure 2: (Upper panel, left): example from Dataset-1. C–C bond formation via reaction of alkyne with alkyl halide; only bi-molecular reactant and main product are taken into account (any byproduct is omitted). (Upper panel, right): example from Dataset-2. C–N bond formation via Buchwald-Hartwig amination; apart from bi-molecular reactant (amine and aryl halide) and main product, catalyst (palladium compound), solvent (dioxane) and base (sodium tert-butoxide) structures are also present. Chemical elements: carbon (C), nitrogen (N), oxygen (O), hydrogen (H), chlorine (Cl), iodine (I), sodium (Na), phosphorus (P) and palladium (Pd). Single, double and triple black lines: bonds between C atoms. H, T: Head and Tail of the directed hypergraph. (Lower panel): schematic representation of Dataset-3 elements. Left side: reactants; right side: competitive outcomes between bimolecular nucleophilic substitution (SN2) or bimolecular elimination (E2). Thus, each element is composed either of a bi-molecular reactant and a bi-molecular product (SN2 class), or a bi-molecular reactant and a tri-molecular product (E2 class). X and Y: leaving group and nucleophile agent. Groups A-D: different substituents attached to the alkane carbon backbone (black).
Refer to caption: extracted/5913805/figures/dataset_small1.png

Dataset-1. As main source of data, we use the reactions from USPTO granted patents (Lugo-Martinez et al., ), which is the most widely used dataset for retrosynthesis problems and contains about 480K reactions.
After removing duplicates and erroneous reactions, we select a subset, namely Dataset-1, comprising 50K atom-mapped reactions belonging to 10 different classes. An example component from Dataset-1 is reported in Figure 2, left upper panel. The composition of the dataset is detailed in Table 3, Appendix C.

Dataset-2. This dataset is the result of the merging of data from five different sources and contains 5300 reactions. It presents a smaller number of reaction types, but a larger variety of substituents and reaction conditions, such as the presence of solvent or catalyst, hence providing additional complexity on some specific classes for the model to predict.
Figure 2, upper right panel illustrates an example from it.
Given that some elements are shared across the data sources, we combine them into three major classes.
The elements of the first class (C–C bond formation)
are extracted from two separated collections present in the Open Reaction Database (ORD) Project (Kearnes et al., ). Those are the Reizman et al. () data for the Pd-catalyzed Suzuki–Miyaura cross-coupling reactions and a vast collection of Pd-catalyzed imidazole-aryl coupling reactions, via C-H arylation.
The elements of Class 2 (N-arylation) includes data of Pd-catalyzed N-arylation (Buchwald-Hartwig) reactions from the AstraZeneca ELN dataset, also generated from the ORD website. This class has been further divided in 3 sub-classes according to the nature of the aryl halide used for the coupling.
Finally, the third class contains an ORD collection of data for amide bond formation processes.
Details about Dataset-2 composition are reported in Table 4, Appendix C.

Dataset-3. Since the wo datasets listed so far only include single-product reactions, in order to test the model on a highly complex task we add a third collection, Dataset-3, comprised of double-product bimolecular nucleophilic substitution (SN2) and triple-product bimolecular elimination (E2) reaction classes, extracted from von Rudorff et al. () and totaling 649 competitive reactions.
A schematic representation of Dataset-3 elements is reported in Figure 2, lower panel. Further details can be found in Appendix C.

In all three datasets, the node features are build based on Morgan Fingerprints (MFs) Rogers and Hahn (), which are one of the most widely used molecular descriptors. MFs encode a molecule by capturing the presence or absence of specific substructures (fragments) within the molecular graph. The algorithm iteratively updates the representation of each atom based on its local environment, enclosed within a radius.
A radius of $r$ indicates that the environment up to $r$ bonds away from each atom is incorporated into the final representation.

### 5.2 Baselines and Experimental Details

We evaluate the performance of DLGNet against 12 state-of-the-art (baseline) methods: i) Undirected Hypergraph Neural Networks (HNNs): HGNN (Feng et al., ), HCHA(^3^33Among the many versions of HCHA in Dong et al. (), we use the one implemented in [https://github.com/Graph-COM/ED-HNN](https://github.com/Graph-COM/ED-HNN), which coincides with HGNN^+ (Gao et al., ).) (Bai et al., ), HCHA with the attention mechanism (Bai et al., ), HNHN (Dong et al., ), UniGCNII (Huang and Yang, ), HyperDN (Tudisco et al., ), AllDeepSets (Chien et al., ), AllSetTransformer (Chien et al., ), LEGCN Yang et al. (), ED-HNN (Wang et al., ), and PhenomNN (Wang et al., ); ii) Directed HNN: DHM (Zhao et al., ).
Since all the competitors operate directly on the undirected or directed hypergraph, we apply the feature transfer operation $X=\vec{B}^{*}X^{\prime}$ described in Section 3 (more details in Appendix D) after the convolutional layers. After this step, each method is equipped with $\ell$ linear layers.
The hyperparameters of these baselines and of our proposed model are selected via grid search (see Appendix D).
The datasets are split into 50% for training, 25% for validation, and 25% for testing.
The experiments are conducted with 5-fold cross-validation, reporting the average F1-score across the splits. We choose the F1-score as evaluation metric due to the class imbalance naturally present in the datasets.
Throughout the tables contained in this section, the best results are reported in boldface and the second best are underlined.

### 5.3 Results

#### Quantitative.

The F1-score along with the relative standard deviation across different methods, datasets, and folds is presented in Table 1. The results show that, across the three datasets, DLGNet achieves an average additive performance improvement over the best-performing competitor of approximately 23.51 percentage points. In terms of Relative Percentage Difference (RPD)(^4^44The RPD of two values $P_{1},P_{2}$ is the percentage ratio of their difference to their average, i.e., $|P_{1}-P_{2}|/\frac{P_{1}+P_{2}}{2}\%$.), we have an average RPD improvement of 33.01%.
DLGNet achieves the best improvement on Dataset-3, with an average RPD improvement of approximately 37.71% and an average additive improvement of 31.65 percentage points.
A clear trend emerges: HNNs-based methods designed for undirected hypergraphs consistently underperform compared to DHM, which is the only method specifically designed for handling directed hypergraphs. Crucially, our proposed DLGNet, which operates on the directed line graph, surpasses all the competitors in performance, incuding DHM.

**Table 1: Mean F1-score and standard deviation obtained on the hyperedge classification task.**
| Topology | Method | Dataset-1 | Dataset-2 | Dataset-3 |
| --- | --- | --- | --- | --- |
|  | HGNN | 9.71 $\pm$ 3.02 | 36.40 $\pm$ 7.27 | 64.97 $\pm$ 1.36 |
|  | HCHA/HGNN^+ | 9.99 $\pm$ 1.91 | 39.89 $\pm$ 4.93 | 63.46 $\pm$ 2.58 |
|  | HCHA w/ Attention | 9.90 $\pm$ 2.25 | 11.32 $\pm$ 0.16 | 35.55 $\pm$ 1.31 |
| Hypergraph | HNHN | 6.95 $\pm$ 0.97 | 25.04 $\pm$ 3.45 | 52.97 $\pm$ 5.17 |
| UniGCNII | 8.20 $\pm$ 2.39 | 29.86 $\pm$ 0.31 | 50.97 $\pm$ 6.84 |  |
| HyperND | 4.63 $\pm$ 0.04 | 28.98 $\pm$ 0.46 | 52.71 $\pm$ 12.32 |  |
| AllDeepSets | 7.64 $\pm$ 2.23 | 30.45 $\pm$ 0.27 | 51.72 $\pm$ 5.99 |  |
| AllSetTransformer | 8.63 $\pm$ 2.62 | 30.67 $\pm$ 0.57 | 49.24 $\pm$ 3.98 |  |
|  | ED-HNN | 9.19 $\pm$ 1.43 | 30.47 $\pm$ 0.56 | 50.52 $\pm$ 10.17 |
|  | PhenomNN | 8.33 $\pm$ 2.77 | 29.43 $\pm$ 0.39 | 51.82 $\pm$ 9.33 |
| Directed Hypergraph | DHM | 46.04 $\pm$ 0.58 | 59.31 $\pm$ 4.04 | 68.10 $\pm$ 3.60 |
| Directed-Line Graph | DLGNet | 60.55 $\pm$ 0.80 | 83.67 $\pm$ 3.41 | 99.75 $\pm$ 0.34 |

#### Qualitative.

To gain deeper insights into the capability of DLGNet of classifying different reaction types, we analyze the confusion matrices for Dataset-1 and Dataset-2. The results of this analysis are presented in Figure 4 and Figure 5 in Appendix E.
The confusion matrix for Dataset-1 reveals
that, while most of the classes are predicted extremely well, e.g., Protection and Functional group addition reactions (accuracy of 88% and 77%, respectively),
some are predicted not as well, e.g., Functional group interconversion (41%). To better understand this behavior, we conducted a thorough inspection of the structural features of Dataset-1’s components, selecting several elements from pairs of classes among which the model yields the highest uncertainty. Two example cases are reported in Figure 3.
Overall, our analysis reveals that the pair of classes which are subject to the higher degree of confusion are, structurally, highly similar, which well explains the poorer performance that DLGNet achieves on them, as we illustrate in the following.
The left panel illustrates the mislabeling of Class 9 (Functional group interconversions, correctly predicted in 41% of the cases) with Class 7 (Reductions, incorrectly predicted in 14% of the cases), while the right panel presents an example of Class 4 (Heterocycle formations, correctly predicted in 44% of the cases) with Class 1 (Arylations, incorrectly predicted 30% of the cases).
Notably, in these examples, both the main backbone structure of the molecules and the substituent groups (the segments affected by the reactive process, highlighted in the figure) exhibit a high degree of similarity between the two classes.
In the left panel, the reactants of both classes present a 6-carbon ring (in grey) as well as a iodine substituent (in purple).
The atoms composing the highlighted groups are also of the same types.
On the other hand, in the right panel, the majority of the constituent parts of the products are in common between the two classes. Specifically, despite the outcome of Class 4 is the formation of a heterocycle, i.e., a hexagonal ring containing a heteroatom (nitrogen, in blue), such a geometrical feature is also present in Class 1 arylation product, as the resulting molecule presents two heterocycles rings.
Similar considerations apply to the incorrect labeling of Dataset-2 N-arylation sub classes, where the main difference between the reactants lies in the nature of the aryl halide that participates in the coupling reaction.
In summary, we conclude that the model demonstrates strong predictive performance across the majority of the classes, although a few, particularly those with shared elements, remain challenging to differentiate. Nevertheless, we are confident that DLGNet will prove highly valuable to the chemistry community, allowing for the categorization of existing data sources as well as for planning new synthetic routes.

Figure: Figure 3: Ball-and-stick 3D model of Dataset-1 mislabeled pairs of reaction classes. Color code: grey for carbon, red for oxygen, blue for nitrogen, purple for iodine, green for chlorine, light green for fluorine, brown for bromide, and white for hydrogen. (Left panel, upper): Reduction from a ester to a alcohol substituent on a 6-carbon atoms ring. (Left panel, lower): Functional group interconversion from carboxyl to carbonyl group in the analog hexagonal structure. (Right panel, upper): arylation reaction between a amine compound and a aryl halide, yielding a C–N bond in the final product. (Right panel, lower): heterocycle formation via amide intramolecular condensation, producing a hexagonal ring containing a heteroatom (nitrogen).
Refer to caption: x1.png

#### Ablation study.

Table 2 presents the results of an ablation study carried out on DLGNet to assess the importance of directionality in DLGNet’s line graph. To do this, we test DLGNet using an undirected line graph and demonstrate that DLGNet consistently outperforms its undirected counterpart on all three data sets. This indicates that directionality plays a crucial role in solving the chemical reaction classification task.
Focusing on equation 14, we test DLGNet under two conditions: i) using $\mathbb{\vec{Q}}_{N}$ instead of $\mathbb{\vec{L}}_{N}$, and ii) setting $\Theta_{0}=0$, thus nullifying the first term in equation 14. The first comparison shows identical results across all datasets, thus providing a computational confirmation of the results of Proposition 1, while the restricted version of DLGNet with $\Theta_{0}=0$ performs worse.
Finally, we assess the architectural choice related to the incorporation of skip connections. While DLGNet without skip connections exhibits a slight drop in performance, the results remain close to those of the original architecture.

**Table 2: Ablation study. Average F1-score and standard deviation are reported.**
| Method | Dataset-1 | Dataset-2 | Dataset-3 |
| --- | --- | --- | --- |
| DLGNet | 60.55 $\pm$ 0.80 | 83.67 $\pm$ 3.41 | 99.75 $\pm$ 0.34 |
| DLGNet w/o directionality | 52.07 $\pm$ 1.61 | 70.19 $\pm$ 0.65 | 81.65 $\pm$ 8.39 |
| DLGNet w/ Signless Laplacian | 60.24 $\pm$ 0.36 | 82.86 $\pm$ 1.96 | 99.75 $\pm$ 0.55 |
| DLGNet w/ $\Theta_{0}=0$ | 53.82 $\pm$ 0.74 | 75.68 $\pm$ 3.59 | 91.45 $\pm$ 2.36 |
| DLGNet w/o skip-connection | 56.38 $\pm$ 3.02 | 80.63 $\pm$ 3.54 | 99.63 $\pm$ 0.34 |

## 6 Conclusions

We introduced the Directed Line Graph Network (DLGNet), the first spectral GNN specifically designed
to operate on directed line graphs associated with directed hypergraphs by directly convolving hyperedge features.
DLGNet leverages a novel complex-valued Laplacian matrix, the Directed Line Graph Laplacian, which is a Hermitian matrix encoding the interactions among the hyperedges of a hypergraph using complex numbers. This formulation allows for the natural representation of both directed and undirected relationships between the hyperedges, capturing rich structural information.
Our proposed DLGNet network utilizes this new Laplacian matrix to perform spectral convolutions on the line graph featuring both undirected and directed edges.
Via the Directed Line Graph representation, our proposed model enables the seamless integration of the directionality present in the hypergraph at hand, which is crucial for accurately modeling various real-world phenomena involving asymmetric high-order interactions.

We evaluated our approach on the chemical reaction classification problem using three real-world datasets. In these experiments, we demonstrated the superiority of DLGNet, which achieved an average relative percentage difference improvement of 33.01% over the second-best method across the three datasets.
This highlights the importance of directly convolving the hypergraph features on the directed line graph, instead of doing so in the undirecetd/directed hypergraph. Though an ablation study, we demonstrated the relevance of encoding directional information via the directed line graph associated with a directed hypergraph as opposed to ignoring it. We also provided a qualitative analysis DLGNet’s results in light of the underlying chemical reaction classification task.

In light of the promising results we obtained and as a future perspective, we would like to address more complex and challenging tasks, such as retrosynthetic planning and reaction discovery, which require sophisticated analysis and deeper insights into the underlying chemical processes.

## Appendix A Properties of Our Proposed Laplacian

This section contains the proofs of the theorems and corollaries reported in the main paper.

thm:generalizeHyper

###### Proof.

Since ${H}=(V,E)$ is an undirected hypergraph, $\vec{B}$ is binary and only takes values 0 and 1 (rather than being ternary and taking values $0,1,-\text{i}$), defining an undirected line graph $L(H)$. In particular, for each edge $e\in E$ we have $\vec{B}_{ue}=1$ if either $u\in H(e)$ or $u\in T(e)$ and $\vec{B}_{ue}=0$ otherwise. Consequently, the directed incident matrix $\vec{B}$ is identical to the non-directed incidence matrix $B$, i.e., $\vec{B}=B$. Thus, by construction, $\mathbb{\vec{L}}_{N}=\mathbb{L}_{N}$ and $\mathbb{\vec{Q}}_{N}=\mathbb{Q}_{N}$.
∎

thm:dirichlet

###### Proof.

$$ $\displaystyle x^{*}\mathbb{\vec{L}}_{N}x=$ $\displaystyle\sum_{i\in E}x_{i}^{*}x_{i}-\sum_{i,j\in E}\sum_{u\in V}\frac{1}{ d(u)}\frac{w(i)^{-\frac{1}{2}}\vec{B}(u,i)^{*}\vec{B}(u,j)w(j)^{-\frac{1}{2}}} {\delta(i)^{\frac{1}{2}}\delta(j)^{\frac{1}{2}}}x_{i}x_{j}^{*}$ $\displaystyle=$ $\displaystyle\sum_{i\in E}x_{i}^{*}x_{i}-\sum_{u\in V}\sum_{i,j\in E}\frac{1}{ d(u)}\frac{w(i)^{-\frac{1}{2}}\vec{B}(u,i)^{*}\vec{B}(u,j)w(j)^{-\frac{1}{2}}} {\delta(i)^{\frac{1}{2}}\delta(j)^{\frac{1}{2}}}x_{i}x_{j}^{*}$ $\displaystyle=$ $\displaystyle\sum_{i\in E}x_{i}^{*}x_{i}-\sum_{u\in V}\frac{1}{d(u)}\sum_{i,j \in E:i\leq j}w(i)^{-\frac{1}{2}}\left(\vec{B}(u,i)^{*}\vec{B}(u,j)^{*}\frac{x _{i}x_{j}^{*}}{\delta(i)^{\frac{1}{2}}\delta(j)^{\frac{1}{2}}}+\vec{B}(u,j)^{* }\vec{B}(u,i)\frac{x_{j}x_{i}^{*}}{\delta(j)^{\frac{1}{2}}\delta(i)^{\frac{1}{ 2}}}\right)w(j)^{-\frac{1}{2}}$ $\displaystyle=$ $\displaystyle\sum_{u\in V}\frac{1}{d(u)}\sum_{i,j\in E:i\leq j}w(i)^{-\frac{1} {2}}\left(\frac{x_{i}^{*}x_{i}}{\delta(i)}+\frac{x_{j}^{*}x_{j}}{\delta(j)} \right)w(j)^{-\frac{1}{2}}$ $\displaystyle-\sum_{u\in V}\frac{1}{d(u)}\sum_{i,j\in E:i\leq j}w(i)^{-\frac{1 }{2}}\left(\vec{B}(u,i)^{*}\vec{B}(u,j)^{*}\frac{x_{i}x_{j}^{*}}{\delta(i)^{ \frac{1}{2}}\delta(j)^{\frac{1}{2}}}+\vec{B}(u,j)^{*}\vec{B}(u,i)\frac{x_{j}x_ {i}^{*}}{\delta(j)^{\frac{1}{2}}\delta(i)^{\frac{1}{2}}}\right)w(j)^{-\frac{1} {2}}$ $\displaystyle=$ $\displaystyle\sum_{u\in V}\frac{1}{d(u)}\sum_{i,j\in E:i\leq j}w(i)^{-\frac{1} {2}}\left(\frac{x_{i}^{*}x_{i}}{\delta(i)}+\frac{x_{j}^{*}x_{j}}{\delta(j)}- \vec{B}(u,i)^{*}\vec{B}(u,j)^{*}\frac{x_{i}x_{j}^{*}}{\delta(i)^{\frac{1}{2}} \delta(j)^{\frac{1}{2}}}-\vec{B}(u,j)^{*}\vec{B}(u,i)\frac{x_{j}x_{i}^{*}}{ \delta(j)^{\frac{1}{2}}\delta(i)^{\frac{1}{2}}}\right)w(j)^{-\frac{1}{2}}.$ $$

We proceed by analyzing the three possible cases for the summand.

Case 1.a: $u\in H(i)\cap H(j)$ $\Leftrightarrow$ $\vec{B}(u,i)=1,\vec{B}(u,j)=1$. We have $\vec{B}(u,i)^{*}\vec{B}(u,j)=\vec{B}(u,j)^{*}\vec{B}(u,i)=1$.

Case 1.b: $u\in T(i)\cap T(j)$ $\Leftrightarrow$ $\vec{B}(u,e)=-\text{i},\vec{B}(v,e)=-\text{i}$. We have $\vec{B}(u,i)^{*}\vec{B}(u,j)=\vec{B}(u,j)^{*}\vec{B}(u,i)=(-\text{i})^{*}(-
\text{i})=(-\text{i})(\text{i})=1$.

In both cases, we have:

$$ $\displaystyle w(i)^{-\frac{1}{2}}\left(\frac{x_{i}^{*}x_{i}}{\delta(i)}+\frac{ x_{j}^{*}x_{j}}{\delta(j)}-\frac{x_{i}x_{j}^{*}}{\delta(i)^{\frac{1}{2}}\delta (j)^{\frac{1}{2}}}+\frac{x_{j}x_{i}^{*}}{\delta(j)^{\frac{1}{2}}\delta(i)^{ \frac{1}{2}}}\right)w(j)^{-\frac{1}{2}}=$ $\displaystyle w(i)^{-\frac{1}{2}}\left(\frac{x_{i}}{\delta(i)^{\frac{1}{2}}}- \frac{x_{j}}{\delta(j)^{\frac{1}{2}}}\right)^{*}\left(\frac{x_{i}}{\delta(i)^{ \frac{1}{2}}}-\frac{x_{j}}{\delta(j)^{\frac{1}{2}}}\right)w(j)^{-\frac{1}{2}}.$ $$

Letting $x_{i}=a_{i}+\text{i}b_{i}$ and $x_{j}=a_{j}+\text{i}b_{j}$, we have:

$$ $w(i)^{-\frac{1}{2}}\left(\left(\frac{a_{i}}{\delta(i)^{\frac{1}{2}}}-\frac{a_{ j}}{\delta(j)^{\frac{1}{2}}}\right)^{2}+\left(\frac{b_{i}}{\delta(i)^{\frac{1} {2}}}-\frac{b_{j}}{\delta(j)^{\frac{1}{2}}}\right)^{2}\right)w(j)^{-\frac{1}{2 }}.$ $$

Case 2.a: $u\in H(i)\cap T(j)$ $\Leftrightarrow$ $\bar{B}(u,i)=1,\bar{B}(u,j)=-\text{i}$. We have $\bar{B}(u,i)^{*}\bar{B}(u,j)=(1)^{*}(-\text{i})=-\text{i}$ and $\bar{B}(u,j)^{*}\bar{B}(u,i)=(-\text{i})^{*}(1)=\text{i}$.

Thus:

$$ $\displaystyle w(i)^{-\frac{1}{2}}\left(\frac{x_{i}^{*}x_{i}}{\delta(i)}+\frac{ x_{j}^{*}x_{j}}{\delta(j)}+\text{i}\frac{x_{i}x_{j}^{*}}{\delta(i)^{\frac{1}{2 }}\delta(j)^{\frac{1}{2}}}-\text{i}\frac{x_{j}x_{i}^{*}}{\delta(j)^{\frac{1}{2 }}\delta(i)^{\frac{1}{2}}}\right)w(j)^{-\frac{1}{2}}$ $$

Let $x_{i}=a_{i}+\text{i}b_{i}$ and $x_{j}=a_{j}+\text{i}b_{j}$, then we have:

$$ $w(i)^{-\frac{1}{2}}\left(\left(\frac{a_{i}}{\delta(i)^{\frac{1}{2}}}-\frac{b_{ j}}{\delta(j)^{\frac{1}{2}}}\right)^{2}+\left(\frac{a_{j}}{\delta(j)^{\frac{1} {2}}}+\frac{b_{i}}{\delta(i)^{\frac{1}{2}}}\right)^{2}\right)w(j)^{-\frac{1}{2 }}.$ $$

Case 2.b: $u\in T(i)\cap H(j)$ $\Leftrightarrow$ $\bar{B}(u,i)=-\text{i},\bar{B}(u,j)=1$. We have $\bar{B}(u,i)^{*}\bar{B}(u,j)=(-\text{i})^{*}(1)=\text{i}$ and $\bar{B}(u,j)^{*}\bar{B}(u,i)=(1)^{*}(-\text{i})=-\text{i}$.
We have:

$$ $\displaystyle w(i)^{-\frac{1}{2}}\left(\frac{x_{i}^{*}x_{i}}{\delta(i)}+\frac{ x_{j}^{*}x_{j}}{\delta(j)}-\text{i}\frac{x_{i}x_{j}^{*}}{\delta(i)^{\frac{1}{2 }}\delta(j)^{\frac{1}{2}}}-+\text{i}\frac{x_{j}x_{i}^{*}}{\delta(j)^{\frac{1}{ 2}}\delta(i)^{\frac{1}{2}}}\right)w(j)^{-\frac{1}{2}}$ $$

Let $x_{i}=a_{i}+\text{i}b_{i}$ and $x_{j}=a_{j}+\text{i}b_{j}$, then we have:

$$ $w(i)^{-\frac{1}{2}}\left(\left(\frac{a_{i}}{\delta(i)^{\frac{1}{2}}}+\frac{b_{ j}}{\delta(j)^{\frac{1}{2}}}\right)^{2}+\left(\frac{a_{j}}{\delta(j)^{\frac{1} {2}}}-\frac{b_{i}}{\delta(i)^{\frac{1}{2}}}\right)^{2}\right)w(i)^{-\frac{1}{2 }}.$ $$

The final equation reported in the statement of the theorem is obtained by combining the four cases we just analyzed.
∎

thm:psdL

###### Proof.

Since $\mathbb{\vec{L}}_{N}$ is Hermitian, it can be diagonalized as $U\Lambda U^{*}$ for some $U\in\mathbb{C}^{n\times n}$ and $\Lambda\in\mathbb{R}^{n\times n}$, where $\Lambda$ is diagonal and real.
We have $x^{*}\mathbb{\vec{L}}_{N}x=x^{*}U\Lambda U^{*}x=y^{*}\Lambda y$ with $y=U^{*}x$. Since $\Lambda$ is diagonal, we have $y^{*}\Lambda y=\sum_{u\in V}\lambda_{u}y_{u}^{2}$.
Thanks to Theorem 2, the quadratic form $x^{*}\mathbb{\vec{L}}_{N}x$ associated with $\mathbb{\vec{L}}_{N}$ is a sum of squares and, hence, nonnegative. Combined with $x^{*}\mathbb{\vec{L}}_{N}x=\sum_{u\in L(V)}\lambda_{u}y_{u}^{2}$, we deduce $\lambda_{u}\geq 0$ for all $u\in L(V)$, where $L(V)$ is the vertex set of DLG($\vec{H}$).
∎

thm:eigenvalues

###### Proof.

$\lambda_{\text{max}}(\mathbb{\vec{L}}_{N})\leq 1$ holds if and only if $\mathbb{\vec{L}}_{N}-I\preceq 0$. Since $\mathbb{\vec{L}}_{N}=I-\mathbb{\vec{Q}}_{N}$ holds by definition, we need to prove $-\mathbb{\vec{Q}}_{N}\preceq 0$. This is the case due to Theorem 3.

Similarly, $\lambda_{\text{max}}(\mathbb{\vec{Q}}_{N})\leq 1$ holds if and only if $\mathbb{\vec{Q}}_{N}-I\preceq 0$. Since $\mathbb{\vec{Q}}_{N}=I-\mathbb{\vec{L}}_{N}$ holds by definition, we need to prove $-\mathbb{\vec{L}}_{N}\preceq 0$. This is the case due to Theorem 1.
∎

###### Proof.

###### Proof.

###### Proof.

###### Proof.

#### Directed Line Graph Laplacian and The Other Laplacians

Examining the behavior of the Directed Line Graph Laplacian through Equation 12, we observe that it differs from other Laplacians designed to handle both directed and undirected edges in graphs, such as the Magnetic Laplacian [Lieb and Loss, ] and the Sign Magnetic Laplacian [Fiorini et al., ].
Indeed, the Directed Line Graph Laplacian exhibits a unique characteristic: both its real and imaginary components can be simultaneously non-zero.
This is different from the case of the Sign Magnetic Laplacian, which can only have one of the two components different from zero at any given time, and also from the case of the Magnetic Laplacian, which coincides with the Sign Magnetic Laplacian when $q=\frac{1}{4}$ and the graph has binary weights.
Let us note that the Magnetic Laplacian can also have both components different from zero, but such a behavior is influenced by both the edge weight and the value of $q$, and may lead to the sign-pattern inconsistency described in Fiorini et al. [], which our proposed Directed Line Graph Laplacian does not suffer from.

## Appendix B Complexity of DLGNet

The detailed calculations for the (inference) complexity of DLGNet are as follows.

- 1.
The Directed Line Graph Laplacian $\mathbb{\vec{L}}_{N}$ is constructed in time $O(m^{2}n)$, where the factor $n$ is due to the need for computing the product between two columns of $\vec{B}$ (i.e., two rows of $B^{*}$) to calculate each entry of $\mathbb{\vec{L}}_{N}$. After $\mathbb{\vec{L}_{N}}$ has been computed, the convolution matrix $\hat{Y}\in\mathbb{C}^{m\times m}$ is constructed in time $O(m^{2})$. Note that such a construction is carried out entirely in pre-processing and is not required at inference time.
- 2.
Constructing the feature matrix $X=\vec{B}^{*}X^{\prime}$ requires $O(mnc_{0})$ elementary operations.
- 3.
Each of the $\ell$ convolutional layers of DLGNet requires $O(m^{2}c+mc^{2}+mc)=O(m^{2}c+mc^{2})$ elementary operations across 3 steps. Let $X^{l-1}$ be the input matrix to layer $l=1,\dots,\ell$. The operations that are carried out are the following ones.
(a)
$\mathbb{\vec{L}_{N}}$ is multiplied by the hyperedge-feature matrix $X^{l-1}\in\mathbb{C}^{m\times c}$, obtaining $P^{l_{1}}\in\mathbb{C}^{m\times c}$ in time $O(m^{2}c)$ (we assume, for simplicity, that matrix multiplications takes cubic time);
(b)
The matrices $P^{l_{0}}=IX^{l-1}=X^{l-1}$ and $P^{l1}$ are multiplied by the weight matrices $\Theta_{0},\Theta_{1}\in\mathbb{R}^{c\times c}$ (respectively), obtaining the intermediate matrices $P^{l_{01}},P^{l_{11}}\in\mathbb{C}^{n\times c}$ in time $O(mc^{2})$ .
(c)
The matrices $P^{l_{01}}$ and $P^{l_{11}}$ are additioned in time $O(mc)$ to obtain $P^{l_{2}}$.
(d)
The activation function $\phi$ is applied component wise to $P^{l_{2}}$ in time $O(mc)$, resulting in the output matrix $X^{l}\in\mathbb{C}^{m\times c}$ of the $l$-th convolutional layer.
- 4.
The unwind operator transforms $X^{\ell}$ (the output of the last convolutional layer $\ell$) into the matrix $U^{0}\in\mathbb{R}^{n\times 2c}$ in linear time $O(mc)$.
- 5.
Call $U^{s-1}$ the input matrix to each linear layer of index $s=1,\dots,S$. The application of the $s$-th linear layer to $U^{s-1}\in\mathbb{C}^{m\times c^{\prime}}$ requires multiplying $U^{s-1}$ by a weight matrix $M_{s}\in\mathbb{C}^{c^{\prime}\times c^{\prime}}$
(where $c^{\prime}$ is the number of channels from which and into which the feature vector of each node is projected). This is done in time $O(mc^{\prime 2})$.
- 6.
In the last linear layer of index $S$, the input matrix $U^{S-1}\in\mathbb{R}^{m\times c^{\prime}}$ is projected into the output matrix $O\in\mathbb{R}^{m\times d}$ in time $O(nc^{\prime}d)$.
- 7.
The application of the Softmax activation function takes linear time $O(md)$.

We deduce an overall complexity of
$O(mnc_{0})+O(\ell(m^{2}c+mc^{2})+mc+(S-1)(mc^{\prime 2})+mc^{\prime}d+md)$.
Assuming $O(c)=O(c^{\prime})=O(d)=\bar{c}$,
such a complexity coincides with
$O(\ell(m^{2}\bar{c})+(\ell+S)(m\bar{c}^{2}))$.

## Appendix C Further Details on the Datasets

Details on the datasets composition are reported in Tables 3, 4, 5.
Most of the elements of Dataset-1 belong to the first two classes, which concern the addition of functional groups to a chemical compound: alkyl and aryl groups for Class 1 and acyl groups for Class 2, comprising more than 17K species. Less populated classes involve specific chemical transformations, such as Class 3 (C–C bond formation) which contains less than 1000 elements.

Dataset-2 presents solely three classes; nevertheless, we have been able to extract sub-categories from two of them. Those are Class 1 (C–C bond formation) and Class 2 (N-arylation processes) and contain two and three sub-classes, respectively. The most populated class is Imidazole-aryl coupling, comprising around 1500 elements belonging to the class of palladium-catalyzed imidazole C-H arylation. The chemical diversity in this class is ensured by the use of 8 aryl bromides and 8 imidazole compunds. Furthermore, in terms of reaction conditions, the collection presents 24 different monophosphine ligands.

Unlike the previous ones, Dataset-3 has been assembled starting from competitive processes; therefore it contains almost the same amount of elements ($\sim$ 300) for the two classes: Bimolecular nucleophilic substitution (SN2) and eliminations (E2).
The reactants–which are in common between SN2 and E2—are substituted alkane compounds and nucleophile agents. The substituents span a range of electron donating and electron withdrawing effect strengths, including methyl, cyano, amine, and nitro functional groups. The nucleophiles have been chosen either between halide or hydrogen anions, while the molecular skeleton is ethane.

**Table 3: Distribution of the reactions in the Dataset-1.**
| Rxn class | Rxn name | Num rxns |
| --- | --- | --- |
| 1 | Heteroatom alkylation and arylation | 15151 |
| 2 | Acylation and related process | 11896 |
| 3 | C-C bond formation | 909 |
| 4 | Heterocycle formation | 4614 |
| 5 | Protections | 1834 |
| 6 | Deprotections | 5662 |
| 7 | Reductions | 672 |
| 8 | Oxidations | 811 |
| 9 | Functional group interconversion | 8237 |
| 10 | Functional group addition | 230 |

**Table 4: Distribution of the reactions in the Dataset-2.**
| Rxn class | Rxn name | Num rxns |
| --- | --- | --- |
| 1 | C-C bond formation | 1921 |
|  | - Reizman Suzuki Cross-Coupling | 385 |
|  | - Imidazole-aryl coupling | 1536 |
| 2 | Heteroatom (N) arylation: | 657 |
|  | - Amine + Aryl bromide | 278 |
|  | - Amine + Aryl chloride | 299 |
|  | - Amine + Aryl iodide | 80 |
| 3 | Amide bond formation | 960 |

**Table 5: Distribution of reactions in the Dataset-3.**
| Rxn class | Rxn name | Num rxns |
| --- | --- | --- |
| 1 | Bimolecular nucleophilic substitution (SN2) | 301 |
| 2 | Bimolecular elimination (E2) | 348 |

## Appendix D Further Details on the Experiments

#### Hardware.

The experiments were conducted on 2 different machines:

- 1.
An Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz with 380 GB RAM, equipped with an NVIDIA Ampere A100 40GB.
- 2.
A 12th Gen Intel(R) Core(TM) i9-12900KF CPU @ 3.20GHz CPU with 64 GB RAM, equipped with an NVIDIA RTX 4090 GPU.

#### Model Settings.

We trained every learning model considered in this paper for up to 1000 epochs. We adopted a learning rate of $5\cdot 10^{-3}$ and employed the optimization algorithm Adam with weight decays
equal to $5\cdot 10^{-4}$ (in order to avoid overfitting). We set the number of linear layers to 2, i.e. $\ell=2$, for all the models.

We adopted a hyperparameter optimization procedure to identify the best set of parameters for each model. In particular, the hyperparameter values are:

- •
For AllDeepSets and ED-HNN, the number of basic block is chosen in $\{1,2,4,8\}$, the number of MLPs per block in $\{1,2\}$, the dimension of the hidden MLP (i.e., the number of filters) in $\{64,128,256,512\}$, and the classifier hidden dimension in $\{64,128,256\}$.
- •
For AllSetTransformer the number of basic block is chosen in $\{2,4,8\}$, the number of MLPs per block in $\{1,2\}$, the dimension of the hidden MLP in $\{64,128,256,512\}$, the classifier hidden dimension in $\{64,128,256\}$, and the number of heads in $\{1,4,8\}$.
- •
For UniGCNII, HGNN, HNHN, HCHA/HGNN^+, LEGCN, and HCHA with the attention mechanism, the number of basic blocks is chosen in $\{2,4,8\}$ and the hidden dimension of the MLP layer in $\{64,128,256,512\}$.
- •
For HyperGCN, the number of basic blocks is chosen in $\{2,4,8\}$.
- •
For HyperND, the classifier hidden dimension is chosen in $\{64,128,256\}$.
- •
For PhenomNN, the number of basic blocks is chosen in $\{2,4,8\}$. We select four different settings:
1.
$\lambda_{0}=0.1$, $\lambda_{1}=0.1$ and prop step$=8$,
2.
$\lambda_{0}=0$, $\lambda_{1}=50$ and prop step$=16$,
3.
$\lambda_{0}=1$, $\lambda_{1}=1$ and prop step$=16$,
4.
$\lambda_{0}=0$, $\lambda_{1}=20$ and prop step$=16$.
- •
For DHM, the number of basic blocks is chosen in $\{1,2,3,4\}$ and the classifier hidden dimension is chosen in $\{64,128,256,512\}$.
- •
For DLGNet,
the number of convolutional layers is chosen in $\{1,2,3\}$, the number of filters in $\{64,128,256,512\}$, and the classifier hidden dimension in $\{64,128,256\}$. We tested DLGNet both with the input feature matrix $X\in\mathbb{C}^{n\times c}$ where $\Re(X)=\Im(X)\neq 0$ and with $\Im(X)=0$.

#### How to Transfer The Features.

As mention in Section 4, a key aspect of our approach involves transferring features from the nodes of the hypergraph to their corresponding hyperedges, i.e., the nodes of the directed line graph. To clarify this mechanism, we provide a simple example.
Consider a directed hypergraph $\vec{H}=(V,E)$, where the vertex set is $V=\{u,v,c\}$ and the hyperedge set consists of $E=\{e_{1}\}$.
In $\vec{H}$, we have $H(e_{1})=\{u,v\}$ and $T(e_{1})=\{c\}$.
Each vertex is assigned a feature vector $x^{\prime}_{u},x^{\prime}_{v},x^{\prime}_{c}=1$ and the hyperedge has a unit weight, i.e. $w_{e_{1}}=1$.
Recalling that $X=B^{*}X^{\prime}$, the feature vector $x_{1}$ of the hyperedge $e_{1}$ is then calculated as:

$$ $x_{1}=\vec{B}_{1u}^{*}\cdot x_{u}+\vec{B}_{1v}^{*}\cdot x_{v}+\vec{B}_{1c}^{*} \cdot x_{c}=2+i.$ $$

In the case where $\vec{H}=H$, i.e., when the hypergraph is undirected, we have $\vec{B}^{*}=B^{\top}$.
The feature vector $x_{1}$ of the hyperedge $e_{1}$ is then calculated as:

$$ $x_{1}=B_{1u}\cdot x_{u}+B_{1v}\cdot x_{v}+B_{1c}\cdot x_{c}=3.$ $$

As illustrated by this example , in the specific case of a directed line graph, the feature vector can feature both real and imaginary components, depending on the topology of the hypergraph encoded by $\vec{B}$.

## Appendix E Confusion Matrix

We report the confusion matrices of Dataset-1 in Figure 4 and Dataset-2 in Figure 5. We can extract some insights from these two matrices, in particular:

- •
Dataset-1. DLGNet achieves a maximum performance of 88% in classifying the Class 5 (Protections). However, its performance drops for Class 4 and Class 9 (Heterocycle formations and Functional group interconversions), where it correctly predicts only 44% and 41%, respectively.
- •
Dataset-2. DLGNet accurately classifies the sub-classes relative to the C–C bond formations (Reizman Suzuki Cross-Coupling and Imidazole-aryl coupling), as well as the Amide bond formations.
On the other hand, the remaining three N-arylation sub-classes are poorly discriminated.
This behavior can likely be attributed to the fact that the former are derived from different collections of Pd-catalyzed cross-coupling reactions, each exhibiting distinct features in terms of participant molecules (e.g. imidazole compounds). In contrast, all of the elements in the N-arylation classes share the same reaction mechanism (Buchwald-Hartwig amination); this poses a greater challenge, which results in decreased accuracy when predicting the correct class.

Figure: Figure 4: Dataset-1 confusion matrix.
Refer to caption: extracted/5913805/figures/USPTO_normalize_confusion_matrix.png

Figure: Figure 5: Dataset-2 confusion matrix.
Refer to caption: extracted/5913805/figures/6_classi.png

## Appendix F From a Directed Hypergraph to the Directed Line Graph Laplacian

Figure: Figure 6: An example illustrating the transformation of a hypergraph (left) into its corresponding directed line graph (right).
Refer to caption: extracted/5913805/figures/HG6.png

To illustrate the construction of the directed line graph and the associated Directed Line Graph Laplacian, consider a directed hypergraph $\vec{H}=(V,E)$ where the vertex set is $V=\{a,b,c,d,e\}$ and the hyperedge set is $E=\{e_{1},e_{2},e_{3}\}$. The incidence relationships are defined as follows:

- •
$H(e_{1})=\{b,c\}$, $T(e_{1})=\{a\}$,
- •
$H(e_{2})=\{a,b\}$, $T(e_{2})=\{d\}$,
- •
$H(e_{3})=\{e\}$, $T(e_{3})=\{d\}$.

Each hyperedge is assigned a unit weight (i.e., $W=I$). The cardinalities (densities) of the hyperedges are $\delta_{e_{1}}=3$, $\delta_{e_{2}}=2$, and $\delta_{e_{3}}=2$.

We construct $DLG(\vec{H})$ using the following matrices: the incidence matrix $\vec{B}$, its conjugate transpose $\vec{B}^{*}$, the vertex degree matrix $D_{v}$, and the hyperedge degree matrix $D_{e}$. The incidence matrix $\vec{B}$ and its conjugate transpose are:

$$ $\vec{B}=\begin{bmatrix}-i&1&0\\ 1&1&0\\ 1&0&0\\ 0&-i&-i\\ 0&0&1\end{bmatrix}\quad\vec{B}^{*}=\begin{bmatrix}i&1&1&0&0\\ 1&1&0&i&0\\ 0&0&0&i&1\end{bmatrix}.$ $$

The vertex degree matrix $D_{v}$ and the hyperedge degree matrix $D_{e}$ are given by:

$$ $D_{v}=\begin{bmatrix}2&0&0&0&0\\ 0&2&0&0&0\\ 0&0&1&0&0\\ 0&0&0&2&0\\ 0&0&0&0&1\\ \end{bmatrix}\quad D_{e}=\begin{bmatrix}3&0&0\\ 0&3&0\\ 0&0&2\end{bmatrix}.$ $$

Using these matrices, the adjacency matrix $A$ of the directed line graph $DLG(\vec{H})$ is:

$$ $A=\vec{B}^{*}\vec{B}-D_{e}=\begin{bmatrix}0&1+i&0\\ 1-i&0&1\\ 0&1&0\end{bmatrix}.$ (15) $$

By Definition 1, the directed line graph $DLG(\vec{H})$ has three vertices, corresponding to the hyperedges $e_{1}$, $e_{2}$, and $e_{3}$ of the original hypergraph $\vec{H}$. An edge exists between two vertices in $DLG(\vec{H})$ if and only if their corresponding hyperedges in $\vec{H}$ are incident.
In the specific example (illustrated in Figure 6), DLG$(\vec{H})$ contains two edges, whose direction and weight are determined by the adjacency matrix $A$ (in equation 15.
Without loss of generality, we consider the upper triangular part of $A$ to assign weights to the edges and define the directions: In the example considered, one edge will be directed and have a weight equal to $1+i$ (i.e. $e_{1}\overset{1+i}{\rightarrow}e_{2}$), the other edge will be undirected and have a weight equal to 1 ($e_{2}\;\overset{1}{\rule[2.15277pt]{8.5359pt}{0.5pt}}\;e_{3}$).

Using the equation 9. we can calculate the proposed Directed Line Graph Laplacian $\mathbb{\vec{L}}_{N}$ as follows:

$$ $\mathbb{\vec{L}}_{N}=I-\mathbb{\vec{Q}}_{N}:=\vec{D}_{e}^{-\frac{1}{2}}\vec{B} ^{*}\vec{D}_{v}^{-1}\vec{B}\vec{D}_{e}^{-\frac{1}{2}}=\begin{bmatrix}0.333&-0. 167-167i&0\\ -0.167+0.167i&0.5&-0.204\\ 0&-0.204&0.25\end{bmatrix}.$ $$

By inspecting $\mathbb{\vec{L}_{N}}$, one can observe that it encodes the elements of the hypergraph $\vec{H}$ in the following way:

- 1.
The real components of off-diagonal entries in $\mathbb{\vec{L}_{N}}$ encode the fact that, in the underlying hypergraph $\vec{H}$, the vertex belongs to the head set or tail set simultaneously in two different hyperedges. For example, $\mathbb{\vec{L}_{N}}(2,3)=-0.204$ indicates that $H(e_{2})\cap H(e_{3})\neq\emptyset$ or $T(e_{2})\cap T(e_{3})\neq\emptyset$. In this specific case, $T(e_{2})\cap T(e_{3})=\{d\}$. Similarly, $\Re(\mathbb{\vec{L}_{N}}(1,2))=-0.167$ arises from the fact that $e_{1}$ and $e_{2}$ share the vertex $b$ in their head sets.
- 2.
The imaginary component captures the hyperedge directionality based on the underlying hypergraph $\vec{H}$, where a node belongs to the head set of one hyperedge and the tail set of another. For example, $\Im(\mathbb{\vec{L}}_{N}(1,2))=-\Im(\mathbb{\vec{L}}_{N}(2,1))=-0.167$, indicating that $a\in T(e_{1})\cap H(e_{2})$.
- 3.
The absence of any relationships between hyperedges $e1$ and $e3$ is encoded by 0 0 in $DGL(\vec{H})$.
Specifically, $\mathbb{\vec{L}}_{N}(1,3)=\mathbb{\vec{L}}_{N}(3,1)=0$.
- 4.
The self-loop information (a measure of how strongly the feature of a vertex depends on its current value within the convolution operator) is encoded by the diagonal of $\mathbb{\vec{L}}_{N}$.

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 3
presentation: 2
questions: Refer to Weaknesses.
soundness: 2
strengths: 1) The picture of modeling chemical reactions using hypergraphs is interesting in GNNs for chemistry and biology. 

2)  Good performance compared to the "baseline".
summary: This paper investigates the problem of chemical reaction classification based on hypergraphs. Firstly, this paper introduces a formal definition of directed line graphs to transform directed hypergraphs, thereby converting edge-level tasks into node-level tasks. Building on this definition, DLGNet is proposed, which updates hyperedge features through local aggregation. Experimental results demonstrate the superior performance of the proposed DLGNet compared to the baseline chemical reaction classification.
weaknesses: 1) The novel of this paper is limited. On the one hand, the transformation of directed graphs to line graphs has been extensively studied, and the proposed DLG does not capture the unique characteristics that distinguish hypergraphs from ordinary graphs. Additionally, the use of complex numbers to represent directionality in directed graph neural networks (such as MagNet [1]) has already been explored. Thus, the contribution of this part appears to be incremental. On the other hand, it is unclear what the rationale for translating directed hypergraphs into directed line graphs for hyperedge classification is. 

2) The paper is poorly organized. Is the introduction of Datasets 1, 2, and 3 a contribution to this paper? Why devote so much space to this in the main text?

3) The discussion and comparison of related work are insufficient. In particular, all compared models are not specific to chemical reaction classification. 

[1] MagNet: A Neural Network for Directed Graphs. NeurIPS 2021

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 1
questions: see weakness
soundness: 3
strengths: - This paper proposed a new direct hypergraph neural network for chemical reaction prediction.  This application is interesting and the proposed method sounds technique.
summary: This paper addresses the chemical reaction classification problem by introducing the Directed Line Graph (DLG) associated with a given directed hypergraph. It also deduces a Directed Line Graph Network (DLGNet) which achieves impressive performance on the chemical reaction classification task.
weaknesses: - The paper says it only focuses on modeling reaction structures without considering any form of hypergraph learning methods. However, it is unclear whether some traditional methods have been proposed for this task. If there exists, it should be added to support the efficiency of your method. Further, the proposed method is obviously can be used for link prediction, can you explain why it cannot achieve good performance on the task?
- Lack of details of how to model the reaction structures to hypergraph edge prediction task. Is it the node of the hypergraph is the molecular? This problem definition should be clearly shown in the main paper. Further, why DLG design can specifically work for this reaction task? In our understanding, the specific application paper should consider some domain knowledge (such as chemical reaction prior information) to make the proposed approach convincing.
- The design of the $Bve=-i, if v\in T(e)$ is weird, what is the theoretical or intuitive motivation? What if we use $Bve=-1, if v\in T(e)$ or we still use the B as described in the typical method like [1].
- This paper lacks some necessary baselines and is without discussion with some related works. For example [1,2,3]. Besides, the Magnetic Laplacian also be used in [4].

minor: Some key matrices should describe their dimensions for ease of reading.

[1]Directed Hypergraph Representation Learning for Link Prediction, AISTATS 2024
[2] Hypergraph Convolutional Networks via Equivalency between Hypergraphs and Undirected Graphs, ICML workshop 2022
[3] Directed hypergraph neural network, 2020
[4] Unified Random Walk, Its Induced Laplacians and Spectral Convolutions for Deep Hypergraph Learning, 2022

---

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: 1.  Add a figure of the DLGNet model architecture in the main text.

2. Although the authors compared the model performance of DLGNet to other published graph neural networks. It would be beneficial to illustrate the differences between DLGNet and the other models to provide readers a clearer understanding.
soundness: 3
strengths: 1. The chemical reactions often involve interactions between multiple substances, rather than simple binary relationships (e.g., reactants-products). Using hypergraphs to represent and analyze chemical reactions can more naturally capture this multivariate relationship.

2. The mathematical framework is innovative and critical. The introduction of "Directed Line Graph Laplacian" is a key mathematical contribution. By constructing a Hermitian matrix, complex-values Laplacian, the authors enable the network to capture both the directionality and connectivity of hyperedges, a sophisticated approaches for chemical reaction classifications.

3. DLGNet has been conducted extensive experiments on three different and diverse real-world datasets. Also including a robust ablation study to demonstrate the importance of directionality in the model. These all show the benefits of the proposed methods.
summary: In the field of organic synthesis, accurately predicting reaction types can help chemists design and optimize synthetic routes. This article proposed DLGNet. This is a novel approach for classifying chemical reactions by leveraging a new spectral-based graph neural network for hypergraphs. DLGNet utilizes a directed line graph Laplacian operator Hermitian matrix to encode the directionality and connectivity between hyperedges. The Hermitian property and positive semidefiniteness of this matrix make it suitable for spectral convolution, which the DLGNet leverages to enhance classification performance.
weaknesses: 1. The use of Hermitian Laplacian matrix is mathematically convenient. However, using non-Hermitian matrix on the directed graph neural networks may sometimes provide more flexibility in encoding the directionality.

2. The model currently only relies on the molecular Morgan Fingerprints for the node features. However, consider more molecular features, such as electronic descriptors and three dimensional conformations, would provide the model a more comprehensive understanding of chemical reactions.

3. It would be beneficial to add a figure of the DLGNet model architecture in the main text. This would  help readers better understand the model.

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 3
questions: 1. High Level: 
   After converting the directed hypergraph to DLG, the relationship of vertices belongs to the same hyperedge are not reflected in DLG anymore and the representation of the original graph is not updated during learning.
   In Line 294: the feature matrix for the vertices of DLG is a simple aggregation of original feature matrix. 
   Will this exacerbate the learning ability? 

2. The Dataset description could be enriched:
	In Figure 1 Dataset-1 example, only 2 reactnats are involved and it seems only one hyperedge for reaction remains. Then the graph convolution layer becomes linear layer since no neighbors are included. 
	Could you provide the statistics of the reactions in the datasets (e.g. the average number of vertices and average node degree in DLG)?

3. Experiments:
   Line 408-409, with 5-fold cross-validation, why do we still need 50%/25%/25% splition for train/val/test? 

Typo: 
1. Line 308, the output shape should be m x 2c', instead of n x 2c'. 
2. Line 742, the * for first B(u,j) should be removed.
soundness: 3
strengths: 1. The study is comprehensive. Starting from the mathematical definition of the directed hypergraph, the laplacian is derivated and related properties are proved. Then the convolution operation is introduced and complexity is also analyzed. 

2. The paper includes many details including the public-available code, proofs of theorems, complexity analysis, dataset and model setting in the Appendix, which is very helpful to understand the paper. 

3. The importance of directionality are well assessed in ablation study, which supports the motivation of the proposed method.
summary: The paper introduced a novel method that convert the directed hypergraph into Directed Line Graph (DLG), where each hyperedge is transformed into a vertex in the DLG. The DLG Laplacian is proved to be positive semidefinite and spectral-based GNN is introduced for the DLG. This novel representation and associated GNN operation are applied for chemical reaction classification problem.
weaknesses: 1. The baseline performance for reaction classification is quetionable: 
   The F1 scores reported in Table 1 for baseline methods are all at random guess level (e.g. F1<0.1 for 10-class classification). However in other reaction classification datasets and baseline methods, the F1 could be larger than 0.8 even for 1000 classes. [1]
   Please verify the baseline metrics, and compare with the baseline methods which could get better prediction performance. 

2. The definition of node and hyperedge for chemical reaction is not clear:
   In Section 1 Line 72, author mentions tackle the reaction classification problem as hyperedge classification task. The Figire 1 also indicates each molecule is a node and each reaction is a hyperedge. 
   However in Figure 2 Dataset-1 and Dataset-2, the head and tail are for single molecule. In Section 2 Line 130, the head set and tail set are for hyperedge e, which means the hyperedge is a single molecule. 
   The author should make the definition consistent. 

3. Proofs could be more clear:
   In line 740 and 743, the second term is transformed from sum(i,j \in E) to sum(i,j \in E: i<=j) by mapping the lower triangle elements to upper triangles. However, the diagonal terms are introduced twice and should be subtracted from the new format. 
   In line 743 and line 745, how the first term was transformed should be further clarified. 

References:
[1] Li, Anchen, Elena Casiraghi, and Juho Rousu. "Chemical reaction enhanced graph learning for molecule representation." Bioinformatics 40.10 (2024): btae558.

Meta-review: This paper proposes a new GNN-based method DMLNet for chemical reaction classification, by transforming a directed hypergraph into the corresponding directed line graph. A spectral-based GNN is developed that uses a Hermitian Laplacian matrix to encode the directionality and connectivity between hyperedges, which is suitable for spectral convolution, and thus enhances classification performance. Currently, the paper receives a mix of opinions from reviewers. The main concern lies in several aspects, including poor presentation, limited novelty, the inputs being just molecular Morgan fingerprints without even atom type or other information, etc. Considering these, I suggest the authors significantly improve the presentation of the paper, clearly state the difference with existing works like MagNet, and consider necessary molecular information in problem formulation and experiments (at least atom types).

Decision: Reject