# Merging Discrete Morse Vector Fields: A Case of Stubborn Geometric Parallelization
## 5 Generalization to a Hierarchical Tree-like Decomposition
We also define the subsets \(J(v,l)=J(v)\cap B(v,l)\) for a positive number \(l\), and the differences \(J(v;l_{1},l_{2})=J(v,l_{2})\setminus B(v,l_{1})\setminus S(v,l_{1})\), for \(l_{2}>l_{1}>0\)._  
Given a number \(r\) greater than \(1\), consider the collection of open subsets of \(T\) consisting of the ball \(B(v_{0},2r)\) and the differences \(J(v;r-1,3r)\) where the vertices \(v\) vary over \(S(v_{0},(2n-1)r)\) for arbitrary natural numbers \(n\). It is easy to see the following properties. 1. This collection of subsets \(\mathcal{V}\) is a covering of \(T\). Its nerve is itself, in general, a forest of trees where the vertices can be indexed by \(v_{0}\) and the vertices \(v\in S(v_{0},(2n-1)r)\). The edges are the pairs \((v,v^{\prime})\) where \(v^{\prime}\in J(v,2(n+1)r)\). 2. The diameter of each set in the covering is bounded by \(6r\). 3. The covering has a margin of at least \(r\) in the sense that the \(r\)-enlargement is again a tree that is isomorphic to the one in (1). Clearly, intersecting any subset \(X\) of \(T\) with the produced covering gives a covering of \(X\) with exactly the same three properties, except possibly a forest of trees instead of a single tree. This gives a hierarchical tree-like decomposition of \(X\) with margin \(r\) and depth \(1\). ```
Inputs:
* \(D\) digital image pixels
* \(g\) grayscale values on pixels

Outputs:
* \(C\) critical cells
* \(V\) discrete vector field

Constraint:
* Memory\(=N\) Pixels for all\(i\) and \(j\)do  Apply ProcessLowerStars algorithm to each of the following to obtain:
* \(P_{i,j}\to V_{i,j}\)
* \(P_{i,j}\cap P_{i+1,j}\to V^{i+1}_{i,j}\)
* \(P_{i,j}\cap P_{i,j+1}\to V^{i+1}_{i,j}\)
* \((P_{i,j}\cap P_{i,j+1})\cap(P_{i+1,j}\cap P_{i+1,j+1})\to V^{\cap}_{i,j}\)
* \(P^{*}_{i,j}[1,0]\cap P_{i+1,j}[1,0]\to V^{i+1}_{i,j}[1,0]\)
* \((P_{i,j}\cap P_{i,j+1})^{*}[1,0]\cap(P_{i+1,j}\cap P_{i+1,j+1})[1,0]\to V^{ \cap}_{i,j}[1,0]\)
* \(P_{i,j}[0,1]\cap P_{i,j+1}[0,1]\to V^{\cap}_{i,j}[0,1]\)
* \((P_{i,j}[0,1]\cap P_{i,j+1}[0,1])\cap(P_{i+1,j}[0,1]\cap P_{i+1,j+1}[0,1]) \to V^{\cap}_{i,j}[0,1]\)
* \((P_{i,j}[0,1]\cap P_{i,j+1}[0,1])^{*}[1,0]\cap(P_{i+1,j}[0,1]\cap P_{i+1,j+1 }[0,1])[1,0]\to V^{\cap}_{i,j}[1,1]\) # Preprocessing Step to obtain discrete vector field in all patches and their overlaps endfor for\(j=1,\cdots,\ell\)do for\(i=1,\cdots,m-1\)do  Update:\(V^{i+1}_{i+1,j}=(V^{i+1}_{i,j}\cup V^{i+1}_{i+1,j})\setminus(V^{\cap}_{i,j} \setminus V^{i+1}_{i,j}[1,0])\) # Moving horizontally along string endfor for\(j=1,\cdots,\ell\)do for\(i=1,\cdots,m-1\)do  Update:\((V^{i+1}_{i,j}[0,1])^{\prime}=((V^{i+1}_{i,j}[0,1])^{\prime}\cup V^{i+1}_{i+1,j }[0,1])\setminus(V^{\cap}_{i,j}[1,0]\setminus V^{\cap}_{i,j}[1,1])\) # Moving horizontally along intersection of strips endfor endfor for\(j=1,\cdots,\ell\)do for\(i=1,\cdots,m-1\)do  Update:\((V^{i+1}_{i,j}[0,1])^{\prime}=((V^{i+1}_{i,j}[0,1])^{\prime}\cup V^{i+1}_{i+1,j}[0,1])\setminus(V^{\cap}_{i,j}[1,0]\setminus V^{\cap}_{i,j}[1,1])\) # Moving horizontally along intersection of strips enlarged by \(1\) vertically endfor endfor for\(j=1,\cdots,\ell-1\)do  Update:\(V^{\prime}_{j+1}=(V^{\prime}_{m,j}\cup V^{\prime}_{m,j+1})\setminus((V^{j+1 }_{m,j})^{\prime}\setminus(V^{i+1}_{m,j}[0,1])^{\prime})\) # Moving vertically down strips endfor
```  
**Algorithm 2** Distributed ProcessLowerStars on a 2D digital image. Figure 3 is used to illustrate this notation. In this figure, \(v_{0}\) is the root of the tree. Notice that the vertices labeled \(a_{1}\), \(a_{2}\), \(a_{3}\) are all at distance \(3\) from \(v_{0}\). The blue, the orange, and the red subsets can be described as the jet subsets \(J(a_{i},1,4)\) for \(1\leq i\leq 3\). They overlap with the green subset which itself can be described as the jet subset \(J(b_{1},1,4)\). Notice that the  
bi-colored edges represent the overlaps between the different colored subsets. This should illustrate the pattern of jet-generated covering sets and their overlaps in the whole tree.