-del algoritmo.
-
-Por simplicidad se asumen celdas de tamaño fijo con dos punteros, ``left``
-y ``right`` (estructura clásica para representar un árbol binario) y se
-muestra el contador de referencias abajo del nombre de cada celda. Se parte
-con una pequeña estructura ya construída y se muestra primero lo que ocurre
-al eliminar la referencia :math:`r0 \to h1`:
-
-.. TODO: figure
-
-.. raw:: latex
-
- \begin{figure}[htp]
- \centering
- \subfigure[TODO]{
-
-.. digraph:: g3_1
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0\n*|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- h1 [ label = "h1\n1|<l> left|<r> right" ];
- h2 [ label = "h2\n2|<l> left|<r> right" ];
- h3 [ label = "h3\n2|<l> left|<r> right" ];
- h4 [ label = "h4\n1|<l> left|<r> right" ];
- h5 [ label = "h5\n1|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r0 -> h1 [ style = bold, color = black ];
- root:r1 -> h3;
- h1:l -> h2;
- h1:r -> h3;
- h2:l -> h4;
- h2:r -> h5;
- h3:l -> h2;
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \subfigure[TODO]{
-
-.. digraph:: g3_2
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0\n*|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- subgraph marked {
- node [ fillcolor = white, fontcolor = black ];
- h1;
- };
-
- h1 [ label = "h1\n0|<l> left|<r> right" ];
- h2 [ label = "h2\n2|<l> left|<r> right" ];
- h3 [ label = "h3\n2|<l> left|<r> right" ];
- h4 [ label = "h4\n1|<l> left|<r> right" ];
- h5 [ label = "h5\n1|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r0 -> h1 [ style = invis ];
- root:r1 -> h3;
- h1:l -> h2 [ style = bold, color = black ];
- h1:r -> h3;
- h2:l -> h4;
- h2:r -> h5;
- h3:l -> h2;
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \caption{TODO, part 1}
- \end{figure}
-
- \begin{figure}[htp]
- \centering
- \subfigure[TODO]{
-
-.. digraph:: g3_3
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0\n*|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- subgraph marked {
- node [ fillcolor = white, fontcolor = black ];
- h1;
- };
-
- h1 [ label = "h1\n0|<l> left|<r> right" ];
- h2 [ label = "h2\n1|<l> left|<r> right" ];
- h3 [ label = "h3\n2|<l> left|<r> right" ];
- h4 [ label = "h4\n1|<l> left|<r> right" ];
- h5 [ label = "h5\n1|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r0 -> h1 [ style = invis ];
- root:r1 -> h3;
- h1:l -> h2 [ style = invis ];
- h1:r -> h3 [ style = bold, color = black ];
- h2:l -> h4;
- h2:r -> h5;
- h3:l -> h2;
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \subfigure[TODO]{
-
-.. digraph:: g3_4
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- subgraph marked {
- node [ fillcolor = white, fontcolor = black ];
- h1;
- };
-
- h1 [ label = "h1\n0|<l> left|<r> right" ];
- h2 [ label = "h2\n1|<l> left|<r> right" ];
- h3 [ label = "h3\n1|<l> left|<r> right" ];
- h4 [ label = "h4\n1|<l> left|<r> right" ];
- h5 [ label = "h5\n1|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r0 -> h1 [ style = invis ];
- root:r1 -> h3;
- h1:l -> h2 [ style = invis ];
- h1:r -> h3 [ style = invis ];
- h2:l -> h4;
- h2:r -> h5;
- h3:l -> h2;
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \caption{TODO, parte 2}
- \end{figure}
-
-Como se observa, la celda ``h1`` queda con el contador en 0, por lo tanto
-pasa a ser *basura*. Los contadores de las celdas a las que apuntaban
-``h1.left`` y ``h1.right`` son decrementados, pero no se detecta más basura
-porque sigue existiendo un camino del *root set* a aquellas celdas, y por
-transitividad a todas aquellas celdas apuntadas por éstas. Es por esto que
-no es necesario seguir recorriendo el grafo de conectividad.
-
-A continuación se muestra como opera el algoritmo al cambiar a donde apunta
-``h3.left``, haciéndola apuntar a ``h5``. Es decir, que pasa luego de la
-operación ``update(h3.left, h5)`` (por simplicidad no se muestra más la
-celda ``h1`` que ahora es *basura*):
-
-.. TODO: figure
-
-.. raw:: latex
-
- \begin{figure}[htp]
- \centering
- \subfigure[TODO]{
-
-.. digraph:: g4_1
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- subgraph marked {
- node [ fillcolor = white, fontcolor = black ];
- };
-
- h2 [ label = "h2\n1|<l> left|<r> right" ];
- h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
- h4 [ label = "h4\n1|<l> left|<r> right" ];
- h5 [ label = "h5\n1|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r1 -> h3;
- h2:l -> h4;
- h2:r -> h5;
- h3:l -> h2 [ style = bold, color = black ];
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \subfigure[TODO]{
-
-.. digraph:: g4_2
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- subgraph marked {
- node [ fillcolor = white, fontcolor = black ];
- };
-
- h2 [ label = "h2\n1|<l> left|<r> right" ];
- h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
- h4 [ label = "h4\n1|<l> left|<r> right" ];
- h5 [ label = "h5\n2|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r1 -> h3;
- h2:l -> h4;
- h2:r -> h5;
- h3:l -> h2 [ style = bold, color = black ];
- h3:l -> h5 [ style = dotted, color = black ];
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \caption{TODO, part 1}
- \end{figure}
-
- \begin{figure}[htp]
- \centering
- \subfigure[TODO]{
-
-.. digraph:: g4_3
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- subgraph marked {
- node [ fillcolor = white, fontcolor = black ];
- h2;
- };
-
- h2 [ label = "h2\n0|<l> left|<r> right" ];
- h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
- h4 [ label = "h4\n1|<l> left|<r> right" ];
- h5 [ label = "h5\n2|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r1 -> h3;
- h2:l -> h4 [ style = bold, color = black ];
- h2:r -> h5;
- h3:l -> h2 [ style = invis ];
- h3:l -> h5 [ style = dotted, color = black ];
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \subfigure[TODO]{
-
-.. digraph:: g4_4
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- subgraph marked {
- node [ fillcolor = white, fontcolor = black ];
- h2; h4;
- };
-
- h2 [ label = "h2\n0|<l> left|<r> right" ];
- h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
- h4 [ label = "h4\n0|<l> left|<r> right" ];
- h5 [ label = "h5\n2|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r1 -> h3;
- h2:l -> h4 [ style = invis ];
- h2:r -> h5 [ style = bold, color = black ];
- h3:l -> h2 [ style = invis ];
- h3:l -> h5 [ style = dotted, color = black ];
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \caption{TODO, part 2}
- \end{figure}
-
- \begin{figure}[htp]
- \centering
- \subfigure[TODO]{
-
-.. digraph:: g4_5
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- subgraph marked {
- node [ fillcolor = white, fontcolor = black ];
- h2; h4;
- };
-
- h2 [ label = "h2\n0|<l> left|<r> right" ];
- h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
- h4 [ label = "h4\n0|<l> left|<r> right" ];
- h5 [ label = "h5\n1|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r1 -> h3;
- h2:l -> h4 [ style = invis ];
- h2:r -> h5 [ style = invis ];
- h3:l -> h5 [ style = bold, color = black ];
- h3:l -> h2 [ style = invis ];
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \subfigure[TODO]{
-
-.. digraph:: g4_6
-
- margin = 0;
- ratio = fill;
- size = "3.0,3.8";
- edge [ color = gray40 ];
- node [
- shape = record,
- width = 0,
- height = 0,
- style = filled,
- fillcolor = gray25,
- fontcolor = white
- ];
-
- subgraph cluster_all {
-
- root [
- label = "root\nset|<r0> r0|<r1> r1",
- style = filled,
- fillcolor = gray96,
- fontcolor = black,
- ];
-
- subgraph marked {
- node [ fillcolor = white, fontcolor = black ];
- h2; h4;
- };
-
- h2 [ label = "h2\n0|<l> left|<r> right" ];
- h3 [ label = "h3\n1|<l> left|<r> right" ];
- h4 [ label = "h4\n0|<l> left|<r> right" ];
- h5 [ label = "h5\n1|<l> left|<r> right" ];
- h6 [ label = "h6\n1|<l> left|<r> right" ];
-
- root:r1 -> h3;
- h2:l -> h4 [ style = invis ];
- h2:r -> h5 [ style = invis ];
- h3:l -> h5;
- h3:l -> h2 [ style = invis ];
- h3:r -> h6;
-
- }
-
-.. raw:: latex
-
- }
- \caption{TODO, parte 3}
- \end{figure}
+del algoritmo. Por simplicidad se asumen celdas de tamaño fijo con dos
+punteros, ``left`` y ``right`` y se muestra el contador de referencias
+abajo del nombre de cada celda. Se parte con una pequeña estructura ya
+construída y se muestra como opera el algoritmo al eliminar o cambiar una
+referencia (cambios en la conectividad del grafo).
+
+Se comienza por eliminar la referencia de ``r0`` a ``h1``, que determina
+que ``h1`` se convirtió en *basura* (figura :vref:`fig:gc-rc-rm-1`). Esto
+conduce al decremento del contador de ``h2`` y ``h3`` que permanecen en el
+*live set* ya que sus contadores siguen siendo mayores a 0 (figura
+:vref:`fig:gc-rc-rm-2`).
+
+
+.. fig:: fig:gc-rc-rm-1
+
+ Eliminación de la referencia ``r0`` :math:`\to` ``h1`` (parte 1).
+
+ .. subfig::
+
+ Se ejecuta ``update(r0, null)``.
+
+ .. digraph:: g3_1
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0\n*|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ h1 [ label = "h1\n1|<l> left|<r> right" ];
+ h2 [ label = "h2\n2|<l> left|<r> right" ];
+ h3 [ label = "h3\n2|<l> left|<r> right" ];
+ h4 [ label = "h4\n1|<l> left|<r> right" ];
+ h5 [ label = "h5\n1|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = bold, color = black ];
+ root:r1 -> h3;
+ h1:l -> h2;
+ h1:r -> h3;
+ h2:l -> h4;
+ h2:r -> h5;
+ h3:l -> h2;
+ h3:r -> h6;
+
+ }
+
+ .. subfig::
+
+ Se decrementa el contador de ``h1`` y éste queda en 0 (indicando
+ que es basura). Esto desencadena la eliminación de las referencias
+ ``h1.left`` y ``h1.right``.
+
+ .. digraph:: g3_2
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0\n*|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ subgraph marked {
+ node [ fillcolor = white, fontcolor = black ];
+ h1;
+ };
+
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h2 [ label = "h2\n2|<l> left|<r> right" ];
+ h3 [ label = "h3\n2|<l> left|<r> right" ];
+ h4 [ label = "h4\n1|<l> left|<r> right" ];
+ h5 [ label = "h5\n1|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = invis ];
+ root:r1 -> h3;
+ h1:l -> h2 [ style = bold, color = black ];
+ h1:r -> h3;
+ h2:l -> h4;
+ h2:r -> h5;
+ h3:l -> h2;
+ h3:r -> h6;
+
+ }
+
+.. fig:: fig:gc-rc-rm-2
+
+ Eliminación de la referencia ``r0`` :math:`\to` ``h1`` (parte 2).
+
+ .. subfig::
+
+ Se decrementa el contador de ``h2`` pero no queda en 0, por lo
+ tanto no es necesario descender a sus hijas; se continúa con
+ ``h3``.
+
+ .. digraph:: g3_3
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0\n*|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ subgraph marked {
+ node [ fillcolor = white, fontcolor = black ];
+ h1;
+ };
+
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h2 [ label = "h2\n1|<l> left|<r> right" ];
+ h3 [ label = "h3\n2|<l> left|<r> right" ];
+ h4 [ label = "h4\n1|<l> left|<r> right" ];
+ h5 [ label = "h5\n1|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = invis ];
+ root:r1 -> h3;
+ h1:l -> h2 [ style = invis ];
+ h1:r -> h3 [ style = bold, color = black ];
+ h2:l -> h4;
+ h2:r -> h5;
+ h3:l -> h2;
+ h3:r -> h6;
+
+ }
+
+ .. subfig::
+
+ El contador de ``h3`` tampoco queda en 0; no hay necesidad de
+ descender a sus hijas y finaliza el proceso.
+
+ .. digraph:: g3_4
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ subgraph marked {
+ node [ fillcolor = white, fontcolor = black ];
+ h1;
+ };
+
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h2 [ label = "h2\n1|<l> left|<r> right" ];
+ h3 [ label = "h3\n1|<l> left|<r> right" ];
+ h4 [ label = "h4\n1|<l> left|<r> right" ];
+ h5 [ label = "h5\n1|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = invis ];
+ root:r1 -> h3;
+ h1:l -> h2 [ style = invis ];
+ h1:r -> h3 [ style = invis ];
+ h2:l -> h4;
+ h2:r -> h5;
+ h3:l -> h2;
+ h3:r -> h6;
+
+ }
+
+
+Luego se cambia una referencia (en vez de eliminarse) realizándose la
+operación ``update(h3.left, h5)``. Para esto primero se incrementa el
+contador de referencias de ``h5`` para evitar confundirlo accidentalmente
+con *basura* (figura :vref:`fig:gc-rc-up-1`). Luego se procede
+a decrementar el contador de ``h2`` que queda en 0 (transformándose en
+*basura*) y lo mismo pasa cuando se desciende a ``h4`` (figura
+:vref:`fig:gc-rc-up-2`). Finalmente se decrementa el contador de ``h5``
+pero como esta celda va a ser apuntada por ``h3`` (por la operación que
+está ejecutándose) sobrevive y permanece en el *live set*. Finalmente se
+termina de actualizar la referencia ``h3.left`` para que apunte a ``h5``
+(figura :vref:`fig:gc-rc-up-3`).
+
+
+.. fig:: fig:gc-rc-up-1
+
+ TODO Eliminación de la referencia ``r0`` :math:`\to` ``h1`` (parte 1).
+
+ .. subfig::
+
+ TODO
+
+ .. digraph:: g4_1
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ subgraph marked {
+ node [ fillcolor = white, fontcolor = black ];
+ h1;
+ };
+
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h2 [ label = "h2\n1|<l> left|<r> right" ];
+ h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
+ h4 [ label = "h4\n1|<l> left|<r> right" ];
+ h5 [ label = "h5\n1|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = invis ];
+ h1:l -> h2 [ style = invis ];
+ h1:r -> h3 [ style = invis ];
+ root:r1 -> h3;
+ h2:l -> h4;
+ h2:r -> h5;
+ h3:l -> h2 [ style = bold, color = black ];
+ h3:r -> h6;
+
+ }
+
+ .. subfig::
+
+ TODO
+
+ .. digraph:: g4_2
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ subgraph marked {
+ node [ fillcolor = white, fontcolor = black ];
+ h1;
+ };
+
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h2 [ label = "h2\n1|<l> left|<r> right" ];
+ h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
+ h4 [ label = "h4\n1|<l> left|<r> right" ];
+ h5 [ label = "h5\n2|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = invis ];
+ h1:l -> h2 [ style = invis ];
+ h1:r -> h3 [ style = invis ];
+ root:r1 -> h3;
+ h2:l -> h4;
+ h2:r -> h5;
+ h3:l -> h2 [ style = bold, color = black ];
+ h3:l -> h5 [ style = dotted, color = black ];
+ h3:r -> h6;
+
+ }
+
+.. fig:: fig:gc-rc-up-2
+
+ TODO Eliminación de la referencia ``r0`` :math:`\to` ``h1`` (parte 2).
+
+ .. subfig::
+
+ TODO
+
+ .. digraph:: g4_3
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ subgraph marked {
+ node [ fillcolor = white, fontcolor = black ];
+ h1; h2;
+ };
+
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h2 [ label = "h2\n0|<l> left|<r> right" ];
+ h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
+ h4 [ label = "h4\n1|<l> left|<r> right" ];
+ h5 [ label = "h5\n2|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = invis ];
+ h1:l -> h2 [ style = invis ];
+ h1:r -> h3 [ style = invis ];
+ root:r1 -> h3;
+ h2:l -> h4 [ style = bold, color = black ];
+ h2:r -> h5;
+ h3:l -> h2 [ style = invis ];
+ h3:l -> h5 [ style = dotted, color = black ];
+ h3:r -> h6;
+
+ }
+
+ .. subfig::
+
+ TODO
+
+ .. digraph:: g4_4
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ subgraph marked {
+ node [ fillcolor = white, fontcolor = black ];
+ h1; h2; h4;
+ };
+
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h2 [ label = "h2\n0|<l> left|<r> right" ];
+ h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
+ h4 [ label = "h4\n0|<l> left|<r> right" ];
+ h5 [ label = "h5\n2|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = invis ];
+ h1:l -> h2 [ style = invis ];
+ h1:r -> h3 [ style = invis ];
+ root:r1 -> h3;
+ h2:l -> h4 [ style = invis ];
+ h2:r -> h5 [ style = bold, color = black ];
+ h3:l -> h2 [ style = invis ];
+ h3:l -> h5 [ style = dotted, color = black ];
+ h3:r -> h6;
+
+ }
+
+.. fig:: fig:gc-rc-up-3
+
+ TODO Eliminación de la referencia ``r0`` :math:`\to` ``h1`` (parte 3).
+
+ .. subfig::
+
+ TODO
+
+ .. digraph:: g4_5
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ subgraph marked {
+ node [ fillcolor = white, fontcolor = black ];
+ h1; h2; h4;
+ };
+
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h2 [ label = "h2\n0|<l> left|<r> right" ];
+ h3 [ label = "h3\n1|<l> left\n*|<r> right" ];
+ h4 [ label = "h4\n0|<l> left|<r> right" ];
+ h5 [ label = "h5\n1|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = invis ];
+ h1:l -> h2 [ style = invis ];
+ h1:r -> h3 [ style = invis ];
+ root:r1 -> h3;
+ h2:l -> h4 [ style = invis ];
+ h2:r -> h5 [ style = invis ];
+ h3:l -> h5 [ style = bold, color = black ];
+ h3:l -> h2 [ style = invis ];
+ h3:r -> h6;
+
+ }
+
+ .. subfig::
+
+ TODO
+
+ .. digraph:: g4_6
+
+ margin = 0;
+ ratio = fill;
+ size = "3.0,3.8";
+ edge [ color = gray40 ];
+ node [
+ shape = record,
+ width = 0,
+ height = 0,
+ style = filled,
+ fillcolor = gray25,
+ fontcolor = white
+ ];
+
+ subgraph cluster_all {
+
+ root [
+ label = "root\nset|<r0> r0|<r1> r1",
+ style = filled,
+ fillcolor = gray96,
+ fontcolor = black,
+ ];
+
+ subgraph marked {
+ node [ fillcolor = white, fontcolor = black ];
+ h1; h2; h4;
+ };
+
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h1 [ label = "h1\n0|<l> left|<r> right" ];
+ h2 [ label = "h2\n0|<l> left|<r> right" ];
+ h3 [ label = "h3\n1|<l> left|<r> right" ];
+ h4 [ label = "h4\n0|<l> left|<r> right" ];
+ h5 [ label = "h5\n1|<l> left|<r> right" ];
+ h6 [ label = "h6\n1|<l> left|<r> right" ];
+
+ root:r0 -> h1 [ style = invis ];
+ h1:l -> h2 [ style = invis ];
+ h1:r -> h3 [ style = invis ];
+ root:r1 -> h3;
+ h2:l -> h4 [ style = invis ];
+ h2:r -> h5 [ style = invis ];
+ h3:l -> h5;
+ h3:l -> h2 [ style = invis ];
+ h3:r -> h6;
+
+ }
+