Manuscript Offprint
arXiv:2610.29184Optimal Labeling Schemes for -Free Matrices
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Optimal Labeling Schemes for -Free Matrices
Sankardeep Chakraborty
The University of Tokyo
Tokyo, Japan
sankardeep.chakraborty@gmail.com
Seungbum Jo
Chungnam National University
Daejeon, Republic of Korea
Abstract
We study labeling schemes for -free binary matrices, which do not contain a submatrix of the form . We give a labeling scheme that uses -bit labels for rows and columns, where , such that any matrix entry can be determined from the corresponding two labels in constant time in the word RAM model. The worst-case label size matches the counting lower bound up to constant factors. We also show that the entrywise least -free supermatrix of an arbitrary binary matrix, together with its labels, can be constructed in time.
Our construction represents a -free matrix by a sequence of rooted forests, where each column corresponds to a node and the 1-entries of each row form a root path in its corresponding forest. For -vertex strongly chordal and chordal bipartite graphs, our result gives asymptotically optimal -bit adjacency labeling schemes with constant-time queries. These results answer both representation questions posed by Spinrad in 1995.
An adjacency labeling scheme assigns a binary label to each vertex of a graph such that the adjacency of two vertices can be determined using only their labels [KNR92]. The number of labeled -vertex graphs in a class gives an information-theoretic lower bound on the label size, but a matching upper bound does not necessarily exist. For example, Hatami and Hatami [HH22] showed that some hereditary graph classes (closed under taking induced subgraphs) with labeled graphs require -bit labels. More recently, Bonnet, Duron, Sylvester, Zamaraev, and Zhukovskii [BDS24] showed that some monotone graph classes (closed under taking subgraphs) with labeled graphs require -bit labels. We refer to Section 11 for a more detailed discussion of previous results on adjacency labeling schemes.
Spinrad [Spi95] showed that the number of -free matrices is and gave an asymptotically optimal space representation for these matrices. However, this representation does not provide efficient access to individual matrix entries, nor does it directly yield an adjacency labeling scheme. Spinrad [Spi95, Section 6] also asked whether strongly chordal and chordal bipartite graphs admit -bit representations supporting efficient adjacency queries and -bit adjacency labeling schemes. Dahlhaus [Dah97] studied representations of chordal and strongly chordal graphs and proposed an additional data structure supporting polylogarithmic-time adjacency queries. Otachi, Okamoto, and Yamazaki [OOY07] showed that every -free chordal bipartite graph is a unit grid intersection graph and discussed the connection between grid intersection representations and adjacency labeling for chordal bipartite graphs. However, neither work resolved Spinrad's adjacency-labeling question for the corresponding graph class.
Our results. Our main result is an asymptotically optimal labeling scheme for -free matrices, stated in the following theorem.
Theorem 1.1. Every -free matrix admits row and column labels of bits, where , such that any matrix entry can be determined from the corresponding two labels in time in the word RAM model. The label size is asymptotically optimal in the worst case.
Our construction processes the matrix row by row, updating a forest after each row. The support of each nonempty row forms a root path in the resulting forest. However, an earlier row's support need not remain a root path in the final forest. The main challenge is to encode the forest history within the row and column labels, using only bits per label.
The labeling scheme also gives asymptotically optimal -bit adjacency labels for -vertex strongly chordal and chordal bipartite graphs, supporting constant-time adjacency queries. Notably, these natural graph classes have superfactorial but subquadratic speed , for which matching labeling bounds do not follow from counting alone. Consequently, we answer both representation questions posed by Spinrad [Spi95].
2 Overview of Techniques
In this section, we outline the main ideas behind our labeling scheme. We first describe how a -free matrix can be represented by a sequence of rooted forests, and then explain how a rank-based path decomposition allows us to encode the forest history using short labels.
2.1 Forest representation of -free matrices
We process the rows of a -free matrix from top to bottom, maintaining a rooted forest in which each column corresponds to a node. For a rooted forest , let and denote the set of ancestors and descendants of a node , respectively, both including . Two nodes are said to be comparable if one is an ancestor of the other. We consider forests in which each parent has a larger index than its children. For two forests and on the same nodes, we write if every ancestor relation in is preserved in .
Let denote the forest after processing the first rows, where consists of isolated nodes. For each row , we define its support as . For each nonempty row , let . We aim to construct the forests so that
and they form an ancestor-monotone sequence
The following theorem shows that such a representation exists if and only if the matrix is -free.
Theorem 2.1. A binary matrix is -free if and only if it admits an ancestor-monotone sequence of forests satisfying the above properties.
A brief proof sketch is as follows. For each nonempty row , we arrange the nodes of and their ancestors in into a path in increasing column order, leaving all other parent pointers unchanged. Since is -free, these ancestors already belong to , and all previous ancestor relations are preserved. Conversely, if every nonempty row support is a complete root path in an ancestor-monotone forest sequence, the matrix is -free. The detailed proof is given in Section 4.
We illustrate the construction with the following -free matrix:
The corresponding forest sequence is
where means that is the parent of .
The third row merges the two paths of into a single path in increasing column order, while preserving their ancestor relations. Since , processing the fourth row does not change the forest. Thus, the forest sequence preserves all ancestor relations, and each row support corresponds to a complete root path in , as stated in Theorem 2.1.
Note that the support of the first row is no longer a complete root path in , showing that the final forest alone is insufficient to represent all rows.
2.2 Rank-based path decomposition
To determine whether , we need to check whether . One might consider using persistent data structures [DSST89] to retain the intermediate forests. However, this requires shared access, which is unavailable to a decoder using only two labels. Directly storing parent histories is also too costly: for example, when for , node 1 changes its parent times. Instead, we use a rank-based path decomposition to encode the forest sequence compactly.
For each node in , we define its rank as . An edge is called solid if its endpoints have the same rank, and dashed otherwise. The solid edges form vertex-disjoint paths, called solid paths, including singleton nodes. For two forests , a node is stable if its rank is the same in and . We assign an identifier to each solid path, where distinct solid paths in the same forest have distinct identifiers. We will show that these identifiers can be assigned so that a stable node retains its solid-path identifier across each update.

