It may not immediately be clear from the labeling, but the order in which the labels are assigned begins with 0 at the `root', and the rest proceed in the order shown in Figure 3.
Knowing that vertices in the special tree will be placed in the adjacency
matrix in this way allows us to define a simple procedure
to assign each vertex a label in such that a way that the special
tree has a graceful labeling after all assignments have been made. This
labeling algorithm is efficient in that the labeling it produces is
graceful, and no `backtracking' or trial and error is necessary. We
call this procedure
which will assign
the labels of vertices
such that a tree with such
vertices created by
is gracefully labeled.
In this algorithm, for simplification of indexing, we actually assign the labels to a matrix representing the vertices in the `grid' that appears in the graphical representation of the tree. For instance, in Figure 3, the label matrix would end as