\clearpage
\section{Theoretical Details}
We detail the theoretical guarantees of GES and XGES. We first recall the problem only
in terms of MECs and not CPDAGs. We review the theoretical guarantees of GES and prove
those of XGES. We then show how the MEC formulation can be translated into a CPDAG
formulation for Deletes and Reversals.

\parhead{Notations and Vocabulary.}
\begin{itemize}[noitemsep]
    \item $d$: number of variables.
    \item $G$: a DAG over $d$ variables.
    \item $P$: a PDAG over $d$ variables.
    \item $M$: a MEC over $d$ variables.
    \item $\mathcal{M}$: space of all MEC over $d$ variables.
    \item $S$: a locally consistent score that is score equivalent. 
    \item $S(G)$ or $S(M)$ or $S(P)$: the score of a DAG $G$, a MEC $M$, or a CPDAG $P$.
    We hide the dependence in $\data$ for simplicity.\looseness=-1
    \item $G + (x \rightarrow y)$: the DAG obtained by adding the edge $x \rightarrow y$ 
    to $G$. It is undefined if $x \rightarrow y$ is already in $G$ or if the resulting
    graph is not a DAG.
    \item $G - (x \rightarrow y)$: the DAG obtained by removing the edge $x \rightarrow
    y$. It is undefined if $x \rightarrow y$ is not in $G$.
    % use the counter-clockwise arrow for reversals
    \item  $G \circlearrowleft (x \rightarrow y)$: the DAG obtained by reversing the
    edge $x \rightarrow y$. It is undefined if $x \rightarrow y$ is not in $G$ or if the
    resulting graph is not a DAG.
    \item An edge is \textit{compelled} in a MEC $M$ if it is always directed in the
    same direction in all DAGs in $M$. By definition, the compelled edges of $M$ are
    exactly the directed edges of $M$'s canonical PDAG. 
    \item An edge is \textit{reversible} in a MEC $M$ if it is directed in one direction
    in some DAGs in $M$ and the other direction in other DAGs in $M$. By definition, the
    reversible edges of $M$ are exactly the undirected edges of $M$'s canonical PDAG.
\end{itemize}


\subsection{Navigating the Space of MECs}
GES explores the space of MECs by iteratively going from one MEC to the other, each time
selecting one with a higher score. GES defines a set of possible candidates that can be
reached from a given MEC. This defines the search space of GES
\citep{chickering2002optimal}.