Figure 1: Solid paths and their identifiers before and after processing the third row of the example matrix in Section 2.1.
In Figure 1, nodes 3 and 5 form a solid path of rank 1 in , with identifier . After processing the third row, node 3 remains at rank 1, and the new solid path consisting of nodes 2 and 3 inherits the identifier . The solid path consisting of nodes 4 and 5 has rank 2 and is assigned a new identifier .
Although an update may change the solid paths, it does not change whether two stable nodes belong to the same solid path.
Theorem 2.2 (Rank stability). Let , and let be stable nodes of the same rank . Then belong to the same solid path in if and only if they belong to the same solid path in .
We briefly outline the proof. Suppose two stable nodes u and v of rank r belong to different solid paths in but the same solid path in . Then they were incomparable in , so their descendant sets were disjoint, each containing at least nodes. Since they become comparable in , one of them has at least descendants, contradicting its stability. The other direction follows from the preservation of ancestor relations. The formal proof is given in Section 5.
All logarithms are base two throughout the paper.
By Theorem 2.2, we can assign identifiers to solid paths so that a stable node retains the identifier of its solid path. A single update may change parent pointers, but each node changes its rank and solid-path identifier only times over the entire forest history.
Although solid-path decompositions are classical in dynamic-tree data structures [ST83], Theorem 2.2 establishes that nodes retaining their ranks can also retain their solid-path identifiers across ancestor-monotone updates.
2.3 Construction of the labeling scheme
We now describe how to construct the row and column labels using the rank-based path decomposition. For each , we call the timestamp of the forest . For each column , we store a list of triples , called records, where is the timestamp, is the rank of , and is the identifier of the solid path containing in . The first record is stored at timestamp 0, and a new record is added whenever the rank of or the identifier of its solid path changes. By Theorem 2.2, the identifier can change only when the rank increases. Since the rank increases at most times, each column stores records.
For each nonempty row , its support forms a complete root path in . Since the ranks are nondecreasing along a root path, intersects at most one solid path of each rank. Thus, the label of row stores the identifier of each intersected solid path and the smallest node of on that path. Since there are possible ranks, each row stores such pairs.
To answer , we first find the most recent record of column x whose timestamp is at most i. Let r and h be the rank and solid-path identifier stored in this record, respectively. We then check whether the row label stores the same identifier h for rank r, and whether x is at least the smallest node stored for that rank. This determines whether , since the intersection of a root path with a solid path is a suffix of the solid path, whose nodes are ordered by their column indices.
Each column label stores records, and each row label stores pairs of identifiers and boundaries. Since each record or pair requires bits, the total label size is bits. The predecessor search on the column records can be performed in constant time in the word RAM model with multiplication, using an additional data structure stored within the column label without increasing its asymptotic size. Together with the forest representation in Theorem 2.1, this establishes the upper bound of Theorem 1.1. The detailed construction and proof are given in Section 6.
Our forest representation is related to Spinrad's prefix-reachability construction [Spi95]. In particular, each forest is the transitive reduction of the corresponding reachability relation (see Section A.2). However, our labeling scheme uses persistent solid-path identifiers to encode the forest history, allowing each matrix entry to be determined using only two labels.
Organization. After the model in Section 3, Sections 4 to 7 develop the forest representation, prove rank stability, construct the labels, and establish optimality. Sections 8 to 11 cover closure, construction time, applications, and related work. Section A describes the encoder algorithm and the correspondence with Spinrad's construction. Section B gives an example of our labeling scheme, including the forest construction, label assignment, query decoding, and closure computation.
3 Model and Notation
Let be a binary matrix, where , and let . We index the rows and columns by and , respectively, where . Unless otherwise stated, the row and column orders are fixed.
Definition 3.1. A binary matrix M is -free if for every and ,
We next formally define the labeling scheme for binary matrices.
Definition 3.2. A matrix-labeling scheme assigns a binary label to each row and a binary label to each column of a matrix . A fixed decoder , independent of , determines any matrix entry using only the corresponding two labels, such that
The decoder receives the row label first and the column label second, and is not given the matrix dimensions or any other information depending on M. The label size is the maximum length of a row or column label.
We use the word RAM model with word size for a sufficiently large constant , supporting standard word operations, including multiplication, in constant time. Each label is stored as an array of -bit words, and the decoder can access any word of the two given labels in constant time.
For a rooted forest , let and denote the sets of ancestors and descendants of , respectively, both including . Two nodes are comparable if one is an ancestor of the other. For forests and on the same node set, write if every ancestor relation in is preserved in . For each row , let and when . A rooted forest is ordered if every parent has a larger index than its children. A set is upward closed in if implies . A monotone forest representation of consists of ordered forests , where is edgeless and for every nonempty row .
4 Forest Characterization of -Free Matrices
We construct a sequence of forests by processing the rows of M in order, starting with the edgeless forest . For each row i, let consist of the nodes corresponding to and all their ancestors in :
If , set . Otherwise, write . We construct by arranging into a path in this order, with as its root. All nodes outside retain their parent pointers.
Lemma 4.1. For every i, is upward closed in , and the update produces an ordered forest .
Proof. Every node is an ancestor of some in . Thus, all ancestors of also belong to , showing that is upward closed. In , every node has at most one parent, and every parent has a larger index than its child. Hence is an ordered forest.
Lemma 4.2. For every , .
Proof. Consider any parent edge in . If , its parent pointer remains unchanged. Otherwise, by upward closure. Since , the new increasing path on preserves as an ancestor of . Thus, every parent edge in remains an ancestor relation in , implying .
We next show that when is -free.
Lemma 4.3. Suppose is -free. For every , each parent edge of has a witness row such that . Moreover, .
Proof. We prove the claims by induction on , starting with the edgeless forest . For any , choose such that , and consider the path in . Since , we have . For each parent edge , the induction hypothesis gives a witness row with . By the -free property, implies . Thus , proving .
Every newly installed parent edge satisfies , so . Every preserved parent edge has a witness row by the induction hypothesis.
Corollary 4.4. If is -free, then for every row . Moreover, for every nonempty row .
Proof. Since every node is its own ancestor, . The preceding lemma gives , so . For every nonempty row , the update arranges into an increasing path whose maximum is a root. Since , it is the first node of this path. Hence .
The forest sequence preserves ancestor relations and represents each nonempty row as a root path. We now prove Theorem 2.1.
Proof of Theorem 2.1. If is -free, the construction above gives by Theorem 4.2, and for every nonempty row by Theorem 4.4.
Conversely, suppose admits an ancestor-monotone sequence of ordered forests , where consists of isolated nodes and for every nonempty row (i.e., has a monotone forest representation). Let and satisfy
Since and is ordered, is an ancestor of in . Ancestor monotonicity preserves this relation in . Since contains , it also contains . Thus, is -free.
5 Rank Stability and Persistent Identifiers
Consider an ancestor-monotone sequence of rooted forests on nodes. For each node and time , we use the notation
As before, a parent edge is solid if its endpoints have the same rank, and dashed otherwise.
The rank definition ensures that a subtree containing two disjoint rank-r subtrees has rank at least . We first show that ranks are nondecreasing along the forest sequence.
Lemma 5.1. For every node , and are nondecreasing with . Consequently, changes at most times.
Proof. If , then . By ancestor monotonicity, , so . Therefore, and are nondecreasing. Since ranks lie in , each rank changes at most times.
We next consider the structure of solid edges. A child of a node is called a solid child if the edge connecting it to its parent is solid.
Lemma 5.2. Every node in has at most one solid child. Consequently, the solid edges partition into vertex-disjoint paths, including singleton nodes. Every root path intersects at most one solid path of each rank and at most solid paths in total.
Proof. Suppose a node z of rank r has two distinct solid children x and y. Their descendant sets are disjoint, and each contains at least nodes. Therefore,
contradicting . Hence the solid edges form vertex-disjoint paths.
Along any root path, subtree sizes and thus ranks are nondecreasing. Therefore, nodes of the same rank form a contiguous segment belonging to one solid path. Since ranks lie in , every root path intersects at most solid paths.
We next characterize solid paths in terms of comparability and rank.
Lemma 5.3. Two nodes in lie on the same solid path if and only if they are comparable and have the same rank.
Proof. Nodes on a solid path are comparable with equal ranks. Conversely, if u is a descendant of v and both have rank r, rank monotonicity along their path forces every intermediate rank to equal r. All its edges are solid.
Before: disjoint descendant sets
After: suppose v is above u

