Skip to main content
. Author manuscript; available in PMC: 2011 Jul 11.
Published in final edited form as: Conf Comput Vis Pattern Recognit Workshops. 2010 Jun 13:178–185. doi: 10.1109/CVPRW.2010.5543593
Algorithm 1: Rooted Minimum Spanning Tree
input : Inline graphic = v[N], λ′, D = d[N][N], nr//index of root
output : Pre [N]/*The index of the parent node of v[n], equivalent to ℰ */
begin
 /*For simplicity, set ri = 1 in (8) */
 /*Vertex in tree */
Inline graphic = {v[nr]};
for v[n] ∈ Inline graphicInline graphic do
  /*distance from the tree */
  dtree[n] = d[nr] [n];
  /*distance from the root */
  droot [n] = 1λ d[nr] [n];
  Pre[n] = nr;
while Inline graphicInline graphic do
  m = minv[n]∈ Inline graphicInline graphic droot[n];
   Inline graphic = Inline graphicv[m];
  droot [m] = droot[Pre[m]] + 1λ dtree [m];
  for v[n] ∈ Inline graphicInline graphic do
   if droot[n] > d[m] [n] + droot[m] then
    dtree [n] = d[m] [n];
    droot [n] = d[m][n] + droot[m];
    Pre[n] = m;
end