.. index:: Link or Arc Reversal

.. _Link_Or_Arc_Reversal:

Link (or Arc) Reversal
======================

A link in a Bayesian network or a LIMID can be reversed using the :ref:`Reverse Link Tool<Reverse_Link_Tool>`.

Please note that, to respect the conditional independence and dependence statements encoded in the network, link reversal may cause new links to be added. For example, assume we wish to reverse the link B :math:`\rightarrow` A in B  :math:`\rightarrow` A  :math:`\leftarrow` C, which states that B and C are dependent given A. Then, to preserve this dependence statement, a link must be introduced between B and C. More precisely, the rule for link (or arc) reversal is the following:

1. Let X :math:`\rightarrow` Y be a link in a Bayesian network, where X has parents {XP\ :sub:`1`,...,XP\ :sub:`n`} and Y has parents {X,YP\ :sub:`2`,...,YP\ :sub:`m`}.
2. Reversing the link X :math:`\rightarrow` Y, makes {XP\ :sub:`1`,...,XP\ :sub:`n`} :math:`\cup` {Y,YP\ :sub:`2`,...,YP\ :sub:`m`} be the new parents of X and {YP\ :sub:`2`,...,YPm} :math:`\cup` {XP\ :sub:`1`,...,XP\ :sub:`n`} the new parents of Y.

This rule can easily be derived from Bayes' rule.

As an example, consider the network in Figure 1. When reversing the link between X and Y in this network, X get additional parents {C,D} (i.e., those parents of Y that are not already parents of X) and Y get additional parents {A} (i.e., those parents of X that are not already parents of Y). The resulting network is shown in Figure 2.

.. figure:: images/link_reversal.png

	Figure 1: A sample network, with link X :math:`\rightarrow` Y selected.

.. figure:: images/link_reversal2.png

	Figure 2: The resulting network after reversal of link X :math:`\rightarrow` Y.

Please note that only links between discrete chance nodes can be reversed.