: rank increases
Figure 2: The doubling argument when two previously incomparable rank-r nodes become comparable, where and .
A node is stable across if its rank is unchanged. We now prove Theorem 2.2 using the characterization in Theorem 5.3.
Proof of Theorem 2.2. If stable nodes u, v lie on the same solid path in F, they remain comparable in by ancestor monotonicity. Since their ranks remain r, Theorem 5.3 implies that they lie on the same solid path in .
Conversely, suppose they lie on the same solid path in but not in . By Theorem 5.3, they were incomparable in , so their descendant sets were disjoint. Assume that is an ancestor of in . By ancestor monotonicity, both old descendant sets are contained in , as illustrated in Figure 2. Thus,
contradicting the stability of v.
We assign an identifier to each solid path, and each node carries the identifier of the path containing it. We now show that these identifiers can be maintained so that stable nodes retain theirs across forest updates.
Theorem 5.4 (Persistent solid-path identifiers). The solid paths in can be assigned positive integer identifiers such that distinct paths in each forest have distinct identifiers, and every stable node retains its identifier across a transition. In total, distinct identifiers are used.
Proof. Initially assign distinct identifiers to the solid paths in . Consider a transition from to . If a new solid path contains a stable node, then by Theorem 2.2, all its stable nodes belonged to the same old solid path . Assign the identifier of to . Moreover, all stable nodes of an old solid path remain on the same new solid path, so no two new paths inherit the same identifier.
If a new solid path contains no stable node, assign it a globally fresh identifier. Charge this identifier to any node on the path, whose rank must have increased. By Theorem 5.1, each node can be charged at most L times. Thus, at most qL fresh identifiers are created, in addition to the at most q initial identifiers.
Let denote the identifier of the solid path containing in . Assigning identifiers consecutively ensures that each uses bits. Define the state of at time by
For each node , we define its change list as a list of triples , containing a record at and at every for which . The following corollary bounds the length of each change list in terms of the node's final rank.
Corollary 5.5. The change list of each node contains at most records, and the total number of records is .
Proof. By Theorem 5.4, the state of a node changes only when its rank increases. Since ranks are initially zero and never decrease, the state of changes at most times. Including the initial record proves the first bound, and summing over all nodes gives the second.
6 Row and Column Labels
We now use the change lists from Theorem 5.5 to construct row and column labels for a matrix admitting a monotone forest representation.
Theorem 6.1. Let be a binary matrix admitting a monotone forest representation, and let . Then admits row and column labels of bits such that any entry can be determined from the corresponding two labels in time on the word RAM.
We prove the theorem in the remainder of this section. Although each column's change list contains records, each timestamp may require bits. To avoid this dependence on , let denote the version at time , defined as the number of forest changes up to that time:
Lemma 6.2. For every , we have . Thus, each version can be stored in bits.
Proof. A forest is uniquely determined by its ancestor relations, since the parent of each nonroot node is its lowest proper ancestor. Thus, every strict change in the forest adds at least one new ancestor relation. By ancestor monotonicity, these relations never disappear. Since there are at most such relations, we have .
For each nonempty row , the support is a root path in . By Theorem 5.2, it intersects at most one solid path of each rank. For each rank encountered on , let be the identifier of that solid path and the smallest column index in its intersection with . The row label stores the version and the arrays , indexed by . For ranks absent from , set and . For an empty row, use these default values at every rank.
For each column x, replace every timestamp t in its change list by . The resulting list is
where , the versions are strictly increasing, and is the state of from version until the next record. Since an unchanged forest does not change any state, this replacement preserves the change list. By Theorem 5.5, .
Theorem 6.3 (Exact rank-path membership test). For every row i and column x, let . Then
Proof. If row is empty, all its path identifiers are zero, whereas is positive, so both sides are false. Otherwise, suppose , or equivalently . The row label stores the identifier of the solid path containing at rank . Since is the smallest node of on this path, .
Conversely, if , then and lie on the same solid path in . Since node numbers increase toward the root, places on the suffix of this path contained in . Hence .
Figure 3 illustrates the membership test.
6.1 Label Construction and Binary-Search Decoding
We store each field using bits, where is chosen as a sufficiently large power of two. Since , the constant in from Section 3 can be chosen so that .
A row label for stores , the version , and the entries of each array and . A column label for stores , the index , the number of records in , and three arrays containing their versions, ranks,
Column label: predecessor of