For a MEC $M$, define:
\begin{itemize}
    \item Insertions: $\mathcal{I}(M) = \{ M' \in \mathcal{M} \mid \exists G \in M, \exists
    (x,y) \in [d]^2, G + (x \rightarrow y) \in M'\}$.
    \item Deletions: $\mathcal{D}(M) = \{M' \in \mathcal{M} \mid \exists G \in M, \exists (x,y)
    \in [d]^2, G - (x \rightarrow y) \in M'\}$.
    \item Reversals : $\mathcal{R}_c(M) = \{ M' \in \mathcal{M} \mid \exists G \in M, \exists (x,y)
    \in [d]^2, (x,y) \text{ is compelled in }P, G \circlearrowleft (x \rightarrow y) \in M'\}$.
    \item Reversals: $\mathcal{R}_r(M) = \{ M' \in \mathcal{M} \mid \exists G \in M, \exists (x,y)
    \in [d]^2, (x,y) \text{ is reversible in }P, G \circlearrowleft (x \rightarrow y) \in M'\}$.
\end{itemize}

The original GES algorithm first navigates through MECs only using $\mathcal{I}$, and
then only using $\mathcal{D}$. GIES proposes to add a last step and navigate through MECs using only
$\mathcal{R}_c \cup \mathcal{R}_r$ (after $\mathcal{I}$ and $\mathcal{D}$)
\citep{hauser2012characterization}.

In contrast, XGES navigates through MECs using simultaneously $\mathcal{I}$,
$\mathcal{D}$ and $\mathcal{R}_c$. The XGES heuristics favor using $\mathcal{D}$, then
$\mathcal{R}_c$, and finally $\mathcal{I}$ (see \Cref{alg:xges-0}).

\begin{remark}
    XGES could also use $\mathcal{R}_r$, we leave this for future work.
\end{remark}

\subsection{Theoretical Guarantees of GES}
\label{appendix:sec:theoretical_guarantees_ges}

We reformulate the results in \citep{chickering2002optimal}. Given a distribution $p^*$
faithful to a graph $G^*$ with MEC $M^*$. GES is \textit{correct} if it returns $M^*$,
the MEC of $G^*$. It is the MEC formed by all the DAGs faithful to $p^*$. 

\begin{theorem}[\protect{\citep[Lemma 9]{chickering2002optimal}}] \label{thm:chickering9}
    If no candidate MECs
    in $\mathcal{I}(M)$ can increase the score $S$, then $M$ has a special structure:
    all the independencies in $M$ are also independencies in $p^*$. We write it:
    $$\max_{M' \in \mathcal{I}(M)} S(M') \leq S(M) \Rightarrow \texttt{P1}(M; p^*),$$ where
    $\texttt{P1}(M; p^*)$ is the proposition that all the independencies in $M$ are also
    independencies in $p^*$.
\end{theorem}
Note that $p^*$ might have more independencies than $M$, i.e. $p^*$ is not necessarily
faithful to $M$. This is because $M$ might have superfluous edges. For example, the MEC
of the complete DAGs satisfies $\texttt{P1}(M; p^*)$. 


\begin{theorem}[\protect{\citep[Lemma 10]{chickering2002optimal}}]
    \label{thm:chickering10a} If all the independencies in $M$ are also independencies
    in $p^*$, then the same is true for all the MECs in $\mathcal{D}(M)$ that have a
    higher score than $M$. We write it:
    $$\texttt{P1}(M; p^*) \Rightarrow (\forall M' \in \mathcal{D}(M), S(M') \geq S(M)
    \Rightarrow \texttt{P1}(M'; p^*)).$$
\end{theorem}


\begin{theorem}[\protect{\citep[Lemma 10]{chickering2002optimal}}] \label{thm:chickering10b}
    If all the
    independencies in $M$ are also independencies in $p^*$, and if no candidate MECs in
    $\mathcal{D}(M)$ can increase the score $S$, then $M = M^*$. We write
    it:
    $$\texttt{P1}(M; p^*) \wedge \left[\left(\max_{M' \in \mathcal{D}(M)} S(M')\right) \leq S(M)\right]
    \Rightarrow \texttt{P2}(M; p^*),$$ where $\texttt{P2}(M; p^*)$ is the proposition
    that $M = M^*$ or equivalently that $p^*$ is faithful to all the DAGs in $M$
\end{theorem}

With \Cref{thm:chickering9,thm:chickering10a,thm:chickering10b}, it follows that GES is
correct: it will reach a MEC $M$ at the end of phase 1 such that $\mathtt{P1}(M; p^*)$
is true. From there, all MECs visited in phase 2 will also have $\mathtt{P1}(M; p^*)$
true, and GES will stop on a MEC $M$ such that $\mathtt{P2}(M; p^*)$ is true, i.e. $M =
M^*$.


\subsection{Theoretical Guarantees of XGES-0 and XGES}
\subsubsection{Theoretical Guarantees of XGES-0}
\label{appendix:sec:theoretical_guarantees_xges0}
We now prove that XGES-0 is correct. 

\thXgesZero*
\begin{proof}We prove that XGES-0 terminates and is correct.
    \begin{itemize}
        \item \textbf{Termination.} The algorithm terminates because the search space is finite
        and the score is non-decreasing at each step.
        \item \textbf{Correctness.} Let $\hat M$ be the MEC returned by XGES-0. Since XGES-0
        terminated, it means that no candidate MECs in $\mathcal{I}(\hat M)$ can increase the
        score $S$. By \Cref{thm:chickering9}, $\texttt{P1}(\hat M; p^*)$ is true. It also
        means that no candidate MECs in $\mathcal{D}(\hat M)$ can increase the score $S$. By
        \Cref{thm:chickering10b}, $\texttt{P2}(\hat M; p^*)$ is true. Hence, XGES-0 is
        correct.
    \end{itemize}
\end{proof}

\clearpage
\subsubsection{Theoretical Guarantees of XGES}
\label{appendix:sec:theoretical_guarantees_xges}
We provide the pseudocode of XGES in \Cref{alg:xges}.

\begin{algorithm}[h]
    \LinesNumbered
    \DontPrintSemicolon
    \KwData{Data $\data \in \mathbb{R}^{n\times d}$, score function $S$}
    \KwDefine{$\delta_{\data,M}(O) = S(\text{Apply}(O,M) ; \data) - S(M; \data)$}  
    \KwResult{MEC of $G^*$}
    $M \leftarrow $ XGES-0$(X, S)$\;
    $\mathcal{D} \leftarrow$ all deletes valid for $M$\;
    \While{$|\mathcal{D}| > 0$}{
        $D^* \leftarrow \argmax_{D \in \mathcal{D}} \{\delta_{\data,M}(D)\}$\;
        % $\delta = s_{X,M}(D^*)$\;
        $M' \leftarrow$ Apply($D^*, M$)\;  
        $\widetilde{\mathcal{I}} \leftarrow$ all insertions, from any MEC to any MEC, that reinsert the edge deleted by
        $D^*$ \;
        
        $M' \leftarrow$ XGES-0\textsuperscript{*}$(X, S, M', \widetilde{\mathcal{I}})$\;  
        
        \tcc{XGES-0\textsuperscript{*} is a modified version of XGES from
        \Cref{alg:xges-0} that accepts an initial graph $M'$, and a set of forbidden
        insertions $\widetilde{\mathcal{I}}$}  
        \uIf{$S(M'; \data) > S(M; \data)$}{ $M \leftarrow M'$\; $\mathcal{D} \leftarrow$ all
        deletes valid for $M$\; }  
        \Else{ $\mathcal{D} \leftarrow \mathcal{D} \backslash \{D^*\}$\; } }  
        \Return $M$\;
    \caption{XGES}
    \label{alg:xges}
\end{algorithm}

\thXges*

\begin{proof}

    With a locally consistent score, XGES-0 is correct, so $M$ in line 1 is already the 
    MEC $M^*$ of $G^*$. Such a $M^*$ has the maximum score, so lines 9 and 10 are never
    executed. Hence, XGES is correct.

    For completeness, we provide proof of XGES's termination even when the score is not
    locally consistent. 

    \textbf{Termination in practice.} Every time XGES replaces $M$ by $M'$, the score of
        $M$ strictly increases. Since the search space is finite, XGES cannot infinitely
        replace $M$ by $M'$. But then, the other possibility is to remove $D^*$ from
        $\mathcal{D}$, which is a finite set. Hence, XGES terminates.

\end{proof}





\clearpage
\subsection{Navigating the Space of MECs with CPDAGs}
\label{appendix:sec:navigating_space_cpags}
We review how to translate the MEC formulation into a CPDAG formulation for the
practical implementations of GES and XGES. We recall that each MEC $M$ can be uniquely
represented by a CPDAG $P$.

\subsubsection{Original Parametrization}
\label{appendix:sec:ges_parametrization}
In \Cref{sec:manipulating_mecs} we reviewed that given a MEC $M$ represented by the CPDAG $P$,
each $M' \in \mathcal{I}(M)$ can be uniquely associated to an operator Insert$(x,y,T)$,
where $T$ is a set of nodes, such that applying Insert$(x,y,T)$ to $P$ yields a PDAG
$P'$ that represents $M'$ (up to completing it into a CPDAG). The operator
Insert$(x,y,T)$ modifies $P$ by adding the edge $x \rightarrow y$ and orienting all
edges $t - y$ as $t \rightarrow y$ for all $t \in T$. Not all Insert$(x,y,T)$ operators
can be applied to $P$ and yield a PDAG $P'$ that represents a MEC $M' \in
\mathcal{I}(M)$. All the Insert$(x,y,T)$ operators that correspond to a MEC $M' \in
\mathcal{I}(M)$ are called valid operators. There is a bijection between
$\mathcal{I}(M)$ and the set of valid Insert$(x,y,T)$, and there exist conditions that
can be checked on $P$ to determine whether Insert$(x,y,T)$ is valid or not. 

The same holds for $\mathcal{D}(M)$, $\mathcal{R}_c(M)$ and $\mathcal{R}_r(M)$. We
summarize the operators, their validity conditions, their score and their actions on a CPDAG in \Cref{tab:ges_operators_original},
adapted from \citet{chickering2002optimal} for insertion and deletion, and from
\citet{hauser2012characterization} for reversals.

\begin{table}[h!]
    \resizebox{\linewidth}{!}{
    \begin{tabular}{ C{1.3cm}C{5.5cm}C{5.8cm}C{5.5cm} }
        \toprule
        Operator & Insert$(x,y,T)$ & Delete$(x,y, H)$ & Reversal$(x,y,T)$ \\
        \midrule
        Conditions & 
        \begin{itemize}
            \item $x \not\in \Ad(y)$
            \item $T \subset \Ne(y) \backslash \Ad(x)$
            \item $[\Ne(y) \cap \Ad(x)] \cup T$ is a clique
            \item All semi-directed paths from $y$ to $x$ are blocked by $[\Ne(y) \cap
            \Ad(x)] \cup T$  
        \end{itemize} &
        \begin{itemize}
            \item $x \in \Ch(x) \cup \Ne(x)$
            \item $H \subset \Ne(y) \cap \Ad(x)$
            \item $[\Ne(y) \cap \Ad(x)] \backslash H$ is a clique
        \end{itemize} &
        \begin{itemize}
            \item $y \in \Pa(x)$
            \item $T \subset \Ne(y) \backslash \Ad(x)$
            \item $[\Ne(y) \cap \Ad(x)] \cup T$ is a clique
            \item All semi-directed paths from $y$ to $x$ other than ($y,x$) are blocked
            by $[\Ne(y) \cap \Ad(x)] \cup T\cup\Ne(x)$  
        \end{itemize}\\
        
        Score Increase &  
        $\squeezespaces{0}s(y, [\Ne(y) \cap \Ad(x)] \cup T \cup \Pa(y) \cup \{x\})$ $ -
        s(y, [\Ne(y) \cap \Ad(x)] \cup T \cup \Pa(y))$  
        & $s(y, [\Ne(y) \cap \Ad(x)] \backslash H \cup \Pa(y) \backslash \{x\}) - s(y,
        [\Ne(y) \cap \Ad(x)] \backslash H\cup \Pa(y)\cup\{x\})$  
        & $\squeezespaces{0}s(y, [\Ne(y) \cap \Ad(x)] \cup T \cup \Pa(y) \cup \{x\})$ $ -
        s(y, [\Ne(y) \cap \Ad(x)] \cup T \cup \Pa(y))$ 
        $+s(x, \Pa(x) \backslash \{y\}) - s(x, \Pa(x))$\\
        \\
        Actions & \begin{itemize}
            \item Add $x \rightarrow y$ to $P$.
            \item For all $t \in T$, orient $t - y$ as $t \rightarrow y$.
        \end{itemize} & \begin{itemize}
            \item Remove $x \rightarrow y$ (or $x - y$) from $P$.
            \item Orient all edges $y - h$ as $h \rightarrow y$ for $h \in H$.
            \item Orient all edges $x - h$ as $h \rightarrow x$ for $h \in H$.
        \end{itemize} & \begin{itemize}
            \item Reverse $x \rightarrow y$ into $x \leftarrow y$.
            \item For all $t \in T$, orient $t - y$ as $t \rightarrow y$.
        \end{itemize} 
        \\
        \bottomrule
    \end{tabular}
    } \caption{Summary of the operators and their conditions as described in
    \citep{chickering2002optimal}. The conditions for Insert and Delete are described in
    \citet[Definition 12, Definition 13, Theorem 15, Theorem 17, Table
    1]{chickering2002optimal}, and the score increase in \citet[Corollary 16, Corollary
    18]{chickering2002optimal}. The conditions for Reversal are described in
    \citet[Proposition 34]{hauser2012characterization}, and the score increase in
    \citet[Corollary 36]{hauser2012characterization}.}
    \label{tab:ges_operators_original}
\end{table}

\clearpage
\subsubsection{XGES Parametrization}
\label{appendix:sec:xges_parametrization}
We proposed a slightly different parametrization of the operators with adapted
conditions. We recall from \Cref{sec:updating_score} that with the original
parametrization, the scores of the operators depend on which PDAG they are applied
to. With the goal of an efficient implementation that caches the score of valid
operators to avoid recomputation, it is important and convenient for each operator to
have a unique score, agnostic of the PDAG it is applied to.

% To achieve this, we changed the parametrization of the operators to include the set of
% nodes used in the score computation as part of the operator, and add a validity
% condition about this set. 

We described the new parametrization for the Insert operator in \Cref{sec:updating_score}.
We describe the Delete and Reverse operator in \Cref{tab:ges_operators} hereafter.
For the Delete operator, we also replace the set $H$ by the set $C$, its complement in
$\Ne(y) \cap \Ad(x)$. 


\begin{table*}[h!]
    \centering
    \resizebox{0.95\linewidth}{!}{
\begin{tabular}{ C{0.33\linewidth} C{0.32\linewidth} C{0.33\linewidth} }
\toprule
Insert($x, y, T$; $E$) & Delete($x, y, C; E$) &  Reverse($x, y, T, E, F$)\\
\midrule
\vspace{-0.4cm}
   \begin{itemize}
       \item[\textbf{I1}:] $y \not\in \Ad(x)$
       \item[\textbf{I2}:] $T \subset \Ne(y) \backslash \Ad(x)$
       \item[\textbf{I3}:] $(\Ne(y) \cap \Ad(x)) \cup T$ is a clique
       \item[\textbf{I4}:] All semi-directed paths from $y$ to $x$ have a node in $(\Ne(y) \cap
       \Ad(x)) \cup T$
       \item[\textbf{I5}:] $E = (\Ne(y) \cap \Ad(x)) \cup T \cup \Pa(y)$ 
   \end{itemize}
   & 
\vspace{-0.4cm}
   \begin{itemize}
       \item[\textbf{D1}:] $y \in \Ch(x) \cup \Ne(x)$
       \item[\textbf{D2}:] $C \subset \Ne(y) \cap \Ad(x)$
       \item[\textbf{D3}:] $C$ is a clique
       \item[\textbf{D4}:] $E = C \cup \Pa(y)$
   \end{itemize}
   & \vspace{-0.4cm}\begin{itemize}
        \item[\textbf{R1}:] $y \in \Pa(x)$ 
        \item[\textbf{R2}:] $T \subset \Ne(y) \backslash \Ad(x)$ 
        \item[\textbf{R3}:] $(\Ne(y) \cap \Ad(x)) \cup T$ is a clique 
        \item[\textbf{R4}:] All semi-directed paths from $y$ to $x$ not using edge $y \rightarrow x$
       have a node in $(\Ne(y) \cap \Ad(x)) \cup T \cup\Ne(x)$ 
       \item[\textbf{R5}:] $E = (\Ne(y) \cap \Ad(x)) \cup T \cup \Pa(y)$ 
       \item[\textbf{R6}:] $F = \Pa(x)$
    \end{itemize} \\%[-0.3cm]
    % \midrule
      $\delta = s(y, E \cup \{x\}) - s(y, E )$
    & $\delta=s(y, E \cup \{x\}) - s(y, E \backslash \{x\})$
    & $\delta= s(y, E \cup \{x\}) - s(y, E ) + s(x, F \backslash \{y\}) - s(x, F)$\\
\bottomrule
\end{tabular}}  
\caption{Parametrization of operators by XGES with their validity conditions and score. 
This parametrization renders the score of each operator invariant to the CPDAG it is 
applied to.}
\label{tab:ges_operators}
\end{table*}

\clearpage

\subsection{Efficient Algorithmic Formulation}
\label{appendix:sec:efficient_algorithmic_formulation}

We study how each validity condition described in \Cref{tab:ges_operators} can become 
true after each type of edge update in a PDAG. We only need to consider single-edge updates because 
of \Cref{thm:update_validity}.

\parhead{Edge Updates} There are seven types of edge updates: one of $a\quad b$, $a -
b$, or $a \rightarrow b$ becomes another one (6 = 3*2); and the reversal $a \rightarrow
b$ into $a \leftarrow b$ (which happens only after applying a reversal operator).

For each of these edge updates, we study how they affect the validity conditions of each operator. We 
summarize the results in \Cref{tab:operator_updates} and provide the detailed proofs in the following sections.
We further aggregate the results from \Cref{tab:operator_updates} into \Cref{tab:operator_updates2}.



\begin{table*}[h]
    \centering
    % resize box
    \resizebox{\textwidth}{!}{
    \begin{tabular}{ C{1cm}C{2.5cm}C{2.5cm}C{2.5cm}C{2.5cm}C{2.5cm}C{2.5cm}C{2.5cm} }
    \toprule
     & $a \quad b$ & $a \quad b$ & $a - b$ & $a - b$ & $a \rightarrow b$ & $a
     \rightarrow b$ & $a \rightarrow b$ \\
     & $a - b$ & $a \rightarrow b$ & $a \quad b$ & $a \rightarrow b$ & $a \quad b$ & $a
    - b$ & $a \leftarrow b$ \\
    \midrule
    \textbf{I1} & $\varnothing$ & $\varnothing$ & $\{a, b \} = \{x,y\}$  & $\varnothing$
    & $\{a, b \} = \{x,y\} $ & $\varnothing$ & $\varnothing$ \\[4mm]
    \textbf{I2} & $\curlystack{\bar{a} = y \\ \bar{b} \not\in \Ad(x)}$ & $\varnothing$ &
     $\curlystack{\bar{a}=x \\ \bar{b} \in \Ne(y)} $ & $\varnothing$ &
     $\curlystack{\bar{a}=x \\ \bar{b} \in \Ne(y)} $ & $\curlystack{\bar{a} = y \\
     \bar{b} \not\in \Ad(x)}$  & $\varnothing$\\[4mm]
    \textbf{I3}\textsuperscript{I2} & $\{a, b\} \subset \Ne(y)$ & $\{a, b\} \subset \Ne(y)$ &
    $\curlystack{\bar{a} = y \\ \bar{b} \in \Ad(x)}$ or $\curlystack{\bar{a} = x \\
    \bar{b} \in \Ne(y)}$ & $\curlystack{\bar{a} = y \\ \bar{b} \in \Ad(x) }$ &
    $\curlystack{\bar{a} = x \\ \bar{b} \in \Ne(y) }$ & $\varnothing$ &
    $\varnothing$\\[4mm]
    \textbf{I4} & $\curlystack{\bar{a} = y \\ \bar{b} \in \Ad(x)}$ or
    $\curlystack{\bar{a} = x \\ \bar{b} \in \Ne(y)}$ & $\curlystack{\bar{a} = x \\
    \bar{b} \in \Ne(y)}$ & \texttt{SD}($x,y; \bar{a},\bar{b}$) & \texttt{SD}($x,y; b,a$)
    & \texttt{SD}($x,y; a,b$) & $\curlystack{\bar{a} = y \\ \bar{b} \in \Ad(x)}$ &
    \texttt{SD}($x,y; a,b$) \\[4mm]
    \textbf{I5} & $\curlystack{\bar{a} = y \\ \bar{b} \in \Ad(x)}$ or
    $\curlystack{\bar{a} = x \\ \bar{b} \in \Ne(y)}$ & $b = y$ or $\curlystack{\bar{a} =
    x \\ \bar{b} \in \Ne(y)}$ & $\curlystack{\bar{a} = y \\ \bar{b} \in \Ad(x)}$ or
    $\curlystack{\bar{a} = x \\ \bar{b} \in \Ne(y)}$ & $b = y$ or $\curlystack{\bar{a} =
    y \\ \bar{b} \in \Ad(x)}$ & $b = y$ or $\curlystack{\bar{a} = x \\ \bar{b} \in
    \Ne(y)}$ & $b = y$ or $\curlystack{\bar{a} = y \\ \bar{b} \in \Ad(x)}$ & $\bar{a}=y$
    \\
    \midrule
    \textbf{D1} & $\{a, b \} = \{x,y\} $ & $(a,b) = (x,y)$ & $\varnothing$ &
    $\varnothing$ & $\varnothing$ & $(a,b) = (y,x)$ & $(a,b) = (y,x)$\\
    \textbf{D2} & $\curlystack{\bar{a}=y \\ \bar{b} \in \Ad(x)}$ or
    $\curlystack{\bar{a}=x \\ \bar{b} \in \Ne(y)}$ & $\curlystack{\bar{a}=x \\ \bar{b}
    \in \Ne(y)}$ & $\varnothing$ & $\varnothing$ & $\varnothing$ &
    $\curlystack{\bar{a}=y \\ \bar{b} \in \Ad(x)}$ & $\varnothing$\\
    \textbf{D3}\textsuperscript{D2} & $\{a,b\} \subset \Ne^u(y) \cap \Ad^u(x)$ & $\{a,b\} \subset \Ne^u(y)
    \cap \Ad^u(x)$ & $\varnothing$ & $\varnothing$ & $\varnothing$ & $\varnothing$ &
    $\varnothing$\\
    \textbf{D4} & $\varnothing$ & $b=y$ & $\varnothing$ & $b=y$ & $b=y$ & $b=y$ &
    $\bar{a} = y$\\
    \midrule
    \textbf{R1} & $\varnothing$ & $(a,b) = (y,x)$ & $\varnothing$ & $(a,b) = (y,x) $ &
    $\varnothing$ & $\varnothing$ & $(a,b) = (x,y)$\\
    \textbf{R2} & See \textbf{I2} & See \textbf{I2} & See \textbf{I2} & See \textbf{I2} &
    See \textbf{I2} & See \textbf{I2} & See \textbf{I2}\\
    \textbf{R3}\textsuperscript{R2} & See \textbf{I3} & See \textbf{I3} & See \textbf{I3} &
    See \textbf{I3} & See \textbf{I3} & See \textbf{I3} & See \textbf{I3}\\
    \textbf{R4} & See \textbf{I4} or $\bar{a}=x$ & See \textbf{I4} & See \textbf{I4} 
    & See \textbf{I4} & See \textbf{I4} & See \textbf{I4} or $x=\bar{a}$ & See \textbf{I4} \\
    \textbf{R5} & See \textbf{I5} & See \textbf{I5} & See \textbf{I5} & See \textbf{I5}
    & See \textbf{I5} & See \textbf{I5} & See \textbf{I5} \\
    \textbf{R6} & $\varnothing$ & $b=x$ & $\varnothing$ & $b=x$ & $b=x$ & $b=x$ &
    $\bar{a} = x$\\
    \bottomrule
    \end{tabular}
    } \caption{For each type of edge update involving an edge $(a,b)$, we list necessary
    conditions for each validity conditions of operators Insert$(x,y,T,E)$,
    Delete$(x,y,C,E)$, and Reverse$(x,y,T,E,F)$ to become valid. The notation 
    Condition($\bar a, \bar b$) is a shorthand for $\text{Condition}(a,b) \vee \text{Condition}(b,a)$.    
    The notation \texttt{SD}($x,y; a,b$) is a shorthand for the necessary condition:
    $(a,b)$, in that order, is on a semi-directed path from $y$ to $x$. All operators
    $\Pa, \Ne, \Ad$ and \texttt{SD}($x,y; a,b$) are computed with respect to the PDAG
    before the edge update. All operators $\Pa^u, \Ne^u, \Ad^u$ are computed with
    respect to the PDAG after the edge update.}
    \label{tab:operator_updates}
\end{table*}




\Cref{tab:operator_updates2} rewrites \Cref{tab:operator_updates} with the statements to
be conditions centered around $x$ and $y$, and aggregate all the necessary conditions
together. Whenever a single edge $(a,b)$ is updated, only the Insert operators satisfying
the condition \textbf{I}-any can become valid and need to be checked. The same holds for
Delete with \textbf{D}-any, and Reverse with \textbf{R}-any.
\begin{table*}[h!]
    \centering
    % resize box
    \resizebox{\textwidth}{!}{
    \begin{tabular}{ cC{4.2cm}C{3.5cm}C{4.2cm}C{2.2cm}C{2.5cm}C{2.4cm}C{2.2cm} }
    \toprule
     & $a \quad b$ & $a \quad b$ & $a - b$ & $a - b$ & $a \rightarrow b$ & $a
     \rightarrow b$ & $a \rightarrow b$ \\
     & $a - b$ & $a \rightarrow b$ & $a \quad b$ & $a \rightarrow b$ & $a \quad b$ & $a
    - b$ & $a \leftarrow b$ \\
    \midrule
    \textbf{I1} & $\varnothing$ & $\varnothing$ & $\{x,y\} = \{a, b \}$  & $\varnothing$
    & $\{x,y\} = \{a, b \} $ & $\varnothing$ & $\varnothing$ \\[2mm]
    \textbf{I2} & $y = \bar{a}$ & $\varnothing$ & $\curlystack{x= \bar{a} \\ y \in
     \Ne(\bar{b})} $ & $\varnothing$ & $\curlystack{x= \bar{a} \\ y \in \Ne(\bar{b})} $
     & $y = \bar{a}$  & $\varnothing$\\[5mm]
     \textbf{I3}\textsuperscript{I2} & $y \in \Ne(a)\cap \Ne(b)$ & $y \in \Ne(a)\cap \Ne(b)$ &
     $\curlystack{y = \bar{a} \\ x \in \Ad(\bar{b})}$ or $\curlystack{x = \bar{a} \\ y
     \in \Ne(\bar{b})}$ & $\curlystack{y = \bar{a} \\ x \in \Ad(\bar{b}) }$ &
     $\curlystack{x = \bar{a} \\ y \in \Ne(\bar{b}) }$ & $\varnothing$ &
     $\varnothing$\\[2mm]
    \textbf{I4} & $\curlystack{y = \bar{a} \\ x \in \Ad(\bar{b})}$ or $\curlystack{x =
    \bar{a} \\ y \in \Ad(\bar{b})}$ & $\curlystack{x = \bar{a} \\
    y \in \Ne(\bar{b})}$ & \texttt{SD}($x,y; \bar{a},\bar{b}$) & \texttt{SD}($x,y; b,a$)
    & \texttt{SD}($x,y; a,b$) & $\curlystack{y = \bar{a} \\ x \in \Ad(\bar{b})}$ &
    \texttt{SD}($x,y; a,b$) \\[5mm]
    \textbf{I5} & $\curlystack{y = \bar{a} \\ x \in \Ad(\bar{b})}$ or $\curlystack{x =
    \bar{a} \\ y \in \Ne(\bar{b})}$ & $y = b$ or $\curlystack{x = \bar{a} \\ y \in
    \Ne(\bar{b})}$ & $\curlystack{y = \bar{a} \\ x \in \Ad(\bar{b})}$ or $\curlystack{x
    = \bar{a} \\ y \in \Ne(\bar{b})}$ & $y = b$ or $\curlystack{y = \bar{a} \\ x \in
    \Ad(\bar{b})}$ & $y = b$ or $\curlystack{x = \bar{a} \\ y \in \Ne(\bar{b})}$ & $y =
    b$ or $\curlystack{y = \bar{a} \\ x \in \Ad(\bar{b})}$ & $y=\bar{a}$ \\
    \midrule
    \textbf{I}-any & 
    \begin{itemize}[leftmargin=*]
        \item $y \in \{a,b\}$ 
        \item $y \in \Ne(a)\cap \Ne(b)$
        \item $x = a$ and $y \in \Ne(b)$
        \item $x = b$ and $y \in \Ne(a)$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y = b$
        \item $y \in \Ne(a)\cap \Ne(b)$
        \item $x = a$ and $y \in \Ne(b)$
        \item $x = b$ and $y \in \Ne(a)$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $x = a$ and $y \in \Ne(b) \cup \{b\}$
        \item $x = b$ and $y \in \Ne(a) \cup \{a\}$
        \item $y = a$ and $x \in \Ad(b)$
        \item $y = b$ and $x \in \Ad(a)$
        \item \texttt{SD}($x,y; a,b$)
        \item \texttt{SD}($x,y; b,a$)
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y = a$ and $x \in \Ad(b)$
        \item $y = b$
        \item \texttt{SD}($x,y; b,a$)
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y=b$
        \item $x = a$ and $y \in \Ne(b) \cup \{b\}$
        \item $x = b$ and $y \in \Ne(a) \cup \{a\}$
        \item \texttt{SD}($x,y; a,b$)
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y \in \{a,b\}$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y \in \{a,b\}$
        \item \texttt{SD}($x,y; a,b$)
    \end{itemize}
    \\
    \midrule
    \textbf{D1} & $\{x,y\} = \{a, b \} $ & $(x,y) = (a,b)$ & $\varnothing$ &
    $\varnothing$ & $\varnothing$ & $(x,y) = (b,a )$ & $(x,y) = (b,a)$\\
    \textbf{D2} & $\curlystack{y = \bar{a} \\ x \in \Ad(\bar{b})}$ or
    $\curlystack{x = \bar{a} \\ y \in \Ne(\bar{b})}$ & $\curlystack{x = \bar{a} \\ 
    y \in \Ne(\bar{b})}$ & $\varnothing$ & $\varnothing$ & $\varnothing$ &
    $\curlystack{y = \bar{a} \\ x \in \Ad(\bar{b})}$ & $\varnothing$\\
    \textbf{D3}\textsuperscript{D2} & $\curlystack{x \in \Ad^u(a) \cap \Ad^u(b) \\ y
        \in \Ne^u(a) \cap \Ne^u(b)}$ & $\curlystack{ x \in \Ad^u(a) \cap \Ad^u(b) \\ y
        \in \Ne^u(a) \cap \Ne^u(b)}$ & $\varnothing$ & $\varnothing$ & $\varnothing$ &
        $\varnothing$ & $\varnothing$\\
    \textbf{D4} & $\varnothing$ & $y=b$ & $\varnothing$ & $y=b$ & $y=b$ & $y=b$ &
    $y\in\{a,b\}$\\
    \midrule
    \textbf{D}-any &
    \begin{itemize}[leftmargin=*]
        % \item $y = a$ and $x \in \Ad(b)$
        % \item $y = b$ and $x \in \Ad(a)$
        % \item $x = a$ and $y \in \Ne(b) \cup \{b\}$
        % \item $x = b$ and $y \in \Ne(a) \cup \{a\}$
        \item $y \in \{a,b\}$
        \item $x \in \{a,b\}$
        \item $x \in \Ad(a) \cap \Ad(b)$ and $y \in \Ne(a) \cap \Ne(b)$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        % \item $x = a$ and $y \in \Ne(b)$
        % \item $x = b$ and $y \in \Ne(a)$
        \item $y = b$
        \item $x \in \{a,b\}$
        \item $x \in \Ad(a) \cap \Ad(b)$ and $y \in \Ne(a) \cap \Ne(b)$
    \end{itemize}
    & $\varnothing$
    & \begin{itemize}[leftmargin=*]
        \item $y = b$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y = b$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y \in \{a, b\}$ % and $x \in \Ad(b) \cup \{b\}$
        % \item $y = b$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y \in \{a,b\}$
    \end{itemize}\\
    \midrule
    \textbf{R}-any & 
    \begin{itemize}[leftmargin=*]
        \item $y \in \{a,b\}$ 
        \item $y \in \Ne(a)\cap \Ne(b)$
        \item $x \in \{a,b\}$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y = b$
        \item $y \in \Ne(a)\cap \Ne(b)$
        \item $x = a$ and $y \in \Ne(b)$
        \item $x = b$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $x = a$ and $y \in \Ne(b) \cup \{b\}$
        \item $x = b$ and $y \in \Ne(a) \cup \{a\}$
        \item $y = a$ and $x \in \Ad(b)$
        \item $y = b$ and $x \in \Ad(a)$
        \item \texttt{SD}($x,y; a,b$)
        \item \texttt{SD}($x,y; b,a$)
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y = a$ and $x \in \Ad(b)$
        \item $y = b$
        \item \texttt{SD}($x,y; b,a$)
        \item $x = b$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y=b$
        \item $x = a$ and $y \in \Ne(b) \cup \{b\}$
        \item $x = b$
        \item \texttt{SD}($x,y; a,b$)
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y \in \{a,b\}$
        \item $x=b$
    \end{itemize}
    & \begin{itemize}[leftmargin=*]
        \item $y \in \{a,b\}$
        \item $x \in \{a,b\}$
        \item \texttt{SD}($x,y; a,b$)
    \end{itemize}
    \\
    \bottomrule
    \end{tabular}
    } 
    \caption{For each type of edge update involving an edge $(a,b)$, we list necessary
    conditions for each validity conditions of operators Insert$(x,y,T,E)$,
    Delete$(x,y,C,E)$, and Reverse$(x,y,T,E,F)$ to become valid.    
    The notation \texttt{SD}($x,y; a,b$) is a shorthand for the necessary condition:
    $(a,b)$, in that order, is on a semi-directed path from $y$ to $x$. All operators
    $\Pa, \Ne, \Ad$ and \texttt{SD}($x,y; a,b$) are computed with respect to the PDAG
    before the edge update. The rows \textbf{I}-any, \textbf{D}-any, and \textbf{R}-any
    aggregate the necessary conditions for each validity condition and express them in 
    a disjunctive form: at least one of the conditions must be true for the operator to
    become valid.}
    \label{tab:operator_updates2}
\end{table*}


\newtheorem{opup}{Operator Update}
\newtheorem{lemma}{Lemma}


\subsubsection{I1}


\begin{opup}[Updates on I1]
    Assume $\mathbf{I1}(x,y, T; E)$ is false and becomes true after an update involving
    $(a,b)$. Then,
    \begin{itemize}
        \item the update cannot be $U1: (a \quad b) \rightsquigarrow (a - b)$,
        \item the update cannot be $U2: (a \quad b) \rightsquigarrow (a \rightarrow b)$,
        \item if the update is $U3: (a - b) \rightsquigarrow (a \quad b)$ then $ \{a,b\}
        =\{x,y\}$,
        \item the update cannot be $U4: (a - b) \rightsquigarrow (a \rightarrow b)$,
        \item if the update is $U5: (a \rightarrow b) \rightsquigarrow (a \quad b)$ then
        $\{a,b\} =\{x,y\}$,
        \item the update cannot be $U6: (a \rightarrow b) \rightsquigarrow (a - b)$,
        \item the update cannot be $U7: (a \rightarrow b) \rightsquigarrow (a \leftarrow
        b)$.
    \end{itemize}
\end{opup}

\begin{proof}
    We recall that $\mathbf{I1}(x,y, T; E)$ is $y \not\in \Ad(x)$. So the assumptions
    are $y \in \Ad(x)$ and $y \not\in \Ad^u(x)$. But U1, U2, U4, U6, and U7 do not
    remove any elements from any $\Ad(x')$ set. So none of them can render
    $\mathbf{I1}(x,y, T; E)$ true. 

    U3 and U5 can only remove elements from $\Ad(a)$ or $\Ad(b)$, and do so only by
    removing $b$ or $a$, respectively. So $\{x,y\} = \{a,b\}$.
\end{proof}

\subsubsection{I2}
We start with a general lemma for I2.

\begin{lemma}[I2 to become true]\label{lemma:I2} Assume $\mathbf{I2}(x,y, T; E)$ is
    false and becomes true after an edge update. Then (i) $\Ne^u(y)$ gained an element,
    or (ii) $\Ad^u(x)$ lost an element that was in $\Ne(y)$.
\end{lemma}
\begin{proof}
    We recall that $\mathbf{I2}(x,y, T; E)$ is $T \subset \Ne(y) \backslash \Ad(x)$. If
     $\mathbf{I2}(x, y, T; E)$ changes from false to true then there exists $t \in T$
     that was not in $\Ne(y) \backslash \Ad(x)$ and is now in $\Ne^u(y) \backslash
     \Ad^u(x)$, which writes $$(t\not \in \Ne(y) \vee t \in \Ad(x)) \wedge t \in
     \Ne^u(y) \wedge t \not\in \Ad^u(x).$$
     \begin{itemize}
        \item If $t \in \Ne(y)$ then we must have $t \in \Ad(x)$ and $t \not\in
        \Ad^u(x)$. So $\Ad^u(x)$ lost $t$, which was in $\Ne(y) \cap \Ad(x)$.
        \item If $t \not\in \Ne(y)$, then $\Ne^u(y)$ gained $t$. 
     \end{itemize}
    In conclusion, either $\Ne^u(y)$ gained an element, or $\Ad^u(x)$ lost an element
     that was is in $\Ne(y)$. %(With more work and assuming \textbf{I1} holds after the
    %  update, we can also show that the element gained by $\Ne^u(y)$ is not in $\Ad(x)$).

\end{proof}


\begin{opup}[Updates on I2]
    Assume $\mathbf{I2}(x,y, T; E)$ is false and becomes true after an update involving
    $(a,b)$. Then,
    \begin{itemize}
        \item if the update is $U1: (a \quad b) \rightsquigarrow (a - b)$ then $y \in
        \{a, b\}$,
        \item the update cannot be $U2: (a \quad b) \rightsquigarrow (a \rightarrow b)$,
        \item if the update is $U3: (a - b) \rightsquigarrow (a \quad b)$ then
            $\curlystack{ a=x \\ b \in \Ne(y)}$ or $\curlystack{b=x \\ a \in \Ne(y)}$,
        \item the update cannot be $U4: (a - b) \rightsquigarrow (a \rightarrow b)$,
        \item if the update is $U5: (a \rightarrow b) \rightsquigarrow (a \quad b)$ then
            $\curlystack{ a=x \\ b \in \Ne(y)}$ or $\curlystack{b=x \\ a \in \Ne(y)}$,
        \item if the update is $U6: (a \rightarrow b) \rightsquigarrow (a - b)$ then $y
        \in \{a, b\}$,
        \item the update cannot be $U7: (a \rightarrow b) \rightsquigarrow (a \leftarrow
        b)$.
    \end{itemize}
\end{opup}

\begin{proof}
    According to \Cref{lemma:I2}, either $\Ne^u(y)$ gained an element or $\Ad^u(x)$ lost
    an element (that was in $\Ne(y)$).

    We now study the necessary conditions for each update, if it was applied and made
    $\mathbf{I2}(x,y, T; E)$ become true.
    \begin{itemize}
        \item The updates U1 and U6 can only add elements to $\Ne^u(a)$ or $\Ne^u(b)$
        and not remove any element to any $\Ad^u(x')$. So $\Ne^u(y)$ gained an element
        and $y \in \{a, b\}$.
        \item The updates U2, U4, and U7 do not add any elements to any $\Ne^u(y')$, and
        do not remove any elements to any $\Ad^u(x')$. So none of them can make
        $\mathbf{I2}(x,y, T; E)$ become true.
        \item The updates U3 and U5 can only remove elements from $\Ad^u(a)$ or
        $\Ad^u(b)$ and not add any element to any $\Ne^u(y')$. So $\Ad^u(x)$ lost an
        element and $x \in \{a, b\}$. If $x = a$ (resp. $x = b$) then the lost element
        must be $b$ (resp. $a$) and so $b \in \Ne(y)$ (resp. $a \in \Ne(y)$).
    \end{itemize}
\end{proof}

\subsubsection{I3}
We start with a general lemma for I3.
\begin{lemma}[I3 to become true]\label{lemma:I3} Assume $\mathbf{I3}(x,y, T; E)$ is
    false and becomes true after an edge update about $(a,b)$. Further, assume that
    $\mathbf{I2}(x,y, T; E)$ is true after the update (regardless of its status before
    the update). Then either (i) $\{a,b\} \subset \Ne(y)$ and the update rendered $a,b$
    adjacent, or (ii) $\Ne^u(y)$ lost an element that was in $\Ne(y) \cap \Ad(x)$, or
    (iii) $\Ad^u(x)$ lost an element that was in $\Ne(y) \cap \Ad(x)$.
\end{lemma}
\begin{proof}
    We recall that $\mathbf{I3}(x,y, T; E)$ is $[\Ne(y) \cap \Ad(x)] \cup T$ is a
    clique, and that $\mathbf{I2}(x,y, T; E)$ is $T \subset \Ne(y) \backslash \Ad(x)$.
    So the assumptions are $[\Ne(y) \cap \Ad(x)] \cup T$ is not a clique (in the
    pre-update PDAG) meanwhile $[\Ne^u(y) \cap \Ad^u(x)] \cup T$ is a clique (in the
    post-update PDAG), and $T \subset \Ne^u(y) \backslash \Ad^u(x)$.

    Since $[\Ne(y) \cap \Ad(x)] \cup T$ is not a clique, it must contain two nodes $c,d$
    that are not connected in the pre-update PDAG. 

    We distinguish two cases: 
    \begin{itemize}
        \item If $\{c,d\} \subset [\Ne^u(y) \cap \Ad^u(x)] \cup T$, then the update must
        have connected $c$ and $d$. So $c$ and $d$ are $a$ and $b$. Also since $T
        \subset \Ne^u(y) \backslash \Ad^u(x)$, then $\{a,b\} \subset [\Ne^u(y) \cap
        \Ad^u(x)] \cup T \subset \Ne^u(y)$. Finally, an update can only change one edge
        at a time, so $\Ne^u(y) = \Ne(y)$ (since $a$ and $b$ are not $y$ as $y$ cannot
        be a neighbor of itself). Hence, $\{a,b\} \subset \Ne(y)$ and $a$ and $b$ became
        adjacent.
        
        \item Else, $c$ or $d$ has been removed from $[\Ne^u(y) \cap \Ad^u(x)] \cup T$
        during the update. Without loss of generality, assume $c$ was removed. Since $T$
        does not change, then $c$ was removed from $[\Ne(y) \cap \Ad(x)]$. So $\Ne^u(y)$
        or $\Ad^u(x)$ lost an element that was in $\Ne(y) \cap \Ad(x)$.
    \end{itemize}
    
    Hence, [$\{a,b\} \subset \Ne(y)$ and $a$ and $b$ became adjacent], or $\Ne(y)$ lost
     an element that was in $\Ne(y) \cap \Ad(x)$ or $\Ad(x)$ lost an element that was in
     $\Ne(y) \cap \Ad(x)$.
\end{proof}


\begin{opup}[Updates on I3]
    Assume $\mathbf{I3}(x,y, T; E)$ is false and becomes true after an update involving
    $(a,b)$. Further, assume that
    $\mathbf{I2}(x,y, T; E)$ is true after the update. Then,
    \begin{itemize}
        \item if the update is $U1: (a \quad b) \rightsquigarrow (a - b)$ then $\{a,b\}
        \subset \Ne(y)$,
        \item if the update is $U2: (a \quad b) \rightsquigarrow (a \rightarrow b)$ then
        $\{a,b\} \subset \Ne(y)$,
        \item if the update is $U3: (a - b) \rightsquigarrow (a \quad b)$ then
        $\curlystack{ a \in  \{x,y\} \\ 
            b \in \Ne(y) \cap \Ad(x) }$ or $\curlystack{ b \in  \{x,y\} \\ 
            a \in \Ne(y) \cap \Ad(x) }$,
        \item if the update is $U4: (a - b) \rightsquigarrow (a \rightarrow b)$ then
        $\curlystack{ a =y \\ 
            b \in \Ne(y) \cap \Ad(x) }$ or $\curlystack{ b = y \\ 
            a \in \Ne(y) \cap \Ad(x) }$,
        \item if the update is $U5: (a \rightarrow b) \rightsquigarrow (a \quad b)$ then
        $\curlystack{ a = x \\ 
            b \in \Ne(y) \cap \Ad(x) }$ or $\curlystack{ b = x \\ 
            a \in \Ne(y) \cap \Ad(x) }$,
        \item if the update is $U6: (a \rightarrow b) \rightsquigarrow (a - b)$ then it
        is impossible,
        \item if the update is $U7: (a \rightarrow b) \rightsquigarrow (a \leftarrow b)$
        then it is impossible.
    \end{itemize}
    
\end{opup}

\begin{proof}
    According to \Cref{lemma:I3}, either $\{a,b\} \subset \Ne(y)$ and the update
    rendered $a,b$ adjacent, or $\Ne^u(y)$ lost an element that was in $\Ne(y) \cap
    \Ad(x)$, or $\Ad^u(x)$ lost an element that was in $\Ne(y) \cap \Ad(x)$.

    We now study the necessary conditions for each update, if it was applied and made
    $\mathbf{I3}(x,y, T; E)$ become true.
    \begin{itemize}
        \item The updates U1 and U2 can only add elements to sets like $\Ne^u(y)$ or
        $\Ad^u(x)$, so the only possibility is that $\{a,b\} \subset \Ne(y)$.
        \item The update U3 does not render any edge adjacent. So by \Cref{lemma:I3},
        $\Ne(y)$ or $\Ad(x)$ lost an element $c$ that was in $\Ne(y) \cap \Ad(x)$. 
        \begin{itemize}
            \item If it is $\Ne(y)$ that lost $c$, then we have $\{a,b\} = \{y,c\}$.
            Without loss of generality, $a = y$ and $b = c$, so $b \in \Ne(y) \cap
            \Ad(x)$. 
            \item If it is $\Ad(x)$ that lost $c$, then we have $\{a,b\} = \{x,c\}$.
            Without loss of generality, $a = x$ and $b = c$, so $b \in \Ne(y) \cap
            \Ad(x)$.
        \end{itemize} 
            So gathering all cases and with generality:
            $$ \curlystack{ a \in  \{x,y\} \\ 
                b \in \Ne(y) \cap \Ad(x) } \text{ or } \curlystack{ b \in  \{x,y\} \\ 
                a \in \Ne(y) \cap \Ad(x) }$$
        \item The update U4 does not render any edge adjacent, does not remove any
        element from any $\Ad(x')$, but removes elements from $\Ne^u(a)$ or $\Ne^u(b)$
        (resp.$b$ or $a$). So by \Cref{lemma:I3}, $a=y$ (resp. $b=y$) and $b \in \Ne(y)
        \cap \Ad(x)$ (resp. $a \in \Ne(y) \cap \Ad(x)$).
        \item The update U5 does not render any edge adjacent, does not remove any
        element from any $\Ne(y')$, but removes elements from $\Ad^u(a)$ or $\Ad^u(b)$
        (resp.$b$ or $a$). So by \Cref{lemma:I3}, $a=x$ (resp. $b=x$) and $b \in \Ne(y)
        \cap \Ad(x)$ (resp. $a \in \Ne(y) \cap \Ad(x)$).
        \item The updates U6 and U7 cannot remove any element from any $\Ne(y')$ or
        $\Ad(x')$, and do not make $a$ and $b$ adjacent (they were already adjacent). So
        by \Cref{lemma:I3}, they cannot make $\mathbf{I3}(x,y, T; E)$ become true.
\end{itemize}
\end{proof}

\subsubsection{I4}
We start with a general lemma for I4.
\begin{lemma}[I4 to become true]\label{lemma:I4} Assume $\mathbf{I4}(x,y, T; E)$ is
    false and becomes true after an edge update about $(a,b)$. If the update does not
    reverse a directed edge, does not direct an undirected edge, and does not delete an
    edge, then the update must have added an element to $[\Ne(y) \cap \Ad(x)]$.
    
    Otherwise, the update invalidated an edge on a semi-directed path from $y$ to $x$
    (where invalidated means that the edge $(a,b)$ cannot be traversed from $a$ to $b$
    anymore with the semi-directed rules: either $a$ and $b$ are not adjacent anymore,
    or the edge is now $a \leftarrow b$.).
\end{lemma}

\begin{proof}
    We recall that $\mathbf{I4}(x,y, T; E)$ is: all semi-directed paths from $y$ to $x$
    have a node in $[\Ne(y) \cap \Ad(x)] \cup T$. If the condition does not hold before
    the update, then there exists a semi-directed path from $y$ to $x$ with no node in
    $[\Ne(y) \cap \Ad(x)] \cup T$. We distinguish two cases:

    If the update does not remove or reverse any edge, then the semi-directed path is
    still there after the update. For the condition to become true, the update must have
    added an element to $[\Ne(y) \cap \Ad(x)] \cup T$ (one element that is on the
    semi-directed path).

    Since $T$ does not change, the update must have added an element to $[\Ne(y) \cap
    \Ad(x)]$.

    Otherwise, the semi-directed path from $y$ to $x$ is not a semi-directed path
    anymore. So the update invalidated an edge on it: either $a$ and $b$ are not
    adjacent anymore, or the edge is now $a \leftarrow b$.
\end{proof}

\begin{opup}[Updates on I4]
    \label{opup:updates_on_I4}
    Assume $\mathbf{I4}(x,y, T; E)$ is false and becomes true after an update involving
    $(a,b)$. Then,
    \begin{itemize}
        \item if the update is $U1: (a \quad b) \rightsquigarrow (a - b)$ then
        $\curlystack{b=y \\ a \in \Ad(x)}$ or $\curlystack{b=x \\ a \in \Ne(y)}$ or
        $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{a=x \\ b \in \Ne(y)}$,
        \item if the update is $U2: (a \quad b) \rightsquigarrow (a \rightarrow b)$ then
        $\curlystack{b=x \\ a \in \Ne(y)}$ or $\curlystack{a=x \\ b \in \Ne(y)}$.
        % \item if the update is $U3: (a - b) \rightsquigarrow (a \quad b)$ or $U4: (a -
        % b) \rightsquigarrow (a \rightarrow b)$ or $U5: (a \rightarrow b)
        % \rightsquigarrow (a \quad b)$ or $U7: (a \rightarrow b) \rightsquigarrow (a
        % \leftarrow b)$         
        %  then $a - b$ (or $a \rightarrow b$) is in on a semi-directed path from $y$ to
        % $x$ . $\curlystack{b=x \\ a \in \Ne(y)}$ or $\curlystack{a=x \\ b \in
        % \Ne(y)}$,
        \item if the update is $U3: (a - b) \rightsquigarrow (a \quad b)$ then either
        $(a,b)$ or $(b,a)$ was on a semi-directed path from $y$ to $x$.

        \item if the update is $U4: (a - b) \rightsquigarrow (a \rightarrow b)$ then
        $(b,a)$ was on a semi-directed path from $y$ to $x$.
        \item if the update is $U5: (a \rightarrow b) \rightsquigarrow (a \quad b)$ then
        $(a,b)$ was on a semi-directed path from $y$ to $x$.
        \item if the update is $U6: (a \rightarrow b) \rightsquigarrow (a - b)$ then
        $\curlystack{b=y \\ a \in \Ad(x)}$ or $\curlystack{a=y \\ b \in \Ad(x)}$.
        \item if the update is $U7: (a \rightarrow b) \rightsquigarrow (a \leftarrow b)$
        then $(a,b)$ was on a semi-directed path from $y$ to $x$.
    \end{itemize}
\end{opup}

\begin{proof}
    Assume $\mathbf{I4}(x,y, T; E)$ is false and becomes true after an update involving
    $(a,b)$. U1, U2, and U6 do not reverse any directed edge, do not direct any
    undirected edge, and do not delete any edge. So by \Cref{lemma:I4}, these updates
    must have added an element to $[\Ne(y) \cap \Ad(x)]$. Without loss of generality for
    now, assume $a$ was added. Notice that $a$ cannot have been added to both $\Ne(y)$
    and $\Ad(x)$ (otherwise $y=b$ and $x=b$, yet $x\neq y$), so $a$ was already in one
    of them before the update. 
    \begin{itemize}
        \item If the update is U1 then $a$ can have been added to $\Ne(y)$ or $\Ad(x)$,
        and already present in the other one. Hence we have, in full generality,
        $\curlystack{b=y \\ a \in \Ad(x)}$ or $\curlystack{b=x \\ a \in \Ne(y)}$ or
        $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{a=x \\ b \in \Ne(y)}$.
        \item If the update is U2 then $a$ can only have been added to $\Ad(x)$, and so
        already present in $\Ne(y)$. Hence we have, in full generality, $\curlystack{b=x
        \\ a \in \Ne(y)}$ or $\curlystack{a=x \\ b \in \Ne(y)}$.
        \item If the update is U6 then $a$ can only have been added to $\Ne(y)$, and so
        already present in $\Ad(x)$. Hence we have, in full generality, $\curlystack{b=y
        \\ a \in \Ad(x)}$ or $\curlystack{a=y \\ b \in \Ad(x)}$.
    \end{itemize}

    U3, U4, U5, and U7 cannot add any element to $[\Ne(y) \cap \Ad(x)]$. So by
    \Cref{lemma:I4}, these updates must have invalidated an edge on a semi-directed path
    from $y$ to $x$. 
    \begin{itemize}
        \item If the update is U3 then either $(a,b)$ or $(b,a)$ was on a semi-directed
        path from $y$ to $x$.
        \item If the update is U4 then $(b,a)$ was on a semi-directed path from $y$ to
        $x$.
        \item If the update is U5 or U7, then $(a,b)$ was on a semi-directed path from
        $y$ to $x$.        
    \end{itemize}
\end{proof}

So far, all the necessary conditions for the updates were efficient to test, e.g. finding
all the insert with $y \in \{a, b\}$.

With $\mathbf{I4}$ however, we have the condition that $(a,b)$ or $(b,a)$ was on a
semi-directed path from $y$ to $x$. This can be inefficient to test. 
A speed-up can be obtained by proceeding as follows
\begin{itemize}
    \item Instead of ensuring that $\mathcal{C}$ always contains all valid Insert
    operators (which means all operators that with $\mathbf{I1}$, $\mathbf{I2}$,
    $\mathbf{I3}$, $\mathbf{I4}$, and $\mathbf{I5}$ are true), we can ensure that
    $\mathcal{C}$ always contains all Insert operator for which $\mathbf{I1}$,
    $\mathbf{I2}$, $\mathbf{I3}$, and $\mathbf{I5}$ are true. 
    \item Recall that at each step, XGES involves 4 substeps described in
    \Cref{sec:efficient_algorithmic_formulation}. Substep 3 verifies that the operator
    is valid. If we notice an operator that is invalid because of $\mathbf{I4}$, then we
    can put it aside. Additionally, we save the path from $y$ to $x$ that was rendering 
    the operator invalid. 
    \item The new necessary condition for the operator to be valid is that an edge on
    the saved path gets removed (or blocked). Whenever we remove or block an edge from
    the path, we can re-verify the operator.
\end{itemize}

\subsubsection{I5}
We start with a general lemma for I5.

\begin{lemma}[I5 to become true]\label{lemma:I5} Assume $\mathbf{I5}(x,y, T; E)$ is
    false and becomes true after an edge update about $(a,b)$. Then (i) $\Pa(y)$
    changed, or (ii) $[\Ne(y) \cap \Ad(x)]$ changed.

    Condition (ii) can be further broken down into: (ii.a) $\Ne^u(y)$ lost an element
    that is in $\Ad(x)$, or (ii.b) $\Ne^u(y)$ gained an element that is in $\Ad(x)$, or
    (ii.c) $\Ne^u(y)$ gained an element that is in $\Ad(x)$, or (ii.d) $\Ad^u(x)$ gained
    an element that is in $\Ne(y)$.
\end{lemma}

\begin{proof}
    Assume $\mathbf{I5}(x,y, T; E)$ is false and becomes true after an edge update about
    $(a,b)$. Since $E$ and $T$ do not change, we must have $[\Ne^u(y) \cap \Ad^u(x)]
    \cup \Pa^u(y) \neq [\Ne(y) \cap \Ad(x)] \cup \Pa(y)$. Either $\Pa(y)$ changed or
    $[\Ne(y) \cap \Ad(x)]$ changed.

    Assume $[\Ne(y) \cap \Ad(x)]$ changed. If it lost an element $c \in \Ne(y) \cap
    \Ad(x)$, then $c$ was removed from $\Ne^u(y)$ or $\Ad^u(x)$. If it gained an element
    $c \not\in \Ne(y) \cap \Ad(x)$, then $c$ was added to $\Ne^u(y)$ or $\Ad^u(x)$.
    Since $c \in \Ne^u(y) \cap \Ad^u(x)$ and only one of $\Ne^u(y)$ and $\Ad^u(x)$ can
    change at a time (see proof \Cref{opup:updates_on_I4}), then either $c$ was added to
    $\Ne^u(y)$ and $c \in \Ad(x)$, or $c$ was added to $\Ad^u(x)$ and $c \in \Ne(y)$.
\end{proof}

\begin{opup}[Updates on I5]
    Assume $\mathbf{I5}(x,y, T; E)$ is false and becomes true after an update involving
    $(a,b)$. Then,
    \begin{itemize}
        \item if the update is $U1: (a \quad b) \rightsquigarrow (a - b)$ then
        $\curlystack{b=y \\ a \in \Ad(x)}$ or $\curlystack{b=x \\ a \in \Ne(y)}$ or
        $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{a=x \\ b \in \Ad(y)}$,
        \item if the update is $U2: (a \quad b) \rightsquigarrow (a \rightarrow b)$ then
         $y = b$ or $\curlystack{b=x \\ a \in \Ne(y)}$ or $\curlystack{a=x \\ b \in
         \Ne(y)}$,
        \item if the update is $U3: (a - b) \rightsquigarrow (a \quad b)$ then
        $\curlystack{b=y \\ a \in \Ad(x)}$ or $\curlystack{b=x \\ a \in \Ne(y)}$ or
        $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{a=x \\ b \in \Ad(y)}$,
        \item if the update is $U4: (a - b) \rightsquigarrow (a \rightarrow b)$ then
        $y=b$ or $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{b = y \\ a \in
        \Ad(x)}$.
        \item if the update is $U5: (a \rightarrow b) \rightsquigarrow (a \quad b)$ then
        $y=b$ or $\curlystack{a=x \\ b \in \Ne(y)}$ or $\curlystack{b = x \\ a \in
        \Ne(y)}$.
        \item if the update is $U6: (a \rightarrow b) \rightsquigarrow (a - b)$ then
        $y=b$ or $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{b = y \\ a \in
        \Ad(x)}$.
        \item if the update is $U7: (a \rightarrow b) \rightsquigarrow (a \leftarrow b)$
        then $y\in\{a,b\}$.
    \end{itemize}
\end{opup}

\begin{proof}
    According to \Cref{lemma:I5}, either $\Pa(y)$ changed, or $[\Ne(y) \cap \Ad(x)]$
    changed.

    We now study the necessary conditions for each update, if it was applied and made
    $\mathbf{I5}(x,y, T; E)$ become true.
    \begin{itemize}
        \item U1 does not change $\Pa(y)$, and cannot remove any element from any
        $\Ne(y')$ or $\Ad(x')$. So by \Cref{lemma:I5}, (ii.c) or (ii.d) happened. Hence:
        $\curlystack{b=y \\ a \in \Ad(x)}$ or $\curlystack{b=x \\ a \in \Ne(y)}$ or
        $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{a=x \\ b \in \Ne(y)}$.
        \item U2 changes $\Pa(y)$ if $y = b$. It can also add an element to $\Ad^u(x)$
        so: $y=b$ or $\curlystack{b=x \\ a \in \Ne(y)}$ or $\curlystack{a=x \\ b \in
        \Ne(y)}$.
        \item U3 does not change $\Pa(y)$, and does not add any element to any $\Ne(y')$
        or $\Ad(x')$.\\
        So by \Cref{lemma:I5}, (ii.a) or (ii.b) happened. Hence: $\curlystack{a=x \\ b
        \in \Ne(y) }$ or $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{b=x \\ a \in
        \Ne(y) }$ or $\curlystack{b=y \\ a \in \Ad(x)}$.
        \item U4 changes $\Pa(y)$ if $y = b$. It also removes an element from $\Ne^u(a)$
        and $\Ne^u(b)$.\\
        So: $y=b$ or $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{b = y \\ a \in
        \Ad(x)}$.
        \item U5 changes $\Pa(y)$ if $y = b$. It also removes an element from $\Ad^u(a)$
        and $\Ad^u(b)$.\\
        So: $y=b$ or $\curlystack{a=x \\ b \in \Ne(y)}$ or $\curlystack{b = x \\ a \in
        \Ne(y)}$.
        \item U6 changes $\Pa(y)$ if $y = b$. It also adds an element to $\Ne^u(a)$ and
        $\Ne^u(b)$.\\
        So: $y=b$ or $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{b = y \\ a \in
        \Ad(x)}$.
        \item U7 changes $\Pa(y)$ if $y \in \{a,b\}$. It does not change any $\Ne(y')$
        or $\Ad(x')$. So $y \in \{a,b\}$.
    \end{itemize}
\end{proof}

\subsubsection{D1}

\begin{opup}[Updates on D1]
    Assume $\mathbf{D1}(x,y, T; E)$ is false and becomes true after an update involving
    $(a,b)$. Then, 
    \begin{itemize}
        \item if the update is $U1: (a \quad b) \rightsquigarrow (a - b)$ then $\{a,b\}
        = \{x,y\}$,
        \item if the update is $U2: (a \quad b) \rightsquigarrow (a \rightarrow b)$ then
        $(a,b) = (x,y)$,
        \item the update cannot be $U3: (a - b) \rightsquigarrow (a \quad b)$,
        \item the update cannot be $U4: (a - b) \rightsquigarrow (a \rightarrow b)$,
        \item the update cannot be $U5: (a \rightarrow b) \rightsquigarrow (a \quad b)$,
        \item if the update is $U6: (a \rightarrow b) \rightsquigarrow (a - b)$ then
        $(a,b) = (y,x)$,
        \item if the update is $U7: (a \rightarrow b) \rightsquigarrow (a \leftarrow b)$
        then $(a,b) = (y,x)$.
    \end{itemize}
\end{opup}

\begin{proof}
    We recall that $\mathbf{D1}(x,y, C; E)$ is: $y \in \Ch(x) \cup \Ne(x)$. Assume 
    $\mathbf{D1}(x,y, C; E)$ is false and becomes true after an update involving $(a,b)$.
    \begin{itemize}
        \item U3 and U5 cannot add any element to $y$'s children or neighbors. So they
        cannot make $\mathbf{D1}(x,y, C; E)$ become true.
        \item U4 does not add any elements to any $\Ch^u(x') \cup \Ne^u(x')$, so it cannot
        make $\mathbf{D1}(x,y, C; E)$ become true.
        \item U1 only adds $a$ to $\Ne^u(b)\cup \Ch^u(b)$ and $b$ to $\Ne^u(a)\cup \Ch^u(a)$. So $\{a,b\} = \{x,y\}$.
        \item U2 only adds $b$ to $\Ch^u(a)\cup \Ne^u(a)$ so $(a,b) = (x,y)$.
        \item U6 only adds $a$ to $\Ch^u(b) \cup \Ne^u(b)$ so $(a,b) = (y,x)$.
        \item U7 only adds $a$ to $\Ch^u(b)\cup \Ne^u(b)$ so $(a,b) = (y,x)$. 
    \end{itemize}
\end{proof}

\subsubsection{D2}
We start with a general lemma for D2.

\begin{lemma}[D2 to become true]\label{lemma:D2} Assume $\mathbf{D2}(x,y, C; E)$ is
    false and becomes true after an edge update about $(a,b)$. Then $\Ne^u(y)$ gained an
    element that was in $\Ad(x)$, or $\Ad^u(x)$ gained an element that was in $\Ne(y)$.
\end{lemma}

\begin{proof}
    We recall that $\mathbf{D2}(x,y, C; E)$ is: $C \subset \Ne(y) \cap \Ad(x)$. Assume
    $\mathbf{D2}(x,y, C; E)$ is false and becomes true after an edge update about
    $(a,b)$. Since $C$ does not change, we there exists $c\in C$ such that $c \not\in
    \Ne(y) \cap \Ad(x)$ and $c \in \Ne^u(y) \cap \Ad^u(x)$. Then we conclude with a similar 
    reasoning as in \Cref{lemma:I5}.
\end{proof}

\begin{opup}[Updates on D2]
    Assume $\mathbf{D2}(x,y, C; E)$ is false and becomes true after an update involving
    $(a,b)$. Then, 
    \begin{itemize}
        \item if the update is $U1: (a \quad b) \rightsquigarrow (a - b)$ then 
        $\curlystack{b=y \\ a \in \Ad(x)}$ or $\curlystack{b=x \\ a \in \Ne(y)}$ or
        $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{a=x \\ b \in \Ne(y)}$,
        \item if the update is $U2: (a \quad b) \rightsquigarrow (a \rightarrow b)$ then
        $\curlystack{b=x \\ a \in \Ne(y)}$ or $\curlystack{a=x \\ b \in \Ne(y)}$,
        \item the update cannot be $U3: (a - b) \rightsquigarrow (a \quad b)$,
        \item the update cannot be $U4: (a - b) \rightsquigarrow (a \rightarrow b)$,
        \item the update cannot be $U5: (a \rightarrow b) \rightsquigarrow (a \quad b)$,
        \item if the update is $U6: (a \rightarrow b) \rightsquigarrow (a - b)$ then
        $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{b=y \\ a \in \Ad(x)}$,
        \item the update cannot be $U7: (a \rightarrow b) \rightsquigarrow (a \leftarrow b)$.
    \end{itemize}
\end{opup}

\begin{proof}
    According to \Cref{lemma:D2}, either $\Ne^u(y)$ gained an element that was in
    $\Ad(x)$, or $\Ad^u(x)$ gained an element that was in $\Ne(y)$. We now study the
    necessary conditions for each update, if it was applied and made $\mathbf{D2}(x,y, C;
    E)$ become true.
    \begin{itemize}
        \item U3, U4, U5 and U7 do not add any element to $\Ne^u(y)$ or $\Ad^u(x)$. So they
        cannot make $\mathbf{D2}(x,y, C; E)$ become true.
        \item U1's only modifications to sets $\Ne(y')$ and $\Ad(x')$ are to add $a$ to $\Ne^u(b)$, add $a$ to $\Ad^u(b)$, and 
        same exchanging $a$ and $b$. So by \Cref{lemma:D2}, $\curlystack{b=y \\ a \in \Ad(x)}$ or
        $\curlystack{b=x \\ a \in \Ne(y)}$ or $\curlystack{a=y \\ b \in \Ad(x)}$ or $\curlystack{a=x \\ b \in \Ne(y)}$.
        \item U2 's only modifications to sets $\Ne(y')$ and $\Ad(x')$ are to add $b$ to
        and $\Ad^u(a)$ and same exchanging $a$ and $b$. So by \Cref{lemma:D2} 
        $\curlystack{a=x \\ b \in \Ne(y)}$ or $\curlystack{b = x \\ a \in \Ne(y)}$.
        \item U6's only modifications to sets $\Ne(y')$ and $\Ad(x')$ are to add $a$ to
        $\Ne^u(b)$ and same exchanging $a$ and $b$. So by \Cref{lemma:D2} 
        $\curlystack{b=y \\ a \in \Ad(x)}$ or $\curlystack{a=y \\ b \in \Ad(x)}$. 
    \end{itemize}
\end{proof}

\subsubsection{D3}

\begin{opup}[Updates on D3]
    Assume $\mathbf{D3}(x,y, C; E)$ is false and becomes true after an edge update involving
    $(a,b)$. Also assume that $\mathbf{D2}(x,y, C; E)$ holds true after the edge update, then
    \begin{itemize}
        \item if the update is $U1: (a \quad b) \rightsquigarrow (a - b)$ then $\{a,b\}
        \subset \Ne^u(y) \cap \Ad^u(x)$,
        \item if the update is $U2: (a \quad b) \rightsquigarrow (a \rightarrow b)$ then
        $\{a,b\} \subset \Ne^u(y) \cap \Ad^u(x)$,
        \item the update cannot be $U3: (a - b) \rightsquigarrow (a \quad b)$,
        \item the update cannot be $U4: (a - b) \rightsquigarrow (a \rightarrow b)$,
        \item the update cannot be $U5: (a \rightarrow b) \rightsquigarrow (a \quad b)$,
        \item the update cannot be $U6: (a \rightarrow b) \rightsquigarrow (a - b)$,
        \item the update cannot be $U7: (a \rightarrow b) \rightsquigarrow (a \leftarrow b)$.
    \end{itemize}
\end{opup}

\begin{proof}
    We recall that $\mathbf{D3}(x,y, C; E)$ is: $C$ is a clique. Assume 
    $\mathbf{D3}(x,y, C; E)$ is false and becomes true after an update involving $(a,b)$.
    Similarly to
\Cref{lemma:I3}, since $C$ is not changed by an edge update, the only way for 
$\mathbf{D3}(x,y, C; E)$ to become true is for the edge update to connect two nodes in $C$ that
were not adjacent before. Only U1 and U2 render two nodes adjacent, namely $a$ and $b$,
so they are the only updates that can make $\mathbf{D3}(x,y, C; E)$ become true.

For U1 and U2, we have: $\{a,b\} \subset C$. If we further assume that $\mathbf{D2}(x,y, C; E)$ holds true after the edge update, then
$\{a,b\} \subset C \subset \Ne^u(y) \cap \Ad^u(x)$.
\end{proof}

\subsubsection{D4}
\begin{opup}[Updates on D4]
    Assume $\mathbf{D4}(x,y, C; E)$ is false and becomes true after an edge update involving
    $(a,b)$. Then, 
    \begin{itemize}
        \item the update cannot be $U1: (a \quad b) \rightsquigarrow (a - b)$,
        \item if the update is $U2: (a \quad b) \rightsquigarrow (a \rightarrow b)$ then
        $y = b$,
        \item the update cannot be $U3: (a - b) \rightsquigarrow (a \quad b)$,
        \item if the update is $U4: (a - b) \rightsquigarrow (a \rightarrow b)$, then
        $y=b$,
        \item if the update is $U5: (a \rightarrow b) \rightsquigarrow (a \quad b)$, then $y=b$,
        \item if the update is $U6: (a \rightarrow b) \rightsquigarrow (a - b)$ then $y=b$,
        \item if the update is $U7: (a \rightarrow b) \rightsquigarrow (a \leftarrow b)$ then
        $y\in\{a,b\}$.
    \end{itemize}

    \begin{proof}
        Recall that $\mathbf{D4}(x,y, C; E)$ is: $E = C \cup \Pa(y)$. Since $C$ and $E$
        do not change, the only way for $\mathbf{D4}(x,y, C; E)$ to become true is for
        the edge update to change $\Pa(y)$. The only updates that can change $\Pa(y)$
        are U2, U4, U5, U6, and U7, when $y$ is $b$, or U7 when $y$ is $a$ or $b$.
    \end{proof}
    
\end{opup}

\subsubsection{R1 to R6}
The reverse operators are very similar to the insert operators, and the necessary conditions
can be adapted. We add them to \Cref{tab:operator_updates}.

\subsection{Issue with Fast GES }
\label{appendix:subsec:fast_ges}
We found an issue with the Fast GES algorithm that may explain its degraded performance
compared to the GES algorithm. 

During its efficient update of the operators, fGES computes the score of all possible
operators Insert($x,y,T$) for a pair of nodes $x$ and $y$, but only saves the Insert
with the highest score. However, this insert might not be a valid operator (for example,
it might not satisfy the I3 constraint). Meanwhile, another Insert($x,y,T'$) for the
same pair of nodes $x$ and $y$ might be valid and have the highest score of all valid
operators. Such an operator would be missed by fGES.