Row label: inspect rank
Accept exactly when and .
Figure 3: The membership test for : the column's active record determines which entries of the row label are inspected.
and identifiers. These arrays are padded to entries. Both labels also store the layout parameters and , which determine the array offsets. Since each column history contains an initial record at version 0, a predecessor exists for every queried version.
Lemma 6.4. The fields of each row or column label require bits in total.
Proof. A label has fields of bits, requiring bits.
By the preceding lemma, the fields occupy bits. Packing them consecutively into -bit words adds at most bits of padding. Thus, each label occupies bits. We now describe a decoder that uses binary search to find and applies Theorem 6.3.
Algorithm 6.5 (Binary-search decoder). Given a row label for and a column label for :
-
Read the column index and the row's version from their respective labels.
-
Binary-search the first entries of column 's version array to find , where is the stored number of records.
-
Read from record .
-
Return 1 iff and .
The binary-search decoder gives the following theorem.
Theorem 6.6. Every binary matrix admitting a monotone forest representation has row and column labels of bits supporting entry queries in time on the word RAM, where .
Proof. The label-size bound follows from Theorem 6.4 and the packing above. For a query , we use binary search on the change list of to find . The membership test of Theorem 6.3 then correctly determines . The list contains at most records, so binary search takes time. All other operations take constant time.
6.2 Constant-Time Decoding
The binary-search decoder spends time finding the state of a column at the queried version. We use the predecessor structure described in the following theorem to replace binary search and obtain constant-time decoding.
Theorem 6.7 (Static fusion-tree predecessor [FW93]). On a word RAM with multiplication and w-bit words, a static set of distinct w-bit keys with associated w-bit values can be stored in words, supporting predecessor queries in worst-case time.
We now complete the proof of Theorem 6.1.
Proof of Theorem 6.1. For each column , we build a predecessor structure on the version numbers in its change list . By Theorem 5.5, the number of records satisfies . The version numbers and their associated rank-identifier pairs fit in bits, where is chosen sufficiently large.
We apply Theorem 6.7 with word size b. The resulting predecessor structure occupies b-bit words and supports predecessor queries in
time. We store the structure, including its auxiliary information, entirely in the column label. Its space usage is bits.
Since , operations on b-bit words, including multiplication, can be simulated in constant time on our word RAM. Packing these words into w-bit words adds bits per label. Thus, the total label size remains bits.
Replacing binary search in Algorithm 6.5 with predecessor search retrieves in constant time. The remaining steps take constant time and are correct by Theorem 6.3.
Section B gives a complete example of the forest construction, label assignment, and decoding.
7 Information-Theoretic Optimality
By Theorems 2.1 and 6.1, every -free matrix admits -bit labels with constant-time decoding. We now prove the matching lower bound and obtain an optimal centralized representation.
Theorem 7.1 (Spinrad [Spi95]). Let denote the number of -free binary matrices with fixed row and column orders. Then
Lemma 7.2. Let be a family of binary matrices on the fixed row and column sets [p] and [q], where . If a fixed decoder represents every matrix in using labels of at most b bits, then
Proof. There are fewer than binary strings of length at most , so there are fewer than possible assignments of labels to the objects. Since the decoder is fixed, each assignment represents at most one matrix. Taking logarithms gives the bound.
Theorem 7.3. For , the worst-case maximum label length over all -free matrices is .
Proof. The upper bound follows from Theorems 2.1 and 6.1. For , Theorem 7.1 gives distinct -free matrices. By Theorem 7.2, some label must have length . For odd , the bound follows by adding an all-zero row.
This completes the proof of Theorem 1.1. For fixed dimensions , let . Padding an -free matrix with zero rows or columns preserves -freeness. Since the labels of the original rows and columns determine the matrix, the counting argument also gives an lower bound on the worst-case maximum label length.
A centralized representation of M is a data structure that supports entry queries given the row and column indices i and x. Such a representation is obtained from Theorem 6.1 by storing all row and column labels together.
Corollary 7.4 (Optimal centralized representation). For , every -free matrix admits an -bit centralized representation supporting entry queries in time on the word RAM. This space bound is asymptotically optimal in the worst case as a function of .
Proof. For the centralized representation, we simply store the row and column labels from Theorems 2.1 and 6.1 in fixed-size blocks. For a query , we read the corresponding two labels and run the decoder. The total space is bits, and each query takes constant time.
By Theorem 7.1, there are distinct -free matrices. A centralized representation must distinguish these matrices and therefore requires bits in the worst case.
8 Computing the -Free Closure
By Theorems 4.1 and 4.2, the forest construction in Section 4 produces an ancestor-monotone sequence of ordered forests even when the input matrix is not -free. For an arbitrary binary matrix , let and apply the same construction, obtaining forests and sets
Define the output matrix by
For two matrices and of the same dimensions, write if for every entry . Since , we have , but equality need not hold.
Let denote the -free closure of , defined as its entrywise least -free supermatrix. Such a matrix exists because the all-one matrix is -free and -free matrices are closed under entrywise intersection.
To show that , we first prove that is contained in every -free supermatrix of .
Lemma 8.1. Let be an arbitrary binary matrix, and let be any -free matrix. For every , each parent edge of has a witness row such that . Moreover,
Proof. We extend the induction in Theorem 4.3 to an arbitrary input matrix and a -free supermatrix . We prove both claims by induction on , starting with the edgeless forest .
For any , choose such that , and consider the path in . Since and , we have . For each parent edge , the induction hypothesis gives a witness row with . By the -free property of , implies . Thus , proving the containment.
Every newly installed parent edge satisfies , so . Thus, row witnesses every newly installed edge, while preserved parent edges retain their witnesses by the induction hypothesis.
By Theorem 8.1, every entry of is present in every -free supermatrix of . We now show that itself is such a supermatrix.
Theorem 8.2 (Canonical forest closure). For every binary matrix , the forest construction produces in time. In particular, is -free if and only if .
Proof. By Theorems 4.1 and 4.2, the forests form an ancestor-monotone sequence. For each nonempty , the construction arranges its nodes into an increasing root path in . Thus, admits a monotone forest representation and is -free by Theorem 2.1.
Since for every , we have . Moreover, Theorem 8.1 gives for every -free supermatrix of . Hence is the entrywise least -free supermatrix of , so .
The equivalence follows from and the -freeness of . The time bounds follow from the construction analysis in Section 9.
An example of the closure computation is given in Section B.6. By Theorem 6.1, the closure also gives -bit row and column labels with constant-time decoding.
9 Construction Time
We analyze the time required to construct the canonical forest and the labels of Theorem 6.1. The forest construction also computes the -free closure of an arbitrary binary matrix, as established in Theorem 8.2.
Theorem 9.1. Given a binary matrix with fixed row and column orders, its -free closure and -bit row and column labels can be constructed in time, where and . The labels support entry queries in time on the word RAM.
Proof. Since is symmetric, taking the transpose preserves -freeness and commutes with -free closure. We may therefore orient the input so that it has rows and columns. We store one orientation bit in each label indicating whether the input was transposed. If so, the decoder exchanges the roles of the two input labels before applying the matrix decoder.
For each row , let be its support. To compute , traverse the ancestor paths of nodes in in , marking visited nodes with the current row timestamp and stopping each traversal at the first marked vertex. Each node is visited at most once during the row, so is found in time. Scanning the column order then installs as an increasing root path.
After each update, subtree sizes, ranks, and solid paths can be recomputed in time. We assign identifiers as in Theorem 5.4, update column histories, and record the row snapshot. Thus, the forest construction and label maintenance take time. Serializing the labels also takes time, since each label contains fields.
To obtain constant-time decoding, we build a fusion tree for the version keys of each column history, as in Theorem 6.7. We use as the word size for these structures, as in Section 6. By Theorem 5.5, each history has keys, so the branching factor gives a constant-height tree. A fusion-tree node with keys can be constructed deterministically in time [FW93]. Hence, each predecessor structure can be constructed in time, including its auxiliary information. The total construction time for all structures is . The label-size bound and constant-time decoding follow from Theorem 6.1.
See Section A for the detailed construction algorithm.
10 Applications
We apply our labeling scheme to graph and hypergraph classes whose associated matrices admit -free orderings. These orderings are needed to construct the labels, but not to answer queries. The corresponding centralized representations follow by concatenating the labels, as in Theorem 7.4.
10.1 Totally Balanced Matrices
A cycle matrix of order is a matrix whose ones, after row and column permutations, occur exactly at and , with column indices taken modulo . A binary matrix is totally balanced if it contains no such submatrix.
Theorem 10.1 (Anstee–Farber [AF84]). A binary matrix is totally balanced if and only if its rows and columns can be permuted independently to make it -free.
Corollary 10.2. Every totally balanced matrix admits -bit row and column labels supporting entry queries in time on the word RAM, where . The labels can be constructed in time.
Proof. Permute the rows and columns as in Theorem 10.1 and apply Theorem 1.1 to the resulting -free matrix. Assign the resulting labels to the corresponding rows and columns of the original matrix. A doubly lexical ordering of a matrix can be computed in time [Spi93], and every such ordering of a totally balanced matrix is -free [Lub87]. The construction time then follows from Theorem 9.1.
10.2 Chordal Bipartite Graphs
For a bipartite graph , its biadjacency matrix has entry equal to one exactly when . The graph is chordal bipartite if it has no induced cycle of length at least six.
Theorem 10.3 (Golumbic–Goss [GG78]; Anstee–Farber [AF84]). A bipartite graph is chordal bipartite if and only if the rows and columns of its biadjacency matrix can be permuted independently to make it -free.
Corollary 10.4. Every n-vertex chordal bipartite graph admits -bit adjacency labels supporting adjacency queries in time on the word RAM. The labels can be constructed in time. This label-size bound is asymptotically optimal in the worst case.
Proof. Choose the vertex orders as in Theorem 10.3 and apply Theorem 1.1 to the biadjacency matrix. For each vertex, we store its corresponding row or column label and one bit indicating its side of the bipartition. If the queried vertices belong to the same side of the bipartition, we return zero; otherwise, we use the matrix decoder. By Theorem 10.2 and Theorem 9.1, the labels can be constructed in time.
For the lower bound, fix a bipartition into two sets of labeled vertices. Every -free matrix defines a chordal bipartite graph on these vertices, and different matrices define different graphs. By Theorem 7.1 and Theorem 7.2, the worst-case label length is .
10.3 Strongly Chordal Graphs and Digraphs
A graph is chordal if it has no induced cycle of length at least four. A chord joins two nonconsecutive cycle vertices. A graph is strongly chordal if it is chordal and every even cycle of length at least six has a chord joining vertices at odd distance along that cycle [Far83]. For a simple graph , let be the closed-neighborhood matrix: its entry is one exactly when or .
Theorem 10.5 (Farber [Far83]). A simple graph G is strongly chordal if and only if some vertex order, used for both rows and columns, makes -free.
Corollary 10.6. Every n-vertex strongly chordal graph admits -bit adjacency labels supporting adjacency queries in time on the word RAM. The labels can be constructed in time. This label-size bound is asymptotically optimal in the worst case.
Proof. Order the vertices as in Theorem 10.5 and apply Theorem 1.1 to . For each vertex, we store its row and column labels and its index in the ordering. To answer an adjacency query , we first compare their indices. If they are equal, return zero; otherwise, decode using the row label of u and the column label of v.
The vertex ordering can be computed in time [Spi93], and Theorem 9.1 constructs the labels in time.
There are labeled strongly chordal graphs [Spi95]. By the counting argument of Theorem 7.2, some vertex label must therefore use bits.
Strongly chordal split graphs. A graph is split if its vertices can be partitioned into a clique and an independent set.
Corollary 10.7. Every n-vertex strongly chordal split graph admits -bit adjacency labels supporting queries in time on the word RAM. The labels can be constructed in time. This label-size bound is asymptotically optimal in the worst case.
Proof. The upper bound and construction time follow from Theorem 10.6. For the lower bound, let A be an -free matrix. Construct a split graph with an independent set Y and a clique X, each of size m, where the edges between X and Y are specified by A. Ordering Y before X, its closed-neighborhood matrix is
where and are the identity and all-one matrices, respectively.
Since is symmetric, is also -free. We show that this matrix is -free. Consider a candidate forbidden pattern on rows and columns . If both rows belong to , the first selected column must belong to , so the pattern would lie in . If both rows belong to , either , making the lower-right entry one, or both columns belong to , where the pattern would lie in . If and , either , again making the lower-right entry one, or both columns belong to , where the upper row has at most one nonzero entry. Thus, the constructed graph is strongly chordal by Theorem 10.5. Since can be recovered from its cross edges, Theorem 7.1 and Theorem 7.2 give the matching lower bound.
Strongly chordal digraphs. Hell, Hernández-Cruz, Huang, and Lin [HHCHL19] define a digraph (loops allowed) to be strongly chordal if some vertex order, used for both rows and columns, makes its adjacency matrix -free.
Corollary 10.8. Every n-vertex strongly chordal digraph admits -bit vertex labels supporting arc queries in time on the word RAM. Given a -free vertex ordering, the labels can be constructed in time. This label-size bound is asymptotically optimal in the worst case, even for loopless acyclic two-layer digraphs.
Proof. For the upper bound, apply Theorem 1.1 to the adjacency matrix in a -free order. Each vertex stores both its row and column labels, and a query uses the row label of u and the column label of v. The construction time follows from Theorem 9.1.
For the lower bound, let A be an -free matrix and consider
The matrix is -free, since any forbidden pattern would have to lie entirely in . It is the adjacency matrix of a loopless acyclic two-layer digraph, and can be recovered from . By Theorem 7.1 and Theorem 7.2, the matching lower bound follows.
10.4 -Acyclic Hypergraphs
A finite hypergraph consists of vertices and a family of subsets of . Its incidence matrix has one row per hyperedge and one column per vertex, with entry equal to one exactly when . A hypergraph is -acyclic if and only if its incidence matrix is totally balanced [Fag83]. A hypergraph is simple if it has no repeated hyperedges.
Corollary 10.9. Every -acyclic hypergraph admits -bit incidence labels supporting incidence queries in time on the word RAM, where . The labels can be constructed in time. This label-size bound is asymptotically optimal in the worst case, even for simple hypergraphs with nonempty hyperedges.
Proof. The upper bound and construction time follow by applying Theorem 10.2 to the incidence matrix.
For the lower bound, consider an -free matrix and construct . The matrix is -free, since any forbidden pattern would have to lie entirely in . Moreover, its rows are nonempty and pairwise distinct, and can be recovered from . Thus, by Theorem 7.1, there are distinct simple -acyclic hypergraphs with hyperedges and vertices. Since , Theorem 7.2 gives the matching lower bound.
11 Related Work
Γ-free matrices and matrix orderings. Forbidden matrix patterns are used to characterize strongly chordal graphs [Far83], totally balanced matrices [AF84], chordal bipartite graphs [GG78], and β-acyclic hypergraphs [Fag83]. Related work on matrix orderings includes Lubiw's study of doubly lexical orderings [Lub87] and the work of Hell, Hernández-Cruz, Huang, and Lin [HHCHL19, HHCHL21] on strong chordality in graphs and digraphs through Γ-free orderings.
As discussed in Section 1, Spinrad [Spi95] established the counting bound for -free matrices and gave an asymptotically optimal global representation. However, his representation does not provide efficient access to individual matrix entries. Dahlhaus [Dah97] studied compact representations of chordal and strongly chordal graphs specified by ordered graphs with n vertices and m edges, using words, and proposed an auxiliary data structure supporting adjacency queries in polylogarithmic time. Otachi, Okamoto, and Yamazaki [OOY07] showed that every -free chordal bipartite graph is a unit grid intersection graph and asked whether all chordal bipartite graphs are grid intersection graphs. Chandran, Francis, and Mathew [CFM11] answered this negatively by showing that chordal bipartite graphs have unbounded boxicity.
Adjacency labeling and counting bounds. Kannan, Naor, and Rudich [KNR92] studied implicit graph representations and their connection to induced-universal graphs; see also the survey of Gavoille and Peleg [GP03]. An induced-universal graph for a class contains every graph in the class as an induced subgraph. Such a graph with U vertices gives adjacency labels of bits, although this does not necessarily imply efficient decoding.
For general -vertex graphs, Alon [Alo17] constructed asymptotically optimal induced-universal graphs with vertices, while Alstrup, Kaplan, Thorup, and Zwick [AKTZ19] obtained -bit adjacency labels. For restricted graph classes, stronger bounds are known. Alstrup, Dahlgaard, and Knudsen [ADK17] obtained -bit adjacency labels for forests, equivalently giving induced-universal graphs with vertices. Alon and Nenadov [AN19] constructed induced-universal graphs with vertices for graphs of maximum degree at most any fixed .
The number of labeled graphs in a hereditary class as a function of , called its speed, has been studied by Scheinerman and Zito [SZ94] and Balogh, Bollobás, and Weinreich [BBW00]. Atminas et al. [ACLZ15] investigated implicit representations of graph classes with factorial speed. For general hereditary classes, Bonamy, Esperet, Groenland, and Scott [BEGS21] showed that every hereditary graph class admits labels of bits, where and denotes the set of its -vertex graphs up to isomorphism. For strongly chordal and chordal bipartite graphs, . However, the additional term prevents this bound from establishing -bit labels.
As discussed in Section 1, counting bounds alone do not always give matching labeling schemes. Hatami and Hatami [HH22] constructed hereditary classes with labeled graphs that require -bit labels. Bonnet, Duron, Sylvester, Zamaraev, and Zhukovskii [BDS 24] established a logarithmic separation between counting bounds and label sizes for certain monotone graph classes. For hereditary classes with at most labeled n-vertex graphs, Bonnet, Duron, Sylvester, and Zamaraev [BDSZ25] obtained polylogarithmic adjacency labels.
Structural approaches to adjacency labeling. Gavoille and Labourel [GL07] gave -bit labels for graphs of bounded treewidth. For planar graphs, Bonamy, Gavoille, and Pilipczuk [BGP22] obtained -bit labels using graph product structure, subsequently improved to bits [DEG 21]. The latter bound has recently been extended to all fixed proper minor-closed graph classes [DGJ 26]. Strongly chordal graphs contain all cliques, while chordal bipartite graphs contain all complete bipartite graphs. Thus, neither class has bounded treewidth or belongs to a fixed proper minor-closed class.
Ancestry labeling, dynamic trees, and persistence. Ancestry labeling for static rooted trees has been studied extensively [AAK 06]. Fraigniaud and Korman [FK16] obtained -bit ancestry labels with constant-time decoding. Korman, Peleg, and Rodeh [KPR04] studied labeling in dynamic trees, while Cohen, Kaplan, and Milo [CKM10] considered online ancestry labeling with immutable labels.
Solid-path decompositions are classical in dynamic-tree data structures [ST83], while persistence allows access to earlier versions of shared data structures [DSST89].
12 Conclusion and Further Directions
We have shown that -free matrices admit asymptotically optimal row and column labels supporting constant-time entry queries. The main ingredient is a monotone forest representation whose historical paths can be encoded using persistent path identities.
Succinct representations and navigation. An open question is whether strongly chordal and chordal bipartite graphs admit succinct representations supporting efficient queries beyond adjacency. For either graph class, let denote the logarithm of the number of labeled n-vertex graphs. Can adjacency be supported in bits with constant query time? Another question is whether an -bit representation can support neighbor reporting in time, constant-time distance queries, or shortest-path reporting in time, where is the number of edges in the reported path.
Multiple historical paths. Our forest characterization suggests a parameter for binary matrices based on the number of historical root paths needed to represent each row. For fixed row and column orders, let be the minimum integer for which an ancestor-monotone forest history represents every row as a union of at most complete root paths. By Theorem 2.1, exactly for -free matrices. Minimizing over suitable row and column orders also gives parameters for the corresponding graph classes. It would be interesting to characterize matrices and graphs with small , determine the complexity of computing these parameters, and investigate labeling bounds in terms of .
More generally, it would be interesting to identify other evolving structures in which local identities change only a small number of times, allowing compact labels for historical queries.
AI Methodology
We used ChatGPT Plus (OpenAI, GPT-6) to assist with improving the presentation of the manuscript, preparing illustrative figures and examples, and checking proofs for potential errors. We also used Aristotle (Harmonic) for additional proof checking and Claude (Anthropic) for feedback on manuscript drafts. All research ideas, main techniques, and mathematical proofs were developed by the authors, who also wrote the initial manuscript. The authors independently verified the mathematical results and references and take full responsibility for the content of this paper.
References
[AAK 06] Serge Abiteboul, Stephen Alstrup, Haim Kaplan, Tova Milo, and Theis Rauhe. Compact labeling scheme for ancestor queries. SIAM Journal on Computing, 35(6):1295–1309, 2006. DOI: https://doi.org/10.1137/S0097539703437211.
[ACLZ15] Aistis Atminas, Andrew Collins, Vadim Lozin, and Victor Zamaraev. Implicit representations and factorial properties of graphs. Discrete Mathematics, 338(2):164–179, 2015.
[ADK17] Stephen Alstrup, Søren Dahlgaard, and Mathias Bæk Tejs Knudsen. Optimal induced universal graphs and adjacency labeling for trees. Journal of the ACM, 64(4):27:1–27:22, 2017.
[AF84] Richard P. Anstee and Martin Farber. Characterizations of totally balanced matrices. Journal of Algorithms, 5(2):215–230, 1984. DOI: https://doi.org/10.1016/0196-6774(84)90028-2.
[AKTZ19] Stephen Alstrup, Haim Kaplan, Mikkel Thorup, and Uri Zwick. Adjacency labeling schemes and induced-universal graphs. SIAM Journal on Discrete Mathematics, 33(1):116–137, 2019. DOI: https://doi.org/10.1137/16M1105967.
[Alo17] Noga Alon. Asymptotically optimal induced universal graphs. Geometric and Functional Analysis, 27(1):1–32, 2017.
[AN19] Noga Alon and Rajko Nenadov. Optimal induced universal graphs for bounded-degree graphs. Mathematical Proceedings of the Cambridge Philosophical Society, 166(1):61–74, 2019.
[BBW00] József Balogh, Béla Bollobás, and David Weinreich. The speed of hereditary properties of graphs. Journal of Combinatorial Theory, Series B, 79(2):131–156, 2000.
[BDS+24] Édouard Bonnet, Julien Duron, John Sylvester, Viktor Zamaraev, and Maksim Zhukovskii. Tight bounds on adjacency labels for monotone graph classes. In 51st International Colloquium on Automata, Languages, and Programming (ICALP 2024), volume 297 of LIPIcs, pages 31:1–31:20, 2024. DOI: https://doi.org/10.4230/LIPIcs.ICALP.2024.31.
[BDSZ25] Édouard Bonnet, Julien Duron, John Sylvester, and Viktor Zamaraev. Adjacency labeling schemes for small classes. In 16th Innovations in Theoretical Computer Science Conference (ITCS 2025), volume 325 of LIPIcs, pages 21:1–21:22, 2025. DOI: https://doi.org/10.4230/LIPIcs.ITCS.2025.21.
[BEGS21] Marthe Bonamy, Louis Esperet, Carla Groenland, and Alex Scott. Optimal labelling schemes for adjacency, comparability, and reachability. In 53rd Annual ACM SIGACT Symposium on Theory of Computing (STOC 2021), pages 1109–1117, 2021. DOI: https://doi.org/10.1145/3406325.3451102.
[BGP22] Marthe Bonamy, Cyril Gavoille, and Michał Pilipczuk. Shorter labeling schemes for planar graphs. SIAM Journal on Discrete Mathematics, 36(3):2082–2099, 2022. Preliminary version in SODA 2020; DOI: https://doi.org/10.1137/20M1330464.
[CFM11] L. Sunil Chandran, Mathew C. Francis, and Rogers Mathew. Chordal bipartite graphs with high boxicity. Graphs and Combinatorics, 27(3):353–362, 2011.
[CKM10] Edith Cohen, Haim Kaplan, and Tova Milo. Labeling dynamic XML trees. SIAM Journal on Computing, 39(5):2048–2074, 2010. DOI: https://doi.org/10.1137/070687633.
[Dah97] Elias Dahlhaus. Sequential and parallel algorithms on compactly represented chordal and strongly chordal graphs. In 14th Annual Symposium on Theoretical Aspects of Computer Science (STACS 1997), volume 1200 of Lecture Notes in Computer Science, pages 487–498, 1997. DOI: https://doi.org/10.1007/BFb0023483.
[DEG+21] Vida Dujmović, Louis Esperet, Cyril Gavoille, Gwenaël Joret, Piotr Micek, and Pat Morin. Adjacency labelling for planar graphs (and beyond). Journal of the ACM, 68(6):1–33, 2021. Article 42; Preliminary version in FOCS 2020; DOI: https://doi.org/10.1145/3477542.
[DGJ+26] Vida Dujmović, Cyril Gavoille, Gwenaël Joret, Piotr Micek, Pat Morin, and David R. Wood. Adjacency labelling for proper minor-closed graph classes. arXiv:2605.06616, 2026. DOI: https://doi.org/10.48550/arXiv.2605.06616.
[DSST89] James R. Driscoll, Neil Sarnak, Daniel D. Sleator, and Robert E. Tarjan. Making data structures persistent. Journal of Computer and System Sciences, 38(1):86–124, 1989. DOI: https://doi.org/10.1016/0022-0000(89)90034-2.
[Fag83] Ronald Fagin. Degrees of acyclicity for hypergraphs and relational database schemes. Journal of the ACM, 30(3):514–550, 1983. DOI: https://doi.org/10.1145/2402.322390.
[Far83] Martin Farber. Characterizations of strongly chordal graphs. Discrete Mathematics, 43(2–3):173–189, 1983. DOI: https://doi.org/10.1016/0012-365X(83)90154-1.
[FK16] Pierre Fraigniaud and Amos Korman. An optimal ancestry labeling scheme with applications to XML trees and universal posets. Journal of the ACM, 63(1):1–31, 2016. Article 6; DOI: https://doi.org/10.1145/2794076.
[FW93] Michael L. Fredman and Dan E. Willard. Surpassing the information theoretic bound with fusion trees. Journal of Computer and System Sciences, 47(3):424–436, 1993. DOI: https://doi.org/10.1016/0022-0000(93)90040-4.
[GG78] Martin Charles Golumbic and Clinton F. Goss. Perfect elimination and chordal bipartite graphs. Journal of Graph Theory, 2(2):155–163, 1978. DOI: https://doi.org/10.1002/jgt.3190020209.
[GL07] Cyril Gavoille and Arnaud Labourel. Shorter implicit representation for planar graphs and bounded treewidth graphs. In 15th Annual European Symposium on Algorithms (ESA 2007), volume 4698 of Lecture Notes in Computer Science, pages 582–593, 2007. DOI: https://doi.org/10.1007/978-3-540-75520-3_52.
[GP03] Cyril Gavoille and David Peleg. Compact and localized distributed data structures. Distributed Computing, 16:111–120, 2003. DOI: https://doi.org/10.1007/s00446-002-0073-5.
[HH22] Hamed Hatami and Pooya Hatami. The implicit graph conjecture is false. In 63rd IEEE Annual Symposium on Foundations of Computer Science (FOCS 2022), pages 1134–1137, 2022. DOI: https://doi.org/10.1109/FOCS54457.2022.00109.
[HHCHL19] Pavol Hell, César Hernández-Cruz, Jing Huang, and Jephian C.-H. Lin. Strongly chordal digraphs and -free matrices. arXiv:1909.03597, 2019.
[HHCHL21] Pavol Hell, César Hernández-Cruz, Jing Huang, and Jephian C.-H. Lin. Strong chordality of graphs with possible loops. SIAM Journal on Discrete Mathematics, 35(1):362–375, 2021. DOI: https://doi.org/10.1137/20M1316056.
[KNR92] Sampath Kannan, Moni Naor, and Steven Rudich. Implicit representation of graphs. SIAM Journal on Discrete Mathematics, 5(4):596–603, 1992. DOI: https://doi.org/10.1137/0405049.
[KPR04] Amos Korman, David Peleg, and Yoav Rodeh. Labeling schemes for dynamic tree networks. Theory of Computing Systems, 37(1):49–75, 2004. DOI: https://doi.org/10.1007/s00224-003-1106-6.
[Lub87] Anna Lubiw. Doubly lexical orderings of matrices. SIAM Journal on Computing, 16(5):854–879, 1987. DOI: https://doi.org/10.1137/0216057.
[OOY07] Yota Otachi, Yoshio Okamoto, and Koichi Yamazaki. Relationships between the class of unit grid intersection graphs and other classes of bipartite graphs. Discrete Applied Mathematics, 155(17):2383–2390, 2007.
[Spi93] Jeremy P. Spinrad. Doubly lexical ordering of dense 0–1 matrices. Information Processing Letters, 45(5):229–235, 1993.
[Spi95] Jeremy P. Spinrad. Nonredundant 1's in -free matrices. SIAM Journal on Discrete Mathematics, 8(2):251–257, 1995. DOI: https://doi.org/10.1137/S0895480191197210.
[ST83] Daniel D. Sleator and Robert E. Tarjan. A data structure for dynamic trees. Journal of Computer and System Sciences, 26(3):362–391, 1983. DOI: https://doi.org/10.1016/0022-0000(83)90006-5.
[SZ94] Edward R. Scheinerman and Jennifer S. Zito. On the size of hereditary classes of graphs. Journal of Combinatorial Theory, Series B, 61(1):16–39, 1994.
A Supplementary Construction Details
A.1 Encoder Algorithm
The following algorithm constructs the labels of a -free matrix with fixed row and column orders, using the canonical forest updates of Section 4 and the persistent identifiers of Theorem 5.4.
Algorithm A.1 (Canonical -free encoder). Input: a -free matrix with fixed row and column orders.
-
Initialize as the edgeless forest and assign distinct positive identifiers to its singleton solid paths. Set and, for each column , initialize .
-
For , do the following:
(a) Let and compute
(b) If , replace it by the increasing root path on , preserving every parent edge whose child lies outside . Otherwise, set .
(c) Set
Compute the subtree sizes, ranks, and solid paths of .
(d) Assign identifiers to the solid paths of . A path containing a stable node inherits the identifier of its old solid path, as guaranteed by Theorem 5.4. Assign a fresh identifier to every remaining path.
(e) For each column x, append
to if .
(f) Initialize and for every . If , traverse from toward the root. At the first node of each encountered rank , set
Store with the row snapshot.
- Serialize the row snapshots and column histories using the label format of Section 6. For constant-time decoding, construct the label-local predecessor structure of Theorem 6.7 on the version numbers of each column history.
By Theorem 4.4, each row support is the root path used in Step 2(f). The state records and row snapshots therefore satisfy Theorem 6.3. The construction time is analyzed in Theorem 9.1.
A.2 Relationship to Spinrad's Construction
Spinrad [Spi95] considers a directed graph on the columns induced by their co-occurrence in row prefixes. For each , let be the digraph on containing an arc if and some row contains both and .
Proposition A.2. For every -free matrix and every prefix , the reflexive ancestor relation of equals the reflexive-transitive closure of . Equivalently, is the transitive reduction of the reachability relation of .
Proof. By Theorem 4.3, every parent edge of has a witness row containing both and . Hence every ancestor relation in is a reachability relation in .
Conversely, suppose is an arc of , witnessed by a row . By Theorem 4.4, the support of row is a complete increasing root path in . Since , the node is an ancestor of in . By Theorem 4.2, this relation also holds in .
Thus, the two reflexive-transitive relations coincide. Since a forest is the transitive reduction of its ancestor relation, the proposition follows.
B An Example of the Labeling Scheme
We illustrate the forest construction, the labels, and the entry decoder on one matrix, then compute the -free closure of a modified matrix. The displayed records use the version numbers of Theorem 6.2; we omit fixed-format padding and the predecessor structures of Section 6.2.
B.1 The matrix and its forest history
Consider a matrix with rows and columns, with row supports given by
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ||
|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | {1,3,7} |
| 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | {2,4,8} |
| 3 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | {5,6} |
| 4 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | {1,2,3,4,7,8} |
| 5 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | {3,4,7,8} |
| 6 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | {1,2,3,4,5,6,7,8} |
| 7 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | {4,5,6,7,8} |
| 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ∅ |
| 9 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | {2,3,4,5,6,7,8} |
(B.1)
In the following table, means that is the parent of ; singleton components are omitted. The canonical updates give
| nontrivial components of | ||
|---|---|---|
| none | ||
(B.2)
Rows 1, 2, and 3 create three components. Row 4 merges the first two, and row 6 merges the remaining component into the same path. The supports of rows 5, 7, and 9 are already complete root paths, so these rows do not change the forest; row 8 is empty. For every , the pre-update ancestor union is . The distinct forests are shown in Figure 4. By Theorem 2.1, the matrix is -free.




Rank colours: white 0, blue 1, green 2, orange 3.
Figure 4: The forest history of (B.1). All eight vertices are shown in every panel. Solid arrows join equal ranks; dashed arrows cross ranks. Rows 1, 2, 3 create components, rows 4, 6 merge them, and the remaining rows leave the forest unchanged. The row supports and snapshots are given in (B.2) and (B.6).
B.2 Ranks and path identifiers
Here . Initially, the eight singleton paths have identifiers . At later times, identifiers follow the inheritance rule of Theorem 5.4. The ranks and identifiers, listed in column order, are
| t | ||
|---|---|---|
| 0 | ||
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | ||
| 6 | ||
| 7,8,9 | . |
(B.3)
Identifiers 9, 10, and 11 first appear at times 1, 2, and 3, respectively, and identifiers 12 and 13 at times 4 and 6. An identifier changes only when the node's rank increases. The merges in Figure 5 also show that nodes retaining their ranks keep their identifiers when their solid paths change.
The forest changes only at times 1, 2, 3, 4, 6, so the stored version numbers are
| t | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|---|
| ν(t) | 0 | 1 | 2 | 3 | 4 | 4 | 5 | 5 | 5 | 5 |
(B.4)
The column histories, with unchanged states omitted, are
| x | x | ||
|---|---|---|---|
| 1 | (0,0,1) | 5 | (0,0,5),(5,2,12) |
| 2 | (0,0,2),(4,1,9) | 6 | (0,0,6),(3,1,11),(5,2,12) |
| 3 | (0,0,3),(1,1,9) | 7 | (0,0,7),(1,1,9),(4,2,12) |
| 4 | (0,0,4),(2,1,10),(4,2,12) | 8 | (0,0,8),(2,1,10),(4,2,12),(5,3,13). |
(B.5)
Each triple records a version, rank, and identifier. Column 8, for instance, changes at row times 2, 4, 6, which correspond to stored versions 2, 4, 5. Its four records attain the bound of Theorem 5.5.
Time 3

Time 4

Time 6

Figure 5: The two merges and . Each vertex carries its subtree size , rank , and identifier. Vertex 3 carries identifier 9 into ; vertices 4, 7 carry identifier 12 into . Vertex 8 reaches rank 3 and receives identifier 13.
B.3 Row snapshots
For absent ranks, set and . The row paths give the following arrays, indexed by ranks 0, 1, 2, 3:
| i | ||
|---|---|---|
| 1 | (1,9,0,0) | (1,3,9,9) |
| 2 | (2,10,0,0) | (2,4,9,9) |
| 3 | (5,11,0,0) | (5,6,9,9) |
| 4 | (1,9,12,0) | (1,2,4,9) |
| 5 | (0,9,12,0) | (9,3,4,9) |
| 6 | (1,9,12,13) | (1,2,4,8) |
| 7 | (0,0,12,13) | (9,9,4,8) |
| 8 | (0,0,0,0) | (9,9,9,9) |
| 9 | (0,9,12,13) | (9,2,4,8). |
(B.6)
For example, row 5 has path . Its rank-1 part begins at node 3 of the identifier-9 path , while its rank-2 part is the entire identifier-12 path . Thus , , , and ; the other ranks use sentinels. The boundary matters here: column 2 has the same identifier 9 but is not in row 5.
B.4 Updates and stored records
At time 0, initialize for every . For each row , the table lists the forest update, the column-history appends, and the new row snapshot. The appended records use version from (B.4), not the row index . For example, means that is appended to both column histories. Unlisted histories remain unchanged, and absent ranks use . Each row stores and ; each column stores its index and history, as described in Section 6.
| Forest update and column-history appends | Row snapshot | |
|---|---|---|
| 1 | Create ; other vertices stay isolated.Append . | ( |
| 2 | Create beside the first path.Append . | ( |
| 3 | Create as the third component.Append . | ( |
| 4 | Merge the first two components into ; retain .Append and . | ( |
| 5 | Forest unchanged; select .No column-history append. | ( |
| 6 | Merge into the full chain .Append and . | ( |
| 7 | Forest unchanged; select .No column-history append. | ( |
| 8 | Empty support; forest unchanged.No column-history append. | ( |
| 9 | Forest unchanged; select .No column-history append. | ( |
Table 1: Forest updates, column-history appends, and row snapshots for all nine rows. Each listed record is appended to the corresponding column history.
At the first merge, at time 4, column 3 keeps rank 1 and identifier 9, although its solid path changes from to . It therefore needs no new history record. Only columns 2, 4, 7, and 8 append records, as listed in Table 1. The new row snapshot uses .
At time 5, no column state changes, but row 5 begins at node 3 rather than 2 on the solid path with identifier 9. Its boundary excludes column 2, even though the identifiers match.
At time 6, nodes 4 and 7 retain rank 2 and identifier 12 as nodes 5 and 6 join their solid path. Columns 4 and 7 require no new records; columns 5 and 6 append their new rank-2 states. Column 5 moves directly from rank 0 to rank 2, without a rank-1 record. Column 8 moves to rank 3 and appends its fourth record.
The histories in (B.5) contain eight initial records and twelve appends.
B.5 Entry queries
The following queries use the decoder of Section 6. Figure 6 shows the row-5 label fields and three example queries. For a query , the triple denotes the predecessor record selected at version from (B.4).
Time 5: select a suffix of each visited solid path

Freeze row 5 at version . Its path is .
Rank 1: identifier 9, entry boundary 3.
Rank 2: identifier 12, entry boundary 4.
The unused ranks have sentinels; this row is nonempty.
Read only the two queried labels.
| query | record | ? | ? | answer |
|---|---|---|---|---|
| (5, 2) | (4; 1, 9) | yes | ||
| (5, 3) | (1; 1, 9) | yes | ||
| (5, 7) | (4; 2, 12) | yes |
Column 8: the maximum-length history.
.
At row time , predecessor selects , not the final record.
Each stored change coincides with a rank increase.
Figure 6: From a historical path to label fields and answers. The version selects the active column record, the identifier selects the solid path, and the boundary selects its relevant suffix. See (B.4), (B.5), and (B.6).
-
selects . Here and , giving .
-
selects , but . Thus .
-
selects . The identifiers agree, but , so .
-
selects . Both and hold, so .
-
selects , with and . Thus .
-
selects and gives , since . Using the later record would incorrectly give : and . The predecessor search must therefore exclude later versions.
-
selects . Since , we have .
-
All queries give , because contains only zero identifiers.
-
(9, 8) selects (5; 3, 13). We have and , so .
Evaluating all entries from Equations (B.5) and (B.6) gives, row by row,
10100010, 01010001, 00001100, 11110011, 00110011, 11111111, 00011111, 00000000, 01111111,
in agreement with (B.1).
B.6 Closure after deleting an entry
Delete entry (5, 8) from (B.1) and call the resulting matrix . Rows 4, 5 and columns now contain the forbidden pattern . Thus every -free supermatrix of must restore (5, 8).
Before row 5 is processed, the forest contains . Hence
The forest update adds only (5, 8), recovering the -free matrix (B.1). Because every -free supermatrix of contains this entry, the recovered matrix is the -free closure of , as in Theorem 8.2.
<figure type="fraction_grid" /> \begin{array}{cc}{{{3}}}&{{{8}}} \\{{{\hline4}}}&{{{1}}}&{{{1}}} \\{{{5}}}&{{{1}}}&{{{0}}} \\\end{array}Delete (5, 8) from the example.
The implication forces it to be one.
The same implication in the old forest:
lies in .
Row 5 after deletion selects ; its ancestor union is .
The restored matrix is -free, and every completion contains (5, 8).
Figure 7: The deleted entry (5, 8) is forced both by the forbidden-pattern condition and by the canonical forest update.