Keywords: rooted trees, directed acyclic graphs, enumeration, tree isomorphism, reverse search, convolution kernels [11]: Chaudhury et al. (2021), 'Transferring

Tree data appear naturally in many scientific domains. Their intrinsically non-Euclidean nature and the combinatorial explosion phenomenon make their analysis delicate. In this thesis, we focus on three approaches to compare trees, notably through the prism of a lossless compression technique of trees into directed acyclic graphs.

First, concerning tree isomorphism, we consider an extension of the classical definition to labeled trees, which requires that trees are identical up to label rewriting. This problem is as hard as graph isomorphism, and we have developed an algorithm that drastically reduces the size of the solution search space which is then explored with a backtracking strategy.

When two trees are different, we may try to find common substructures. If this question has already been addressed for subtrees, we are interested in a larger problem, namely finding sets of subtrees appearing simultaneously. This leads us to consider forest enumeration, for which we propose a reverse search algorithm that constructs an enumeration tree whose branching factor is linear.

Finally, from a list of common substructures, one can build a convolution kernel allowing to tackle classification problems. We consider the subtree kernel from the literature, and build an algorithm that explicitly enumerates subtrees (unlike the original method). In particular, our approach allows us to parameterize the kernel more finely, significantly improving its classification abilities.

Résumé

Les arbres sont des données qui apparaissent naturellement dans de nombreux domaines scientifiques. Leur nature intrinsèquement non euclidienne ainsi que le phénomène d'explosion combinatoire rendent leur analyse délicate. On s'intéresse dans cette thèse à trois approches permettant de comparer des arbres, sous le prisme notamment d'une technique de compression sans perte des arbres par des graphes dirigés acycliques. D'abord, concernant l'isomorphisme d'arbres, nous considérons une extension de la définition classique aux arbres étiquetés, qui requiert que les arbres soient identiques à réécriture des étiquettes près. Ce problème est aussi dur que l'isomorphisme de graphes, et nous avons développé un algorithme qui réduit drastiquement la taille de l'espace de recherche des solutions, qui est ensuite exploré avec une stratégie de retour sur trace.

Lorsque deux arbres sont différents, on peut chercher à en trouver des sous-structures communes. Si cette question a déjà été traitée pour les sous-arbres, nous nous intéressons à un problème plus large, celui de trouver des ensembles de sous-arbres apparaissant simultanément. Cela nous amène à considérer l'énumération des forêts, pour laquelle nous proposons un algorithme de type "reverse search" qui construit un arbre d'énumération dont le facteur de branchement est linéaire.

Enfin, à partir d'une liste de sous-structures communes, on peut construire un noyau de convolution qui permet d'aborder des problèmes de classification. Nous reprenons de la littérature le noyau des sous-arbres, et construisons un algorithme qui les énumère explicitement (contrairement à la méthode originale). Notre approche permet notamment de paramétrer plus finement le noyau, améliorant significativement les capacités de classification.

Mots-clés arbres enracinés; graphes dirigés acycliques; énumération; isomorphisme d'arbres; recherche inverse; noyaux de convolution À Romain Azaïs, pour à peu près tout, des débats enflammées sur les conséquences d'un résultat à l'explication des règles du tennis; À Christophe Godin, pour les discussions (scientifiques ou non), les conseils inestimables et la confiance accordée; À Gabriel Valiente et Nathalie Vialaneix, qui ont gentiment accepté de rapporter cette thèse et pour leurs retours précieux; À Marie-France Sagot et Matěj Stehlík, pour avoir tout aussi gentiment accepté de participer à mon jury de thèse; Aux membres de l'équipe Mosaic, du GN1 et du RDP, pour ces 3 années de pauses cafés, de discussions passionnantes et de soirées au foyer; À Cécile Mercadier, sans qui rien de tout ceci ne serait arrivé; Aux amis, pour les soirées jeux, les bons repas et tout ce qui m'a permis de souffler entre deux tentatives d'attraper une preuve qui ne voulait pas se laisser avoir; Évidemment à mes parents et ma famille qui, sans toujours bien comprendre ce que je faisais -le savais-je moi-même ? -, m'ont toujours permis de suivre la voie qui me plaisait et m'ont soutenu sans faille; Merci.

Preamble

My thesis takes place in the framework of the RObotics for MIcrofarms (ROMI) project 1 , dedicated to promote a sustainable, local, and human-scale agriculture. ROMI is developing an affordable, multipurpose platform adapted to support organic and polyculture market-garden farms. ROMI (and therefore my work) has been financed by European Commission's Horizon 2020.

Before addressing the details of my work, I would like to introduce the different facets of the ROMI project, and contextualize my contribution to the project. The following partners are involved in the project: The ROMI project The general philosophy of the ROMI project is to propose low-cost, open source technological solutions to help microfarms; this approach involves both hardware and software solutions.

▶ Institute of
This takes the form, for instance, of a mechanical weeding robot. Weeding is often a tedious, time-consuming and without much added value task -if one wants to avoid chemicals, one has to do it manually. The robot is mounted on wheels and, through a camera and a machine learning algorithm, is able to identify which areas are growing vegetables and which are dirt. A mechanical arm then digs up the soil, avoiding the vegetables, which prevents the proliferation of weeds.

Another solution envisaged by ROMI relies on the construction of a 3D plant scanner, indoor at the moment but envisaged to be an outdoor phenotyping station in the future. This 3D scanner was developed jointly with Inria, CNRS and Sony CSL. Inria and CNRS actually interact together within the RDP laboratory 2 , where I did my thesis; my work is hence inscribed in the context of this scanner.

3D plant scanner Phyllotaxis describes the arrangement of leaves and branchs of a plant, at a macroscopic level. In other words, it is the description of the topology of the plant. Phenotyping is -in our contextthe action of measuring this phyllotaxis.

Biologists routinely study a plant named Arabidopsis Thaliana (see Figure 1), used as a model organism -i.e., a species widely studied with the expectation that biological phenomena that can be explained on this species can be generalized to other species [1] [1]: . In such a plant, phyllotaxis is studied by measuring the angle between two consecutive branches (the divergence angle) and the distance between them along the main stem (the internode length). Measuring plant phyllotaxis has contributed to significant discoveries in biology [START_REF] Besnard | Cytokinin signalling inhibitory fields provide robustness to phyllotaxis[END_REF][START_REF] Guédon | Pattern identification and characterization reveal permutations of organs as a key genetically controlled property of post-meristematic phyllotaxis[END_REF] Being able to automate these measurements would be of great interest to biologists. More generally, having a 3D reconstruction of a plant makes it possible to imagine even more ambitious uses of the study of phyllotaxis, since we would have the complete topology of the plant. One could, for example, imagine a more systematic comparison of phyllotaxis between wild type plants and their mutants; or between plants subjected to hydric stress and others that have not, etc. The 3D scanner intends to meet this ambition of making phenotyping easier, and thus more frequent in the work of biologists. For farmers, one can imagine similar applications to compare healthy or sick plants, etc.

The 3D reconstruction pipeline that has been developed in the ROMI project is as follows. The scanner itself is a structure allowing to place a plant (typically about fifteen centimeters high), and where a robotic arm equipped with a camera will take images under different angles -see Figure 2. These photos are then processed by an algorithm that reconstructs a 3D point cloud reproducing the scanned plant.

The point cloud is then segmented, i.e. each point is given a label indicating to which individual organ it is believed to belong; and a skeleton is also calculated to represent the underlying structure. Finally, skeleton and segmentation are used to determine internode lengths and divergence angles, which provide the desired measure of phenotype.

The calculation from the point cloud of the skeleton [START_REF] Chaudhury | Skeletonization of plant point cloud data using stochastic optimization framework[END_REF] Since the phyllotaxis of a plant can be measured by hand, pipeline effectiveness can be attested by comparing the manual measure and the one returned at the end of pipeline. Ideally, the margin of error on the latter measurements should be similar or better than the former. Another complementary way to assess the efficiency of the 3D scanner relies on the introduction of virtual plants, which can provide numerous benefits to improve the pipeline.

Virtual plants A virtual plant, in our context, is a 3D object obtained by a generative model. In this case, the models are based on L-systems [6,7] [6]: Lindenmayer (1968), 'Mathematical models for cellular interactions in development I. Filaments with one-sided inputs' [7]: [START_REF] Lindenmayer | Developmental systems without cellular interactions, their languages and grammars[END_REF], 'Developmental systems without cellular interactions, their languages and grammars' , formal grammars widely used in virtual plant synthesis [8] , dedicated to the construction of such L-systems, and which also allows their 3D geometrical interpretation. To synthesize a particular plant species, it is necessary to design a specific L-system (which will give plants all the more faithful to reality as the model is detailed); the same model allows to generate different virtual plants thanks to a controllable stochasticity. For instance, Figure 4 represents a virtual Arabidopsis obtained with the LPy software.

Application of virtual plants

When we build a virtual plant, we know exactly its topology and geometry. A number of applications of this information can be found in the context of our reconstruction pipeline.

▶ First, we can artificially reproduce the conditions of the real scanner (light, framing, etc.) and produce images, making it possible to create artificial scans without the need to grow actual plants.

Moreover, since we know the topology and geometry of the virtual plant, we can measure the true phyllotaxis, and thus estimate the error committed at the output of the pipeline in an absolute wayand not just in comparison with the error committed manually.

▶ We know, typically, that one of the prerequisites of machine learning relies on annotated databases allowing to train algorithms. This kind of data is difficult to find in plants -one can however mention [10] [10]: Dutagaci et al. (2020), 'ROSE-X: an annotated data set for evaluation of 3D plant organ segmentation methods'

. Virtual plants provide a good substitute, since one can create segmented point clouds by sampling the 3D mesh -and then compare with the segmentation obtained by the pipeline [11] Trees are sanctuaries. Whoever knows how to speak to them, whoever knows how to listen to them, can learn the truth.

Herman Hesse

Throughout my 3 years of PhD, when a friend would ask me what my work was about, I would often tell them, "I study trees... but not the ones that grow outside, mathematical trees." To this cryptic answer, if the moment allowed it, I gave more details, but too often I did not have the time to continue and had to leave them with this enigma. As I begin this thesis, here comes my opportunity to take the time to explain in detail my work, and unveil the mystery.

The trees I study, although abstract, are just as rich and fertile as those in real life -and contain as many secrets. Many natural questions arise when trying to understand trees. Among them, the ones I am interested in are related to the comparison of trees. How to know when trees are similar? And if they are not, how different are they? What do they have in common?

In the same way that biologists have many techniques to compare actual trees, from their overall shape to their genome, we need dedicated methods to compare mathematical trees. My PhD thesis investigates exactly such comparison methods for trees.

In this introduction, the study of trees is motivated more specifically in Section 1.1. Different methods for tree comparisons are presented in Section 1.2, while Section 1.3 elaborates on the object of this thesis and its outline.

Let us start, however, with a definition.

Definition 1.1 A connected graph is a set of vertices, connected by edges, such that by walking along the edges, one can, from any vertex, reach any other vertex.

Then, a (mathematical) tree is a connected graph that contains no cyclewhere a cycle is a walk along the edges that allows to return to the starting point without retracing one's steps; in other words, a loop.

An example of a tree is provided in Figure 1.1.

Motivations for the study of trees Trees are ubiquitous

As we have seen in the preamble, trees appear naturally when we consider the structure of plants. Actually, trees are ubiquitous since they are found in a wide variety of scientific fields, from RNA secondary structures in biology [13] [13]: [START_REF] Le | Tree graphs of RNA secondary structures and their comparisons[END_REF], 'Tree graphs of RNA secondary structures and their comparisons'

to XML files in computer science [14] [14]: [START_REF] Costa | A Tree-Based Approach to Clustering XML Documents by Structure[END_REF], 'A Tree-Based Approach to Clustering XML Documents by Structure' through dendrimers in chemistry and physics [15] [15]: Martín-Delgado et al. (2002), 'Density-matrix renormalization-group study of excitons in dendrimers'

. Some examples of data that can be represented by trees are shown in Figure 1.2.

Trees are also widely used as a data structure to collect and store information in many algorithms; among which octrees [16] [16]: [START_REF] Meagher | Geometric modeling using octree encoding[END_REF], 'Geometric modeling using octree encoding' in computer vision, or even decision trees and random forests [17,[START_REF] Breiman | Random forests[END_REF] [17]: [START_REF] Breiman | Classification and regression trees[END_REF], Classification and regression trees [START_REF] Breiman | Random forests[END_REF]: [START_REF] Breiman | Random forests[END_REF], 'Random forests' in machine learning.

In general, trees can model any phenomenon or object whose hierarchical structure does not contain cycles.

Trees in graph theory

In addition to arising naturally in many domains, trees are also of interest as a class of graphs of intermediate structural complexity, between paths (or linear graphs), and general graphs 3 , as illustrated in Figure 1.3. Indeed, many fundamental questions about graphs, difficult to address in the general case, can be solved in a much simpler or more efficient way on trees (and even more easily on paths). This is for instance the case of the graph isomorphism problem -about which we will come back at length in the body of the document -or the graph coloring problem, solved for trees, but NP-hard in the general case [START_REF] Kubale | Graph colorings[END_REF] [19]: [START_REF] Kubale | Graph colorings[END_REF], Graph colorings .

It is also sometimes useful to extract a tree -referred to as a spanning tree -from a graph, for optimization purposes. For instance, it can be necessary to ensure that an algorithm, which traverses the nodes of a graph one after the other, can not loop infinitely when it encounters a cycle. Algorithms as famous as Dijkstra's or A* make an extensive use of spanning trees. We can also mention the Spanning Tree Protocol for Ethernet networks [START_REF] Perlman | An algorithm for distributed computation of a spanning tree in an extended LAN[END_REF] [20]: [START_REF] Perlman | An algorithm for distributed computation of a spanning tree in an extended LAN[END_REF], 'An algorithm for distributed computation of a spanning tree in an extended LAN'

. As an example, the tree of Figure 1.3b is a spanning tree of the graph of Figure 1.3c. [START_REF] Chaudhury | Skeletonization of plant point cloud data using stochastic optimization framework[END_REF]: We refer to nodes, in the context of trees, instead of vertices -used for graphs.

5:

In the sense that they must be comparable: it is not allowed to have one ordered and the other not, etc. 6: From ancient Greek, "same shape".

Finally, there is not only one type of tree that can be considered in graph theory. In this thesis, we are interested in rooted trees, i.e. trees where there exists a special node 4 , the root, which has no parent -all other nodes have a single parent. The tree of Figure 1.1 is rooted (the root being on top). Among rooted trees, we distinguish ordered trees -that is, the order of the children of a node is important -from unordered treeswhere the order is not important. Moreover, whether ordered or not, the nodes of a rooted tree can also carry a label, which can be of any nature. In the sequel, we will refer to rooted trees simply as "trees".

Methods for comparing trees

While there are many problems to consider concerning trees, my work is primarily concerned with the issue of comparing them. We assume that we have at least two trees, of the same nature 5 , and we try to quantify their similarity.

Tree isomorphisms

When comparing two objects, of any nature, the most elementary operation is an equality test. It is only when they are not identical that it becomes necessary to refine the way they are compared, to identify their similarities and differences. In the context of trees, this equality test is called a tree isomorphism 6 . A tree isomorphism is a bijection on the nodes that preserves the parent/child relationships.

In the case of unlabeled trees, ordered or not, one can determine if two trees are isomorphic in linear time in the number of nodes. The same is true for non-rooted trees. See for instance [START_REF] Bonamy | A small report on graph and tree isomorphism[END_REF][START_REF] Alfred V Aho | The design and analysis of computer algorithms[END_REF] [21]: Bonamy (2010), 'A small report on graph and tree isomorphism' [START_REF] Alfred V Aho | The design and analysis of computer algorithms[END_REF]: Aho et al. (1974), 'The design and analysis of computer algorithms' .

If the trees are labeled, we can adapt the definition of isomorphism in two ways. When we map two nodes together via a bijection, we associate, at the same time, the labels of these nodes. The first definition requires that if two nodes are mapped together, then their labels must be identical -so the constructed association is the identity. This definition yields a problem that is as easy to solve as for unlabeled trees.

For the second definition, we require that a given label in the first tree is only associated to a single other label in the second tree -so that all nodes sharing a label in a tree are associated to nodes that also share a label in the other tree. In a way, the aim is to construct a bijection on the nodes that preserves a partition of the labels [START_REF] Champin | Measuring the similarity of labeled graphs[END_REF] [23]: [START_REF] Champin | Measuring the similarity of labeled graphs[END_REF], 'Measuring the similarity of labeled graphs'

. With this definition, the problem becomes as difficult as the problem of graph isomorphism [START_REF] Kellog | Problems polynomially equivalent to graph isomorphism[END_REF] [24]: Booth et al. (1979), Problems polynomially equivalent to graph isomorphism , which is not resolved in the general case, even if efficient algorithms exist [START_REF] Brendan | Practical graph isomorphism, II[END_REF] During my thesis, I addressed the problem of isomorphism on labeled trees using the latter definition, and proposed an algorithm to tackle it. This work has been presented and published at the IWOCA 2021 conference [START_REF] Ingels | Isomorphic Unordered Labeled Trees up to Substitution Ciphering[END_REF]

Search for frequent patterns

When two numbers are different, we can still compare them by observing which one is smaller and which one is larger. In the case of trees, we can not define so naturally a notion of "bigger" or "smaller". Another way to compare numbers can be to list their divisors, and look at the ones they have in common. This approach, on the other hand, can be applied to trees -but instead of divisors, we will look for substructures in common. This idea of "substructures" is broad and can cover many definitions. Subtrees are such an example. A subtree of a tree is the tree formed by a node and all its descendants in the starting tree. The simplest subtree is a leaf, that is, a node without children. All trees have leaves, so they all have this subtree in common -in the very same way that all numbers are divisible by 1.

When we have a large number of trees to compare, we can also try to identify the substructures that appear most frequently. This problem has been tackled for unordered trees [START_REF] Asai | Discovering frequent substructures in large unordered trees[END_REF] [27]: [START_REF] Asai | Discovering frequent substructures in large unordered trees[END_REF], 'Discovering frequent substructures in large unordered trees'

. The method used in [START_REF] Asai | Discovering frequent substructures in large unordered trees[END_REF] is based on a famous enumeration technique, the reverse search method [START_REF] Avis | Reverse search for enumeration[END_REF] [28]: [START_REF] Avis | Reverse search for enumeration[END_REF], 'Reverse search for enumeration'

, and was previously introduced to enumerate ordered [START_REF] Nakano | Efficient generation of plane trees[END_REF] [29]: [START_REF] Nakano | Efficient generation of plane trees[END_REF], 'Efficient generation of plane trees' and then unordered trees [START_REF] Nakano | Efficient generation of rooted trees[END_REF] [30]: [START_REF] Nakano | Efficient generation of rooted trees[END_REF], 'Efficient generation of rooted trees' . I am interested in taking this problem -enumerating trees -to a higher order, by enumerating forests -as collections of trees. Indeed, being able to identify frequent subforests present in a dataset is promising: they are richer substructures than subtrees, while containing subtrees (since a tree is a singleton forest) -so one can expect to capture more detailed information and differences not visible with the frequent subtrees alone.

As for trees in [START_REF] Asai | Discovering frequent substructures in large unordered trees[END_REF][START_REF] Nakano | Efficient generation of rooted trees[END_REF], one must be able to enumerate forests before enumerating subforests. So, I developed an enumeration algorithm for unordered forests, also based on the reverse search method. This work has been presented at the WEPA 2020 conference [START_REF] Ingels | A Reverse Search Method for the Enumeration of Unordered Forests using DAG Compression[END_REF] [31]: Ingels et al. (2020), 'A Reverse Search Method for the Enumeration of Unordered Forests using DAG Compression' , and published in Theoretical Computer Science in 2022 [START_REF] Ingels | Enumeration of Irredundant Forests[END_REF] [32]: [START_REF] Ingels | Enumeration of Irredundant Forests[END_REF], 'Enumeration of Irredundant Forests' .

Classification of trees via a similarity function

One way to organize and compare a large number of objects is to arrange them in families; this is called a classification problem. In the case where we already know the family of a certain number of objects, but not of all of them, we talk about supervised classification: we train an algorithm to recognize the members of the same family and to distinguish them from the other ones, and then the algorithm predicts the family of the objects for which we don't have any information. This is a machine learning approach, exactly the same way as when an algorithm is trained to recognize pictures of dogs or cats.

A standard way to accomplish this is to construct a similarity function -which measures how alike two objects are -so that objects from the same family have a much higher similarity than objects from different families. Kernels are a powerful way to construct a similarity function, and can be used in conjunction with a support vector machine algorithm to solve such supervised classification problems. On this topic, we refer the reader to [START_REF] Cristianini | An introduction to support vector machines and other kernel-based learning methods[END_REF] [33]: [START_REF] Cristianini | An introduction to support vector machines and other kernel-based learning methods[END_REF], An introduction to support vector machines and other kernel-based learning methods .

In particular, for trees, so-called convolution kernels can be used [START_REF] Haussler | Convolution kernels on discrete structures[END_REF][START_REF] Collins | Convolution kernels for natural language[END_REF] [34]: [START_REF] Haussler | Convolution kernels on discrete structures[END_REF], Convolution kernels on discrete structures [START_REF] Collins | Convolution kernels for natural language[END_REF]: [START_REF] Collins | Convolution kernels for natural language[END_REF], 'Convolution kernels for natural language' , whose premise is that two trees are similar if they share many substructures in common. As earlier, there are many possible definitions of "substructures", each leading to a new kernel; many examples can be found in [START_REF] Da | Kernel methods for tree structured data[END_REF] [36]: Da San Martino (2009), 'Kernel methods for tree structured data' . I am particularly interested in the subtree kernel [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] [37]: Vishwanathan et al. (2004), 'Fast kernels for string and tree matching' , which evaluates the similarity between two trees based on their common subtrees. Whereas the original paper proposed a recursive computation algorithm, I proposed an iterative algorithm that allows a greater finesse in the choice of specific parameters. I have shown, in particular, that this finesse allows to significantly improve the performance of the kernel -i.e. its ability to discriminate families in the classification problem -on some datasets. This work was presented at the 51st Journées de Statistiques conference in 2019 [START_REF] Ingels | De l'importance de la fonction de poids dans le noyau des sous-arbres[END_REF] [38]: [START_REF] Ingels | De l'importance de la fonction de poids dans le noyau des sous-arbres[END_REF], 'De l'importance de la fonction de poids dans le noyau des sous-arbres' , and published in the Journal of Machine Learning Research in 2020 [START_REF] Azaïs | The weight function in the subtree kernel is decisive[END_REF] [39]: Azaïs et al. (2020), 'The weight function in the subtree kernel is decisive' .

Object of the thesis Enumeration problems

The three problems previously introduced are all, since they concern trees, eminently combinatorial problems. The difficulty lies, in fact, not in the intrinsic complexity of the structures, but rather in the exponential multiplication of possibilities as the size of the trees increases. As an illustration, one can find in Table 1.1, how the number of (unlabeled, unordered, rooted) trees increases as tree size increases, a result due to Cayley -who also coined the term "tree" [START_REF] Cayley | On the Analytical Forms Called Trees: With Application to the Theory of Chemical Combinations[END_REF] The main criterion to take into account when designing algorithms to solve the above-mentioned problems is their efficiency: we want to be able to obtain an answer in a few seconds, minutes, maybe hours, but barely more. For this reason, most algorithms try to get around the difficulty by never making explicit the part where you have to explore and enumerate all possibilities.

In my thesis, I tried to take the opposite side -whenever possible -and to show that there is something to be gained by enumerating explicitly. By virtue of the above, this ambition requires even more attention to design effective algorithms. As such, parsimonious enumeration is of utmost importance -in the sense that we can not afford to enumerate superfluous objects; this includes both duplicates (a same object obtained several times) and undesirables (objects not answering the problem).

Lossless compression of trees

Lossless compression methods are a way of condensing one object into another, occupying a reduced size, so that no information is lost (as is the case with RAR compression for files), and the original object can be reconstructed identically. Several compression methods exist for trees, among which top trees compression [START_REF] Bille | Tree compression with top trees[END_REF] [41]: [START_REF] Bille | Tree compression with top trees[END_REF], 'Tree compression with top trees' , but also Directed Acyclic Graph (DAG) compression [START_REF] Sutherland | Sketchpad a man-machine graphical communication system[END_REF][START_REF] John | Efficient antialiased rendering of 3-D linear fractals[END_REF][START_REF] Buneman | Path queries on compressed XML[END_REF][START_REF] Frick | Query evaluation on compressed trees[END_REF] [42]: [START_REF] Sutherland | Sketchpad a man-machine graphical communication system[END_REF], 'Sketchpad a man-machine graphical communication system' [START_REF] John | Efficient antialiased rendering of 3-D linear fractals[END_REF]: [START_REF] John | Efficient antialiased rendering of 3-D linear fractals[END_REF], 'Efficient antialiased rendering of 3-D linear fractals' [START_REF] Buneman | Path queries on compressed XML[END_REF]: [START_REF] Buneman | Path queries on compressed XML[END_REF], 'Path queries on compressed XML' [START_REF] Frick | Query evaluation on compressed trees[END_REF]: [START_REF] Frick | Query evaluation on compressed trees[END_REF], 'Query evaluation on compressed trees' , in which I am particularly interested.

The principle of DAG compression is to factorize the identical (thus isomorphic) subtrees and to create a graph condensing all the structure of the tree -an example is provided in Figure 1.4. Since no information is lost, having a tree or its compressed form is strictly identical; and since I am interested in how to compare trees, the question of directly comparing compressed forms arises.

In fact, most of the time, the algorithms I built use the compressed form of the trees, not the trees themselves. By proceeding in this way, it is possible to decrease the difficulty arising from the combinatorial and enumerative aspect mentioned above.

Outline of the thesis

Upcoming Chapter 2 of this thesis formally introduces the definitions of trees, tree isomorphism and DAG compression already mentioned earlier in this introduction. The rest of the thesis is divided into three parts, independent of each other, and resume the three comparison methods mentioned above.

The first part, The Tree Ciphering Isomorphism Problem, is concerned with the isomorphism problem on labeled trees -where the definition used, imposing that the bijection of the nodes induces a bijection on the labels, induces the greatest difficulty. The problem is formalized in Chapter 3, while an algorithm addressing it is proposed in Chapter 4. The basis of this work is derived from [START_REF] Ingels | Isomorphic Unordered Labeled Trees up to Substitution Ciphering[END_REF] , but is here expanded with additional content.

In the context of the search for frequent patterns, the second part, Enumeration Trees: from Trees to Forests, focuses on what has already been done for trees in Chapter 5, and introduces the problem of enumerating forests. Chapter 6 proposes an algorithm addressing the latter, as well as its theoretical analysis. An extension is also proposed to deal with related issues, including the frequent subforests mining problem. This part is mainly reproduced from [START_REF] Ingels | Enumeration of Irredundant Forests[END_REF] [32]: [START_REF] Ingels | Enumeration of Irredundant Forests[END_REF], 'Enumeration of Irredundant Forests' .

The third part, The Subtree Kernel Revisited, introduces supervised classification problems on trees through the prism of the subtree kernel in Chapter 7, for which a new computational framework is proposed in Chapter 8, together with analyses on real databases. The contributions in this part are derived from [START_REF] Azaïs | The weight function in the subtree kernel is decisive[END_REF]

A word on implementation

As mentioned, the nature of the problems addressed in this thesis makes it necessary to develop efficient algorithms. Thus, beyond my traditional tools as a mathematician -paper, pencil, board, chalk -I also devoted an important part of my work to the implementation of many algorithms and data structures, in order to be able to put the fruit of my efforts to the test. Thus, all of the algorithms of my design that can be found in this thesis, as well as a large number of algorithms from the literature that will be presented, have been implemented with the goal of being as efficient as possible in mind, this constraint also feeding my theoretical design work.

All of this has been incorporated into the Python treex library, developed within my team, dedicated to rooted trees, and capable of handling ordered or unordered, labeled or unlabeled trees, and offering a wide variety of procedures -random generation, processing algorithms, visualization, etc [START_REF] Azaïs | Treex: a Python package for manipulating rooted trees[END_REF] Trees are as close to immortality as the rest of us ever come.

Karen Joy Fowler

This chapter introduces the most important concepts that will be used in the rest of this thesis. The principal notations are also introduced here; in this regard, see also the index of frequent notations at the end of the document.

Section 2.1 introduces the necessary vocabulary of graph theory allowing then to properly define rooted trees which are at the heart of our concerns in this thesis. Considerations on encoding and random tree generation are also discussed.

The notion of tree isomorphism is extensively detailed in Section 2.2, both from a theoretical and algorithmic point of view. Finally, the DAG compression for trees and forests is presented, respectively, in Section 2.3 and Section 2.4. These two concepts will be at the core of the various problems discussed later.

Formal definition

Graph vocabulary

A graph is a pair 𝐺 = (𝑉 , 𝐸) where 𝑉 is a finite set of elements called vertices, and 𝐸 is a set of paired vertices, called edges. We exclude here that an edge connects a vertex to itself: loops are forbidden. A path in a graph is a finite sequence of edges such that the ending vertex of each edge is the starting vertex of the next edge -as in Figure 2.1a.

Directed A graph is said to be directed if the edges have orientations, i.e. if we distinguish the edge going from 𝑢 to 𝑣 from the one going from 𝑣 to 𝑢. In the case of a directed graph, we refer to arcs rather than edges. A directed graph -or digraph -is presented in Figure 2.1b.

Connected A graph 𝐺 is said to be connected if, for any two vertices 𝑢 and 𝑣, 𝐺 contains a path that connects 𝑢 and 𝑣. In the case where 𝐺 is directed, it is connected if and only if its undirected version -i.e. where each directed arc is replaced by an undirected edge -is connected. In other words, a connected graph is composed of a single fragment. A disconnected graph is shown in Figure 2.1c. Acyclic A cycle is a path that connects a vertex with itself -see Figure 2.1d. A graph is said to be acyclic if it contains no cycles. A directed graph that contains no directed cycles -where an example of directed cycle can be found in Figure 2.1e -is called a Directed Acyclic Graph (DAG) .

Multigraph A multigraph is a graph in which it is permitted to have several edges or arcs connecting the same two vertices. An example is provided in Figure 2.1f.

In this thesis, all the graphs considered are connected, directed and acyclic. Some of them are, in addition, multigraphs.

Rooted trees

Definition 2.1 A rooted tree 𝑇 is a connected graph with no cycle such that there exist a unique vertex ℛ(𝑇), called the root, which has no parent, and any vertex different from the root has exactly one parent.

The leaves ℒ(𝑇) are all the vertices without children. A tree is a directed graph, the arcs being directed from the root to the leaves, from parent to children. Since only rooted trees are considered in this thesis, they will be referred to simply as trees in the sequel. A example is provided in Figure 2.2.

Topological properties A number of quantities can be calculated on a tree, among which height, depth and outdegree. The height of a node 𝑣 of a tree 𝑇 can be recursively defined as

ℋ (𝑣) =        0 if 𝑣 ∈ ℒ(𝑇), 1 + max 𝑢∈𝒞(𝑣) ℋ (𝑢) otherwise; (2.1)
where 𝒞(𝑣) denotes the set of children of 𝑣. The height ℋ (𝑇) of the tree 𝑇 is defined as the height of the root, i.e., ℋ (𝑇) = ℋ (ℛ(𝑇)). For 0 ≤ ℎ ≤ ℋ (𝑇), 𝑇 ℎ denotes the set of nodes of 𝑇 with height ℎ. Note that the mapping ℎ ↦ → 𝑇 ℎ can be constructed in linear time, by a traversal of the tree.

The depth of a node 𝑣 is recursively defined as

depth(𝑣) = 0 if 𝑣 = ℛ(𝑇), 1 + depth(𝒫(𝑣)) otherwise; (2.2)
where 𝒫(𝑣) designates the parent of 𝑣. The depth of the tree 𝑇 is defined as the maximum depth among all nodes. Notably, ℋ (𝑇) = depth(𝑇).

Finally, the outdegree of 𝑇 is the maximal branching factor that can be found in 𝑇, that is deg(𝑇) = max 𝑣∈𝑇 # 𝒞(𝑣). The outdegree of a node 𝑣 is thus simply defined as deg(𝑣) = # 𝒞(𝑣).

(

) ( ( ) ( ) ) ( ( ) ( ) ) ) ( ( ) ( ) ) ( ( ) ( ) ) ( ) ( ) ( ) ( ) ( ) (

Particular trees

In this thesis, we are interested in specific classes of trees. Thus, trees can be ordered or unordered, labeled or not.

Trees are said to be ordered if the order in which the children of a node appear is significant. If not, trees are said to be unordered.

A labeled tree is a tree in which each node is given a label, whose nature can be arbitrary, and we denote the label of a node 𝑣 by 𝑣. The set of labels of a tree 𝑇 is denoted by 𝒜(𝑇) and defined as 𝒜(𝑇) = {𝑣 : 𝑣 ∈ 𝑇}. 𝒜(𝑇) is also called the alphabet of 𝑇.

In the rest of the thesis, it will be specified when the considered trees are ordered or not, labeled or not. To simplify the notations, we shall indifferently denote by 𝒯 the set of considered trees.

Forests

The literature acknowledges two definitions for a forest [START_REF] Edward | Lists, decisions and graphs[END_REF] [47]: Bender et al. ( 2010), Lists, decisions and graphs

.

▶ An undirected, disconnected, acyclic graph. Each connected component is therefore an unrooted tree.

▶ A disjoint union of trees, where the trees can be of any nature.

The two definitions coincide when the trees considered are unrooted (and therefore unordered). In this thesis, we adopt the second definition.

Encoding of trees

In addition to their representation as graphs, ordered trees can be encoded in different forms, related to other fields of mathematics or computer science. Typically, an ordered tree can be encoded as a sequence -such as Prüfer sequences [START_REF] Prüfer | Neuer beweis eines satzes über permutationen[END_REF] [48]: [START_REF] Prüfer | Neuer beweis eines satzes über permutationen[END_REF], 'Neuer beweis eines satzes über permutationen'

. We are particularly interested here in Knuth tuples, that can be found in [START_REF] Donald | Fascicle 4, The: Generating All Trees-History of Combinatorial Generation[END_REF] [49]: Knuth (2013), Art of Computer Programming, Volume 4, Fascicle 4, The: Generating All Trees-History of Combinatorial Generation . We associate to each leaf in the tree the tuple "( )". Then, by increasing height, each node receives the concatenated tuple "( 𝑡 1 • • • 𝑡 𝑛 )" where 𝑡 𝑖 is the tuple associated to the 𝑖-th child of that node. The tuple associated to the tree is the one of its root. An example is provided in Figure 2.3. This technique associates a unique tuple with an ordered tree, and one can reconstruct the original tree from the tuple. Therefore, the set of ordered trees is in bijection with the set of well parenthesized expressions. Alternatively, by replacing "(" with 0 and ")" with 1, ordered trees can be interpreted as sequences or strings. For instance, the tree of Figure 2.3 is encoded with the sequence 0010010110010111.

Interpreting 0 as +1 and 1 as -1, we can read this sequence as an excursion (i.e. a walk that comes back to the origin) in Z, starting at 0. This walk also draws the graph of a function, which is called the Harris path of the tree [START_REF] Aldous | The continuum random tree III[END_REF][START_REF] Azaïs | Inference for conditioned Galton-Watson trees from their Harris path[END_REF] [50]: [START_REF] Aldous | The continuum random tree III[END_REF] In the case of unordered trees, this tuple is not unique (except in pathological cases). In the example of Figure 2.3, if we swap the nodes of depth 1 to place the leaf between its two siblings (or after them), we obtain a different tuple for the tree. Note that this method is purely topological and ignores any labels. It can be extended simply by writing the label of a node just after "(", but before the concatenation of children tuples.

Random trees

We refer to random graphs when we define a probability distribution on the space of graphs, or alternatively when we describe a random process allowing to generate graphs [START_REF] Bollobás | Random Graphs[END_REF] [52]: [START_REF] Bollobás | Random Graphs[END_REF], Random Graphs . Naturally this also applies to trees, for which there are many ways to generate random trees. We can mention for example Galton-Watson trees [START_REF] Neveu | Arbres et processus de Galton-Watson[END_REF] [53]: Neveu (1986), 'Arbres et processus de Galton-Watson' and conditionned Galton-Watson trees, the latter being closely related to Harris paths mentioned above [START_REF] Azaïs | Inference for conditioned Galton-Watson trees from their Harris path[END_REF] , which allows to construct random trees of fixed size following a uniform distribution.

In this thesis, the occurrences of random trees are exclusively recursive random trees [START_REF] Zhang | On the number of leaves in a random recursive tree[END_REF] [56]: Zhang (2015), 'On the number of leaves in a random recursive tree' , constructed as follows: beginning with a single node tree, we add nodes one by one, iteratively, by choosing uniformly at random a node already built and adding a leaf to it.

Tree isomorphisms

Definitions

A graph isomorphism between two graphs 𝐺 1 = (𝑉 1 , 𝐸 1 ) and 𝐺 2 = (𝑉 2 , 𝐸 2 ) is a bijection 𝜙 : 𝑉 1 → 𝑉 2 such that (𝑢, 𝑣) ∈ 𝐸 1 if and only if (𝜙(𝑢), 𝜙(𝑣)) ∈ 𝐸 2 . When there is such a bijection between two graphs, we say that they are isomorphic, and we note 𝐺 1 ≃ 𝐺 2 -as in Figure 2.4. The set of all isomorphisms between 𝐺 1 and 𝐺 2 is denoted by Isom(𝐺 1 , 𝐺 2 ). Graph isomorphism is an equivalence relation on the set of graphs. Determining whether two graphs are isomorphic is an algorithmically complicated problem, on which we elaborate extensively in Chapter 3.

At this point, we shall restrict ourselves to trees. Let 𝑇 1 and 𝑇 2 be two unlabeled trees. Depending on whether the trees are ordered or not 7 , a different definition will be adopted, as follows.

Definition 2.3 A bijection 𝜙

: 𝑇 1 → 𝑇 2 is an unordered tree isomorphism if and only if, for any 𝑢, 𝑣 ∈ 𝑇 1 , if 𝑢 is a child of 𝑣 in 𝑇 1 , then 𝜙(𝑢) is a child of 𝜙(𝑣) in 𝑇 2 . Definition 2.4 A bijection 𝜙 : 𝑇 1 → 𝑇 2 is an ordered tree isomorphism if and only if, for any 𝑢, 𝑣 ∈ 𝑇 1 , if 𝑢 is the 𝑘 th child of 𝑣 in 𝑇 1 , then 𝜙(𝑢) is the 𝑘 th child of 𝜙(𝑣) in 𝑇 2 .
An illustration is provided in Figure 2.5. As for graph isomorphism, if a tree isomorphism exists between two trees, ordered or not, they are called isomorphic, which is denoted by 𝑇 1 ≃ 𝑇 2 . Tree isomorphism is an equivalence relation on the set of trees 𝒯 [START_REF] Valiente | Algorithms on trees and graphs[END_REF] [57]: Valiente (2013), Algorithms on trees and graphs . The set of all tree isomorphisms between 𝑇 1 and 𝑇 2 is, as well, denoted by Isom(𝑇 1 , 𝑇 2 ). Its cardinality is investigated in upcoming On the number of tree isomorphisms (p. 25). 8: For example, if 𝑇 1 and 𝑇 2 do not have the same number of nodes, outdegree or height, they can not be isomorphic.

In the case where the trees are labeled, we can adapt the previous definitions by imposing in addition that the labels of the mapped nodes are identical, i.e., 𝑢 = 𝜙(𝑢). A less restrictive definition also exists [START_REF] Champin | Measuring the similarity of labeled graphs[END_REF] [23]: [START_REF] Champin | Measuring the similarity of labeled graphs[END_REF], 'Measuring the similarity of labeled graphs' , which requires that the isomorphism preserves a partition of the labels. Specifically, all nodes 𝑢 ∈ 𝑇 1 that share a common label 𝑎 ∈ 𝒜(𝑇 1 ) should only be mapped to nodes 𝑣 ∈ 𝑇 2 sharing a common label 𝑏 ∈ 𝒜(𝑇 2 ) -thus associating in a bijective manner labels 𝑎 and 𝑏. Chapter 3 and Chapter 4 explore this latter definition in detail.

Remark 2.1

The previously introduced ordered and unordered trees can actually be defined more formally via the isomorphisms defined above. The set of unordered trees is defined as the quotient set of rooted trees by the equivalence relation induced by the unordered tree isomorphisms. The same applies to ordered trees.

The concept of tree isomorphism allows us to introduce some additional notions to complement the previous section.

Subtrees

For any node 𝑣 of a tree 𝑇, the subtree 𝑇[𝑣] rooted in 𝑣 is the tree composed of 𝑣 and all its descendants 𝒟(𝑣). 𝒮(𝑇) denotes the set of all subtrees of 𝑇, up to isomorphism. Formally, 𝒮(𝑇) = {𝑇[𝑣] : 𝑣 ∈ 𝑇}/ ≃ .

Classes of equivalence

The Aho, Hopcroft & Ullman algorithm

The question remains to determine, algorithmically, whether two trees are isomorphic. The ordered case is easily solved, as per the following theorem. As stated in [START_REF] Bonamy | A small report on graph and tree isomorphism[END_REF] [21]: Bonamy (2010), 'A small report on graph and tree isomorphism' , the key is to go through both trees simultaneously, by depth-first search, and number the nodes in the order of traversal. This induces a natural bijection between the nodes, which can be easily checked as an isomorphism.

Theorem 2.1 Ordered tree isomorphism can be decided in linear time.

In the unordered case, the result can be obtained by the virtue of the Aho, Hopcroft & Ullman (AHU) algorithm [START_REF] Alfred V Aho | The design and analysis of computer algorithms[END_REF] [22]: Aho et al. (1974), 'The design and analysis of computer algorithms'

, where the following result is proven.

Theorem 2.2 Unordered tree isomorphism can be decided in linear time.

In reality, as mentioned in [START_REF] Douglas | Tree isomorphism algorithms: Speed vs. clarity[END_REF] [58]: Campbell et al. (1991), 'Tree isomorphism algorithms: Speed vs. clarity' , this complexity is only achieved by assuming that the trees can be encoded within a fixed number of bits. Without this assumption, running AHU algorithm on trees of size 𝑛 is rather 𝒪(𝑛 log(𝑛)) than 𝒪(𝑛).

We present with Algorithm 1 a slightly different version of the AHU algorithm presented in [START_REF] Bonamy | A small report on graph and tree isomorphism[END_REF][START_REF] Alfred V Aho | The design and analysis of computer algorithms[END_REF]. First, our version omits to check some stopping cases taken into account in AHU 8 , for the sake of simplicity.

Secondly, from a theoretical point of view, our version is slightly less efficient -see upcoming Proposition 2.3. Nevertheless, our version has the merit of being simpler to formalize, but above all it allows to treat both ordered and unordered trees (where AHU only addresses the latter) and can be easily adapted for labeled trees in the case where we impose equality of labels 9 9: It suffices to add the label 𝑣 as the first element of the list 𝐶 𝑣 constructed in Line 8 -but after the eventual sorting step.

.

Algorithm 1: TreeIsomorphism

Input: 𝑇 1 , 𝑇 2 , ★ ∈ {ord., unord.} Output: ⊤ if and only if 𝑇 1 ≃ 𝑇 2 1 if ℋ (𝑇 1 ) ≠ ℋ (𝑇 2 ) then 2 return ⊥ 3 else 4 𝑖 ← 0 5 Let 𝑓 : ∅ ↦ → 0 6 for ℎ from 0 to ℋ (𝑇 1 ) do 7 for 𝑣 ∈ 𝑇 ℎ 1 ∪ 𝑇 ℎ 2 do 𝐶 𝑣 ← [𝑁 𝑢 : 𝑢 ∈ 𝒞(𝑣)] if ★ = unord. then Sort 𝐶 𝑣 if 𝑓 (𝐶 𝑣 ) is defined then 𝑁 𝑣 ← 𝑓 (𝐶 𝑣 ) else 𝑖 ← 𝑖 + 1 Define 𝑓 (𝐶 𝑣 ) = 𝑖 𝑁 𝑣 ← 𝑖 17 return 𝑁 ℛ(𝑇 1 ) = 𝑁 ℛ(𝑇 2 )
The overall idea of the algorithm is to assign to each node 𝑣, in a bottom-up approach, a number 𝑁 𝑣 representing its equivalence class [𝑣] -starting with leaves receiving the number 0. The algorithm returns ⊤ if and only if the roots are assigned the same number, i.e., if and only if

[ℛ(𝑇 1 )] = [ℛ(𝑇 2 )] -equivalent to 𝑇 1 ≃ 𝑇 2 .
We are particularly interested in this feature of assigning to each node its equivalence class, and it will be exploited in upcoming DAG compression, but also in Chapter 4.

Given two trees 𝑇 1 and 𝑇 2 , assuming that #𝑇 1 = #𝑇 2 = 𝑛 and deg(𝑇 1 ) = deg(𝑇 2 ) = 𝑑, we have the following result.

Proposition 2.3 Algorithm 1 has complexity:

▶ 𝒪(𝑛𝑑 log(𝑑)) for unordered trees; ▶ 𝒪(𝑛𝑑) for ordered trees.

Proof. Suppose that determining whether 𝑓 (𝐶 𝑣 ) is defined can be made in constant time (e.g. via hash tables [START_REF] Donald | The art of computer programming[END_REF] [59]: Knuth (1973), 'The art of computer programming. Vol. 3, Sorting and Searching'

). The double for loop allows to visit all the nodes of 𝑇 1 and 𝑇 2 . When visiting a node 𝑣, we scan its children and sort them only in the unordered case, for a complexity of deg(𝑣) or deg(𝑣) log(deg(𝑣)) -since merge sort has worst time complexity in 𝒪(𝑘 log(𝑘)) [START_REF] Steven | Sorting and searching[END_REF] [60]: Skiena (2012), 'Sorting and searching'

. Summing over all the nodes and bounding deg(𝑣) by 𝑑 yields the expected result.

DAG compression of trees

Trees can present internal repetitions in their structures. Eliminating these structural redundancies defines a reduction of the initial data that can result in a DAG. In particular, beginning with [START_REF] Sutherland | Sketchpad a man-machine graphical communication system[END_REF] [42]: [START_REF] Sutherland | Sketchpad a man-machine graphical communication system[END_REF], 'Sketchpad a man-machine graphical communication system' , DAG representations of trees are also much used in computer graphics where the process of condensing a tree into a graph is called object instancing [START_REF] John | Efficient antialiased rendering of 3-D linear fractals[END_REF]

Overview

Before discussing the formal construction of DAG compression, we present here the general idea in the form of a vertex coloring procedure.

Let 𝑇 be an unordered tree. Each node 𝑢 of 𝑇 is assigned a color 𝑐(𝑢) such that, for any pair of distinct nodes, 𝑐(𝑢) = 𝑐(𝑣) ⇐⇒ [𝑢] = [𝑣]. This is equivalent to partitioning the nodes of 𝑇 according to their equivalence class.

We then construct a directed graph 𝐷 whose number of vertices is equal to the number of colors used, i.e. #𝐷 = #Im 𝑐, and whose arcs are constructed as follows. For any two nodes 𝑢, 𝑣 ∈ 𝑇, if 𝑢 ∈ 𝒞(𝑣), we add an arc 𝑐(𝑣) → 𝑐(𝑢) in 𝐷. Note that this definition implies that multiple arcs are possible in 𝐷, as if there exist 𝑢, 𝑢 ′ ∈ 𝒞(𝑣), so that [𝑢] = [𝑢 ′ ], then the arcs 𝑐(𝑣) → 𝑐(𝑢) and 𝑐(𝑣) → 𝑐(𝑢 ′ ) are identical.

The resulting graph is a DAG, and we call it the DAG compression of 𝑇. The main advantage of this compression is that it is lossless, i.e. the original tree can be reconstructed identically. If 𝑇 is ordered, the order in which the arcs 𝑐(𝑣) → 𝑐(𝑢) are placed must respect the order of appearance of 𝑢 among the children of 𝑣. An illustration is provided in Figure 2.7.

Formal definition

We use here a formalism similar to the one that can be found in [START_REF] Godin | Quantifying the degree of self-nestedness of trees: application to the structural analysis of plants[END_REF] In fact, in a more general way, we have the following proposition.

Proposition 2.4 Let ∼ be an equivalence relation on

𝒯 so that 𝑇 1 ∼ 𝑇 2 =⇒ #𝑇 1 = #𝑇 2 . Then, the quotient graph 𝑄(𝑇) = 𝑇/ ∼ is a DAG.
Proof. Assume there exist 𝑞 1 , . . . , 𝑞 𝑛 in 𝑄(𝑇) such that there is a cycle

𝑞 1 → 𝑞 2 → • • • → 𝑞 𝑛 → 𝑞 1 .
Since all trees represented by class 𝑞 𝑖 share the same number of nodes, let us call this number 𝑐 𝑖 . Since an arc 𝑞 𝑖 → 𝑞 𝑗 in 𝑄(𝑇) implies that there exist 𝑢, 𝑣 ∈ 𝑇 with [𝑢] = 𝑞 𝑖 , [𝑣] = 𝑞 𝑗 , 𝑣 ∈ 𝒞(𝑢), then 𝑐 𝑗 < 𝑐 𝑖 . Therefore,

𝑐 1 < 𝑐 2 < • • • < 𝑐 𝑛 < 𝑐 1 , which is absurd.
Let 𝑠 be a section of 𝑄(𝑇), i.e. an injective function 𝑠 : 𝑄(𝑇) → 𝑇 such that for any 𝑞 ∈ 𝑄(𝑇), [𝑠(𝑞)] = 𝑞 10 . For 𝑞 ∈ 𝑄(𝑇), let us build the multiset 𝑆(𝑞) = {[𝑣] : 𝑣 ∈ 𝒞(𝑠(𝑞))}. For any 𝑏 ∈ 𝑆(𝑞), let 𝑛(𝑏, 𝑞) be the multiplicity of 𝑏 in 𝑆(𝑞). This number is equal to the number of children with class 𝑏 of a node with class 𝑞 in 𝑇. As one arc 𝑞 → 𝑏 already exists in 𝑄(𝑇), we add 𝑛(𝑏, 𝑞) -1 new arcs 𝑞 → 𝑏 to match the multiplicity. If 𝑇 is ordered, the arcs leaving 𝑞 must respect the order of appearance of children of 𝑠(𝑞) in 𝑇. This whole operation creates a new DAG 11 Q(𝑇), whose construction is illustrated on Figure 2.8. Note that Q(𝑇) is a multigraph.

The definition of parent and children of a node can be generalized to Q(𝑇) and will be denoted the same as for trees, respectively 𝒫(•) and 𝒞(•). Note that since there can be multiple repetitions of an arc in Q(𝑇), the multiplicity is accounted for in 𝒫(•) and 𝒞(•). The notions of height and outdegree also apply and will be denoted ℋ (•) and deg(•) as well. Similarly to trees, for a DAG 𝐷 we denote by 𝐷[𝑣] the subDAG rooted in 𝑣 composed of 𝑣 and all its descendants in 𝐷. Unlike trees, the notion of depth as introduced in Equation 2.2 does not apply to DAGs. Take the example of Figure 2.8: on the tree, there are nodes with depth of 1 or 2; on the DAG these nodes are compressed together and therefore their depth is not well defined (it depends on the path one follows in the DAG from the root).

We call the graph Q(𝑇) the DAG compression of 𝑇, and denote it by ℜ(𝑇). The DAG compression of 𝑇 can be seen as 𝑇 deprived of its redundancies, and actually is a lossless compression of 𝑇 since we have the following theorem.

Theorem 2.5 𝑇 can be reconstructed from ℜ(𝑇) -up to tree isomorphism.

Algorithm 2: RebuildTree

Input: ℜ(𝑇), 𝑞 ∈ ℜ(𝑇) Let 𝑡 be a single-node tree for 𝑏 ∈ 𝒞(𝑞) do

𝑡 𝑏 ← RebuildTree(ℜ(𝑇), 𝑏)
Add 𝑡 𝑏 as last subtree of 𝑡 return 𝑡 This argument was made in [START_REF] Godin | Quantifying the degree of self-nestedness of trees: application to the structural analysis of plants[END_REF]Proposition 4], where the proof was actually omitted but an iterative reconstruction algorithm was proposed instead. We alternatively propose with Algorithm 2 a recursive reconstruction algorithm, for which we prove that it indeed reconstructs the tree as claimed. In the sequel, ℜ -1 stands for the inverse operator of ℜ, i.e. for any tree 𝑇, ℜ -1 (ℜ(𝑇)) ≃ 𝑇 by the previous theorem.

Proof. Let 𝐷 = ℜ(𝑇). Using Algorithm 2, let 𝜏 = RebuildTree(𝐷, ℛ(𝐷)) -where ℛ(•) denotes the root. We aim to prove by induction that 𝜏 and 𝑇 are equal, up to a tree isomorphism. Trivially, if 𝑇 is a single node tree, this property holds. Otherwise, let us denote 𝑟 the root of 𝑇 -therefore [𝑟] = ℛ(𝐷) -and 𝜌 the root of 𝜏.

We partition 𝒞(𝑟) by equivalence class -each one corresponds to a different node in 𝐷. All classes are addressed identically, so let 𝑏 be one of them, and 𝐶 𝑏 = {𝑢 ∈ 𝒞(𝑟) : [𝑢] = 𝑏}. By definition, #𝐶 𝑏 = 𝑛(𝑏, ℛ(𝐷)); therefore, when reconstructing, we add as many subtrees to 𝜌.

By induction, each of these new subtrees has equivalence class 𝑏 and is isomorphic to the elements of 𝐶 𝑏 . Indeed, since the order of arcs in 𝐷 is not preserved in the unordered case, the topologies of 𝑇 and 𝜏 are equal up to permutation of children -e.g., subtrees and in Figure 2.9. In the ordered case, as subtrees are inserted in last position of the children of 𝜌, they respect the same order as the order of the arcs, and therefore the order of children of 𝑟: the topologies are equal. , with complexity going from 𝒪(#𝑇 2 ) to 𝒪(#𝑇).

We propose with Algorithm 3 an unifying algorithm for computing ℜ(𝑇), whether should 𝑇 be ordered or not. The determination on the fly of classes of equivalence of the nodes is adapted from AHU algorithm.

The key idea of the algorithm is to build a mapping 𝑓 that associates to each node its class of equivalence, based on the distribution of the equivalence classes of its children; starting from the leaves to the root. Assuming that (i) creating a new vertex is of complexity 𝒪(𝐶 𝑣 ) and (ii) determining whether 𝑓 (𝐶 𝑣 ) is defined can be made in constant time (as for Algorithm 1), the overall complexity of the algorithm is 𝒪(#𝑇 deg(𝑇)) for ordered trees and 𝒪(#𝑇 deg(𝑇) log(deg(𝑇))) for unordered treesthus comparable to existing literature.

Algorithm 3: TreeCompression

DAG compression of forests

DAG compression can be extended naturally to forests, which is investigated here. This section is mostly reproduced from [START_REF] Azaïs | The weight function in the subtree kernel is decisive[END_REF] [39]: Azaïs et al. (2020), 'The weight function in the subtree kernel is decisive'

.

Definition

Let 𝐹 = {𝑇 1 , . . . , 𝑇 𝑛 } be a forest, as defined earlier. We construct a supertree 𝑇 𝐹 , placing each 𝑇 𝑖 as a child of an artificial root. It suffices then to compute ℜ(𝑇 𝐹 ) with Algorithm 3 -whose single root will also be artificial.

Since the root of this DAG 𝐷 is artificial, we will use the notation ℛ(𝐷), to designate the children of this root -and thus the nodes of 𝐷 that really correspond to the roots of the trees of the initial forest.

DAG recompression

Since DAG compression is lossless, one can imagine storing tree data in DAG form. In the case where the forest is stored as a DAG forest (i.e. each tree is compressed and stored individually), it would be superfluous to decompress all the trees to build the super tree 𝑇 𝐹 and then recompress it. Instead, we would rather build ℜ(𝑇 𝐹 ) directly from this DAG forest.

Let 𝐹 = {𝑇 1 , . subtrees, so it suffices to prove that the algorithm stops at the right time.

Let ℎ be the first height for which 𝜎(ℎ) = ∅.

Suppose by contradiction that some vertices were to be merged at some height ℎ ′ > ℎ. They represent isomorphic subtrees, so that their respective children should also be merged together, and all of their descendants by induction. As any vertex of height ℎ ′′ + 1 admits at least one child of height ℎ ′′ , 𝜎(ℎ) would not be empty, which is absurd. . At each step 1, 2 and 3, we examine vertices at height (0,1,2) and merge those which have same children. At step 4, we can not find any vertex to merge and we stop. Note that in (c) at step 3, we find two pairs of vertices to be merged: we are not restricted to one pair per height. Merged vertices are colored in red. The artificial root is colored in black.

Connection between a forest and its compressed form

Origin Whenever a DAG 𝐷 compresses a forest 𝐹 = {𝑇 1 , . . . , 𝑇 𝑛 }, it can be useful to retrieve, for each vertex in 𝐷, in which trees they originally appear -say, for instance, that you need to decompress only a single tree. For any vertex 𝑣 ∈ 𝐷, the origin of 𝑣 is defined as

o(𝑣) = {𝑖 ∈ [[1, 𝑛]] : ℜ -1 (𝐷[𝑣]) ∈ 𝒮(𝑇 𝑖 )}. (2.3)
In other words, o(𝑣) represents the set of trees in 𝐹 for which ℜ -1 (𝐷[𝑣]) is a subtree.

The calculation of o(•) all comes down to how the origins are attributed to the roots. Since we control the order in which the trees are inserted under the artificial root of 𝐷, if one wants to keep the original order, it is then sufficient to place them so that the root of 𝑇 𝑖 is the 𝑖-th child of the root -and therefore this node receives origin {𝑖}.

Once the roots have received their origin, the origin of all other vertices can be recursively calculated on the DAG as follows. Presence By construction, the DAG compression 𝐷 of a tree 𝑇 eliminates all repetitions of isomorphic subtrees. It can be useful to know how many copies of each of these subtrees exist in 𝑇, without having to decompress the tree.

We define the presence of a vertex 𝑣 ∈ 𝐷, denoted by 𝜋(𝑣), as 𝜋(𝑣) = #{𝑢 ∈ 𝑇 : [𝑢] = 𝑣}. Presence can be recursively computed using the following formula

𝜋(𝑣) =        1 if 𝑣 = ℛ(𝐷), 𝑝∈𝒫(𝑣)
𝑛(𝑝, 𝑣) 𝜋(𝑝) otherwise; (2.4) where 𝑛(𝑝, 𝑣) is the number of arcs between vertices 𝑝 and 𝑣.

In the case where 𝐷 compresses a forest 𝐹 = {𝑇 1 , . . . , 𝑇 𝑛 }, we associate to each vertex a presence vector 𝜋(𝑣), so that each component 𝜋 𝑖 (𝑣) corresponds to the presence of 𝑣 in 𝑇 𝑖 . The previous formula can be adapted as Summing over all 𝑝 ∈ 𝒫(𝑣) leads 𝜋 𝑖 (𝑣) to be correct as well.

𝜋(𝑣) =       
In the light of Proposition 2.8 and Proposition 2.9, the origin and presence of any vertex can be computed in linear time in one exploration of the DAG. Tree cipherings 3 , but has been largely rewritten. In particular Section 3.3 is new material.

The Tree Ciphering Isomorphism Problem

Motivation

A tale of ciphers

Substitution ciphers Substitution ciphers are one of the oldest encryption methods. It consists in replacing each letter of a sequence by a given sign (possibly another letter). A simple substitution cipher imposes that the mapping between the letters and their substituted signs is a bijection. Formally, given two alphabets 𝒜 and ℬ, a simple substitution cipher is a bijection 𝑓 : 𝒜 → ℬ. Given a message 𝑤 = 𝑎 1 • • • 𝑎 𝑛 , with 𝑎 𝑖 ∈ 𝒜, the encrypted message is given by 𝑓 (𝑤) = 𝑓 (𝑎 1 ) • • • 𝑓 (𝑎 𝑛 ).

A famous example of a simple substitution cipher is Caesar's code, where 𝒜 = ℬ, and where 𝑓 is a cyclic permutation -i.e., the letters are simply shifted a few ranks in the alphabet. Another well-known example is the pigpen cipher, which places the letters of the alphabet on a grid, and replaces them by the local topology of the grid where they are placedsee Figure 3.1.

Simple substitution ciphers are easily broken, e.g. by frequence analysis [START_REF] Gardner | Codes, ciphers and secret writing[END_REF] [63]: [START_REF] Gardner | Codes, ciphers and secret writing[END_REF], Codes, ciphers and secret writing . Typically, the letter E is the most frequent in English, followed by T, etc [START_REF] Mark | Tables of single-letter and digram frequency counts for various word-length and letter-position combinations[END_REF] . The recurrence of letters in the encoded message can be analyzed to make guesses. Using statistics, we can measure the adequation between the observed frequency distribution with the expected one (when the source language is known), e.g. via 𝜒 2 tests [START_REF] Savarese | The Caesar Cipher[END_REF] [65]: [START_REF] Savarese | The Caesar Cipher[END_REF] where there are not (bottom). In the latter, the message is not parsed in its entirety since an inconsistency is detected before completion.

In the sequel, we consider only simple substitution ciphers, shortened to ciphers.

A silly ciphering problem

Assume one has at one's disposal two messages of the same length, and one want to determine if there exists a cipher that transforms one message onto the other. This question is trivial, as the cipher is induced by the order of letters. Indeed, following the reading order, one can build the cipher letter by letter, until either (i) one gets to the end of the message, and answer Yes, or (ii) one maps two letters that break the bijection of the cipher, and the answer is No. This process actually defines an equivalence relation on messages of the same length, where two messages are equivalent if and only if the answer to the previous question is Yes. See Figure 3.2 for an illustration.

Same one, but with trees

We are actually interested in the declination of this toy problem in the case where messages are carried, not as an ordered sequence of letters, but as labels on nodes of trees. Rather than requiring that the messages are of the same length, we impose that the trees are isomorphic. Previously, the order of the letters provided the mapping of the labels; here, this role is fulfilled by tree isomorphisms, that are usually not unique. Actually, the number of isomorphisms between two trees is given by a product of factorials (see upcoming Equation 3.1 and illustrative Figure 3.4) and thus usually extremely large.

The tree ciphering isomorphism problem can then be stated as follows: given two isomorphic labeled trees, is there any tree isomorphism between them that induces a cipher of the labels? This also defines an equivalence relation on labeled trees, where two trees are equivalent if and only if the answer to the previous question is Yes (see upcoming Theorem 3.1). The problem is formally defined in the next section, while an example is now provided in Figure 3.3.

Remark 3.1

The tree ciphering isomorphism problem is only really interesting to solve for unordered trees, since the problem for ordered trees is strictly equivalent to the one of messages treated before, as any tree traversal converts the tree unambiguously into a sequence, and vice-versa -as seen in Encoding of trees (p. 11).

(left)

. There exist two tree isomorphisms between 𝑇 1 and 𝑇 2 , one inducing a cipher (middle) and the other one that does not (right). In the latter, the full tree isomorphism is not parsed as an inconsistency is detected before. Overall, the two labeled trees 𝑇 1 and 𝑇 2 are equivalent since at least one tree isomorphism leads to a cipher.

Connection with the graph isomorphism problem

If that was introduced under the name marked tree isomorphism in [START_REF] Kellog | Problems polynomially equivalent to graph isomorphism[END_REF] [24]: Booth et al. (1979), Problems polynomially equivalent to graph isomorphism , where it has been proved graph isomorphism complete, i.e. as hard as graph isomorphism. The latter is still an open problem, where no proof of NP-completeness nor polynomial algorithm is known [START_REF] Schöning | Graph isomorphism is in the low hierarchy[END_REF] [67]: [START_REF] Schöning | Graph isomorphism is in the low hierarchy[END_REF], 'Graph isomorphism is in the low hierarchy' .

One classic family of algorithms trying to achieve graph isomorphism are color refinement algorithms, also known as Weisfeiler-Leman algorithms [START_REF] Weisfeiler | The reduction of a graph to canonical form and the algebra which appears therein[END_REF] [68]: [START_REF] Weisfeiler | The reduction of a graph to canonical form and the algebra which appears therein[END_REF], 'The reduction of a graph to canonical form and the algebra which appears therein' . Both graphs are colored according to some rules, and the color histograms are compared afterwards: if they diverge, the graphs are not isomorphic. However, this test is incomplete in the sense that there exist non-isomorphic graphs that are not distinguished by the coloring. The distinguishability of those algorithms is constantly improved -see [START_REF] Grohe | Deep Weisfeiler Leman[END_REF] for recent results -but does not yet answer the problem for any graph. Actually, AHU algorithm for topological tree isomorphism can be interpreted as a color refinement algorithm.

Most methods from the literature -such as color refinement -do not explicitly construct the isomorphism between the two graphs; rather, they relabel a graph so that two isomorphic graphs have the same relabelling. This option is preferred since it allows to process graph datasets, either to eliminate isomorphic elements or to identify a graph in a database. For more details on the practical resolution of graph isomorphism problems, we refer the reader to [START_REF] Brendan | Practical graph isomorphism, II[END_REF] As discussed later in this chapter, in order to build a new type of DAG compression, taking into account the labels, we need to know explicitly the isomorphism between the two trees. For this reason, the method we have developed to address the (unordered) tree ciphering isomorphism problem, detailed in Chapter 4, departs from the literature and proposes an explicit construction instead of a relabelling.

Formal definition

The tree ciphering isomorphism problem, as motivated in the previous section, is formally introduced in this section. Nevertheless, we first present results on the number of isomorphisms between two trees.

On the number of tree isomorphisms

Ordered trees Given two ordered trees 𝑇 1 and 𝑇 2 , if 𝑇 1 ≃ 𝑇 2 , then # Isom(𝑇 1 , 𝑇 2 ) = 1. Indeed, let 𝜙 and 𝜓 be two elements of Isom(𝑇 1 , 𝑇 2 ). Denoting 𝑟 1 (respectively 𝑟 2 ) the root of 𝑇 1 (respectively 𝑇 2 ) and 𝑐 1 , . . . , 𝑐 𝑘 the children of 𝑟 1 in this order (respectively 𝑠 1 , . . . , 𝑠 𝑘 ); we have 𝜙(𝑟 1 ) = 𝑟 2 = 𝜓(𝑟 1 ) and 𝜙(𝑐 𝑖 ) = 𝑠 𝑖 = 𝜓(𝑐 𝑖 ). By induction, this applies to all nodes of 𝑇 1 and 𝑇 2 and therefore 𝜙 = 𝜓. The method for computing 𝑛 ≃ (𝑇) is highlighted in both cases: for 𝑇, nodes susceptible to be swapped are boxed together; for ℜ(𝑇), multiplicity of arcs and presence are indicated. Eitherway, 𝑛 ≃ (𝑇) = (2!) 3 = 8.

Unordered trees

In the unordered case, any tree isomorphism 𝜙 : 𝑇 1 → 𝑇 2 maps 𝑢 ∈ 𝑇 1 onto 𝑣 = 𝜙(𝑢) ∈ 𝑇 2 only if [𝑢] = [𝑣] and 𝜙(𝒫(𝑢)) = 𝒫(𝑣). Thus, any tree isomorphic to 𝑇 1 can be obtained by swapping nodes (i) of same equivalence class and (ii) children of same node. Consequently, the number of tree isomorphisms between 𝑇 1 and 𝑇 2 depends only on the class of equivalence of 𝑇 1 (equivalently 𝑇 2 ), and will be denoted by 𝑛 ≃ (𝑇 1 ). For any unordered tree 𝑇, we have An example is provided in Figure 3.4.

𝑛 ≃ (𝑇) = 𝑢∈𝑇 𝑞∈{[𝑣]:𝑣∈𝒞(𝑢)} (#{𝑣 ∈ 𝒞(𝑢) : [𝑣] = 𝑞})!. ( 3

Tree ciphering isomorphism

From now on, we assume that trees are labeled, ordered or unordered.

Recall that the label of node 𝑢 is denoted by 𝑢, and that we denote by 𝒜(𝑇) the set of labels -the alphabet -of a tree 𝑇.

Let 𝑇 1 and 𝑇 2 be two topologically isomorphic labeled trees and 𝜙 ∈ Isom(𝑇 Proof. The proof can be found in Appendix A.2.

Remark 3.2

We just defined with ∼ a generalisation of tree isomorphisms. Indeed, it suffices to add the same arbitrary, artificial, label to all nodes of considered trees, and then, it is equivalent for two trees to be (classically) isomorphic or isomorphic up to cipher (the cipher being the identity function in this case).

Remark 3.3

It is possible to be more restrictive on the choices of ciphers. Let (𝐺, •) be a subgroup of the bijections between 𝒜(𝑇 1 ) and 𝒜(𝑇 2 ). Then, if we replace "𝑅 𝜙 is a bijection" in Definition 3.1 by "𝑅 𝜙 ∈ 𝐺", the induced relation ∼ 𝐺 is also an equivalence relation.

For instance, with 𝐺 = {id}, 𝑇 1 ∼ 𝐺 𝑇 2 means 𝑇 1 ≃ 𝑇 2 together with the equality of labels. This (very) restricted definition has already been used to adapt DAG compression to labeled trees in Section 2.3.

The tree ciphering isomorphism problem is to determine, given two labeled isomorphic trees, whether or not there exists a tree ciphering between them. The purpose of Chapter 4 is precisely to build, algorithmically, a ciphering when it exists. We already mentioned that the tree ciphering isomorphism problem is trivial to solve on ordered trees. Indeed, since there is only one tree isomorphism between two ordered trees, either it is also a cipher, or not -there is no algorithmic problem to solve. On the other hand, due to Equation 3.1, the number of isomorphisms between two unordered trees can be exponentially large, which makes the task of finding a cipher difficult, as investigated in Chapter 4.

The sequel of this chapter is dedicated to the construction of a DAG compression based on this new equivalence relation. First, however, we introduce two additional results.

Whenever 𝑇 1 and 𝑇 2 are isomorphic up to a cipher, then so are their matching subtrees; more precisely, we have the following result.

Proposition 3.2 If 𝑇 1 ∼ 𝑇 2 and 𝜙 ∈ Cipher(𝑇 1 , 𝑇 2 ), then ∀𝑢 ∈ 𝑇 1 , 𝑇 1 [𝑢] ∼ 𝑇 2 [𝜙(𝑢)].
Proof. The proof is deferred to Appendix A.2.

In addition, if 𝑇 1 and 𝑇 2 are isomorphic up to a cipher, and if there also exist two subtrees in 𝑇 1 isomorphic up to a cipher, then so are their counterparts in 𝑇 2 , as per the next proposition.

Proposition 3.3 Let 𝑇 1 ∼ 𝑇 2 and 𝜙 ∈ Cipher(𝑇 1 , 𝑇 2 ); if there exist 𝑢, 𝑣 ∈ 𝑇 1 such that 𝑇 1 [𝑢] ∼ 𝑇 1 [𝑣], then 𝑇 2 [𝜙(𝑢)] ∼ 𝑇 2 [𝜙(𝑣)].
Proof. The proof is deferred to Appendix A.2.

A new kind of DAG compression

As seen in Section 2.3, a tree can be represented more concisely by eliminating its structural redundancies. This DAG compression is derived from tree isomorphisms introduced in Section 2.2. We already mentioned the possibility of extending DAG compression to labeled trees, only if we impose label equality. Since we now have a notion of isomorphism allowing to take into account labels in a less trivial way, we propose in this section to build a new DAG compression, based on isomorphisms up to a cipher.

Intuition

Before more formal considerations, we propose here to introduce the concept of DAG compression with labels via a geometrical intuition. Consider the tree of Figure 3.6, where the label on each node is the (𝑥, 𝑦) coordinates of the node in the drawing. Nodes are colored according to their equivalence class (with respect to ∼). Although not shown on the DAG, note that each node in the DAG carries a label, which are here the coordinates of the node in 𝑇 chosen to represent its equivalence class. Since the transformations between leaves have not been made explicit, the arcs leading to them do not carry any informationand are not complete with respect to the DAG construction.

𝑥 𝑦 (0, 0)

𝑇 𝑆 𝑥=0 𝑆 𝑦=𝑥 ℜ ∼ (𝑇) id id 𝑆 𝑥=0 id 𝑆 𝑦=𝑥
We can observe a number of symmetries in this tree: the red subtrees are obtained by symmetry around the y-axis, and the blue subtrees by symmetry around the axes 𝑦 = -𝑥 and 𝑦 = 𝑥. In the context of ciphers, red subtrees are isomorphic, and blue ones too (so are leaves, trivially, since 𝑢 ↦ → 𝑣 is always bijective). Remark 3.4 This example also gives us an illustration of Proposition 3.2 and Proposition 3.3, where 𝑇 1 and 𝑇 2 are the red subtrees: ▶ The dashed blue subtree at the bottom left is the symmetric along the y-axis of the blue subtree at the bottom right, and they are isomorphic.

▶ The two dashed blue subtrees on the left are isomorphic, and so are their counterparts on the right.

Since the left red subtree is obtained by symmetry from the right red subtree, if we keep only the geometry of the right tree and the axis of symmetry, we can perfectly reconstruct the original tree. Recursively, since the top left blue subtree is obtained by symmetry from the bottom left blue subtree, retaining only the geometry of the second and the axis of symmetry also allows the reconstruction of both. Same thing for the leaves, even if the transformations are not explicit on the drawing.

As we do this, we are in fact building a DAG -also shown in Figure 3.6.

When we have several subtrees isomorphic up to a cipher (symmetries in our example), we retain the labels of only one (it is the representative of its equivalence class) and all the ciphers allowing to reconstruct the other elements of its equivalence class. We place those ciphers on the arcs leading to the vertex in the DAG compressing the chosen subtree, and depending on which path we follow in the DAG, we reconstruct different subtrees by composing the ciphers.

Remark 3.5 Note that one of the arcs always bears the identity cipher, which allows to reconstruct the subtree chosen as representative of its equivalence class.

For example, if we want to reconstruct the top left blue subtree of Figure 3.6, we start by following the arc bearing 𝑆 𝑥=0 (which allows us to reconstruct the left red subtree from the right one) and then the arc bearing 𝑆 𝑦=𝑥 (which allows us to reconstruct the top blue subtree from the bottom one).

Definition

Let 𝑇 be a labeled tree, and 𝑣 ∈ 𝑇. We denote by . For each such 𝑢 -there are as many as 𝑛(𝑏, 𝑞) -we annotate the corresponding arc 𝑞 → 𝑏 with the cipher 𝑓 𝜙 -as defined in Equation 3.4. Note that we lose the dependency on 𝜙 since it is implicit in the graph of 𝑓 𝜙 . Note also that -as claimed in Remark 3.5 -for each vertex, there is always at least one entering arc annotated with id, as 𝑇[𝑠(𝑏)] id -→ 𝑇[𝑠(𝑏)].

Remark 3.6

It is essential to note that the arcs annotated with the identity do not bear the same identity. On the example of Figure 3.7, one of the identities represents the tree ciphering of 𝑇[𝑢 2 ] on itself, and thus corresponds to 𝑢 2 ↦ → 𝑢 2 ; while the other identity represents the tree ciphering of 𝑇[𝑢 4 ] on itself, and thus corresponds to 𝑢 4 ↦ → 𝑢 4 ; 𝑢 7 ↦ → 𝑢 7 and 𝑢 8 ↦ → 𝑢 8 . Nevertheless, for the sake of simplicity, we note indifferently id in the sequel, regardless of the actual domain of definition.

Following all these steps, we get a new graph Q(𝑇) whose construction is illustrated in Figure 3.7. We still call this graph the DAG compression of 𝑇 but denote it ℜ ∼ (𝑇). Note that this DAG is not unique: when we have different possible choices of representatives for a vertex, each choice leads to a DAG whose arc and vertices will carry different information. This is not a problem, however, since whatever choices are made, this compression is lossless and the original tree can be reconstructed. Theorem 3.5 𝑇 can be reconstructed from ℜ ∼ (𝑇) -up to a tree isomorphism. Note that we are reconstructing the tree up to a tree isomorphism, not a tree ciphering. In other words, the labels are reconstructed exactly (and not up to a cipher). Since tree cipherings requires topological isomorphism, we adapt Algorithm 2, adding new instructions to deal with labels, and propose Algorithm 5. The difference with the previous algorithm is only in the assignment of label values, therefore the topology is correctly reconstructed (up to a tree isomorphism) by virtue of Theorem 2.5.

Algorithm 5:

RebuildTreeWithCipher

Input: ℜ ∼ (𝑇), 𝑞 ∈ ℜ ∼ (𝑇), 𝑓
Let 𝑡 be a single-node tree with label 𝑓 (𝑞) for 𝑏 ∈ 𝒞(𝑞) do

Let 𝑔 be the cipher on arc 𝑞 → 𝑏

Let 𝑡 𝑏 = RebuildTreeWithCipher(ℜ ∼ (𝑇), 𝑏, 𝑓 • 𝑔)
/* By construction of ℜ ∼ (𝑇), the image of 𝑔 is a subset of the domain of 𝑓 , so that

𝑓 • 𝑔 is well defined. */
Add 𝑡 𝑏 as last subtree of 𝑡

return 𝑡

Proof. Let 𝐷 = ℜ ∼ (𝑇) and 𝜏 = RebuildTreeWithCipher(𝐷, ℛ(𝐷), id). Since the topologies of 𝑇 and 𝜏 are identical (up to a tree isomorphism), it suffices to show that the labels of 𝑇 are correctly reproduced in 𝜏.

We proceed by induction on the subtrees chosen to represent their equivalence class. The base case concerns leaves. One of the leaves 𝑙 ∈ ℒ(𝑇) has been chosen to represent the class of leaves 14 in 𝐷.

At least one of the arcs leading to [[𝑙]] in the DAG bears the cipher id, by construction (as the representative of a class is isomorphic to itself). The parent of [[𝑙]

] by this arc admits itself an entering arc bearing id, and so on up to the root of 𝐷 -as stated in Remark 3.5. Therefore, during the reconstruction, one of the paths passes only through arcs bearing id, and thus one of the leaves of 𝜏 admits the label 𝑙. The base case is thus proven: the subtree chosen to represent its class (here the leaves) is well labeled in the reconstruction.

We denote by 𝑟 and 𝜌 the roots of 𝑇 and 𝜏, respectively. We partition 𝒞(𝑟) by equivalence class. All classes are addressed identically, so let 𝑏 be one of them, and

𝐶 𝑏 = {𝑢 ∈ 𝒞(𝑟) : [[𝑢]] = 𝑏}.
By definition, #𝐶 𝑏 = 𝑛(𝑏, ℛ(𝐷)); therefore, when reconstructing, we add as many subtrees to 𝜌. We know that these subtrees 𝐶 ′ 𝑏 are isomorphic (with respect to ≃) to those of 𝐶 𝑏 as the algorithm preserves the topology; we now show that they are correctly labeled.

One of the elements of 𝐶 𝑏 , 𝑠(𝑏), has been chosen as the representative of 𝑏. Since the elements of 𝐶 𝑏 are isomorphic up to a cipher, for any 𝑢 ∈ 𝐶 𝑏 , there exists

𝜙 ∈ Cipher(𝑇[𝑠(𝑏)], 𝑇[𝑢]) so that 𝑇[𝑠(𝑏)] 𝜙 -→ 𝑇[𝑢]
-whose associated cipher 𝑓 𝜙 was placed on one arc between ℛ(𝐷) and 𝑏 in the DAG.

By induction, we know that the subtree of 𝐶 ′ 𝑏 reconstructed from 𝑠(𝑏) has been correctly labeled (following the arc bearing id). Therefore, the counterpart of 𝑢 in 𝐶 ′ 𝑏 , reconstructed by following the arc carrying 𝑓 𝜙 , is also correctly labelled since 𝑇[𝑠(𝑏)] 𝜙 -→ 𝑇[𝑢] -just traverse the reconstructed subtree from 𝑠(𝑏), and apply 𝑓 𝜙 on each label.

Since the roots are the only nodes in their equivalence class, it follows that 𝑇 and 𝜏 are identically labeled.

Construction

To be isomorphic up to a cipher, two trees must already be isomorphic. In particular, two nodes with the same equivalence class with respect to ∼ must already have the same equivalence class with respect to ≃. Thus, to compute equivalence classes [[•]], one must also know the equivalence classes [•]. We therefore propose to construct ℜ ∼ (𝑇) directly from ℜ(𝑇), which precisely has already associated to each node 𝑣 of the tree 𝑇 its equivalence class [𝑣]. Since the topology is already taken into account, all that remains is to consider the labels, which is obtained by virtue of Algorithm 6.

Principle

The main idea of the algorithm is, in a top-down approach, to visit each node 𝑞 of ℜ(𝑇) and to partition the nodes 𝑇(𝑞) = {𝑢 ∈ 𝑇 : [𝑢] = 𝑞} according to their equivalence class with respect to ∼. We construct a partition 𝔓, such that for 𝑃 ∈ 𝔓, all elements of 𝑃 have the same equivalence class. One representative per class is arbitrarily chosen, denoted by 𝑠(𝑃). Note that in line 8, when we check if the current node 𝑢 ∈ 𝑇(𝑞) belongs to an already identified class, by testing whether 𝑢 ∼ 𝑠(𝑃), we have not yet introduced the algorithm for doing this verification. The purpose of Chapter 4 is to build this algorithm; we assume for the moment its existence. Also, for nodes 𝑢 not chosen to represent their class, we must remove 𝒟(𝑢) from the sets 𝑇(𝑞 ′ ) in the rest of the DAG. This ensures that the condition of Equation 3.5 is satisfied, and thus that we can reconstruct 𝑇 by virtue of Theorem 3.5.

Then, in a second step, for each element 𝑃 of the partition -thus for each identified equivalence class, we add a new node 𝑝 in the DAG, all of which collectively replace the previous node 𝑞. Each new node 𝑝 receives the label of 𝑠(𝑃). Then, for each node 𝑢 ∈ 𝑃, we know by hypothesis that 𝑢 ∼ 𝑠(𝑃), and thus that there exists 𝜙 ∈ Cipher(𝑇[𝑢], 𝑇[𝑠(𝑃)]) -we assume that the upcoming algorithm from Chapter 4 provides such a 𝜙. Since we go through the vertices of ℜ(𝑇) from top to bottom, we have already created the vertex corresponding to [[𝒫(𝑢)]] and we can therefore create an arc from it to 𝑝, bearing the cipher 𝑓 𝜙 . . We only need it for the representative 𝑠(𝑃) of each element 𝑃 of the partition 𝔓 to be able to recover, later, the equivalence class of the parent of the remaining nodes. This operation is related to Equation 3.5.

Remark 3.8

When we place the ciphers on the arcs (line 22), the information we have to store is proportional to the number of different labels observed on the considered subtree. In particular, one of the ciphers is the identity.

In light of Remark 3.6, one can see the identity as an abstract function that returns whatever argument is given to it, and that, when composed with another function, returns that function. Such an approach reduces 15: Implied, restricted in its domain to the numbers observed in 𝑇. 16: Idem.

the amount of information to be stored on the arcs.

𝑇 𝑞 0 𝑞 1 𝑞 2 𝑞 3 ℜ(𝑇) 2 3 2

Example of execution

We now illustrate the execution of the algorithm on an example, namely the tree 𝑇 of Figure 3.8. Let us first note that

▶ 𝑇[𝑢 1 ] ∼ 𝑇[𝑢 2 ]
, where the cipher is the function 15

𝑓 : 𝑥 ∈ R ↦ → 2𝑥; ▶ 𝑇[𝑢 3 ] ∼ 𝑇[𝑢 4 ]
, where the cipher is the function 16

𝑔 : 𝑥 ∈ R ↦ → 𝑥 2 ; ▶ 𝑇[𝑢 3 ] ≁ 𝑇[𝑢 5 ] since 3 would have two antecedents; ▶ 𝑇[𝑢 9 ] ∼ 𝑇[𝑢 10 ] and 𝑇[𝑢 9 ] ∼ 𝑇[𝑢 14 ], with the same cipher ℎ : 3 ↦ → 4; ▶ 𝑇[𝑢 9 ] ∼ 𝑇[𝑢 13 ]
with the cipher id : 3 ↦ → 3.

Remark 3.9 Note that the ciphers given above are not the only ones possible. For instance, the following cipher works equally well for trees

𝑇[𝑢 3 ] and 𝑇[𝑢 4 ]: 𝑔 ′ =          2 ↦ → 4, 3 ↦ → 16, 4 ↦ → 9.
The algorithm starts by considering the vertex 𝑞 0 . Since 𝑇(𝑞 0 ) = {𝑢 0 }, the partition contains only one element and we create a single vertex 𝑝 0 , which has as label 0 and no children. There is nothing to remove from the sets 𝑇(𝑞 ′ ). We obtain the graph described in Figure 3.9a.

Then, the vertex 𝑞 1 is treated, with 𝑇(𝑞

1 ) = {𝑢 1 , 𝑢 2 }. Since 𝑇[𝑢 1 ] ∼ 𝑇[𝑢 2 ]
-with cipher 𝑓 , the partition 𝔓 contains a single element 𝑃. Arbitrarily, 𝑠(𝑃) = 𝑢 1 . A new vertex 𝑝 1 is created, with label 1, and two arcs connecting 𝑝 0 and 𝑝 1 are created, bearing the ciphers id (for 𝑢 1 ) and 𝑓 (for 𝑢 2 ). The 0 nodes 𝑢 6 , 𝑢 7 and 𝑢 8 are removed from 𝑇(𝑞 2 ), as well as nodes 𝑢 15 to 𝑢 20 from 𝑇(𝑞 3 ). The resulting graph is shown in Figure 3.9b.

𝑝 0 𝑞 1 𝑞 2 𝑞 3 3 2 (a) After treating 𝑞 0 0 𝑝 0 1 𝑝 1 𝑞 2 𝑞 3 id 𝑓 2 (b) After treating 𝑞 1 0 𝑝 0 1 𝑝 1 2 𝑝 2 3 𝑝 ′ 2 𝑞 3 id 𝑓 id 𝑔 id (c) After treating 𝑞 2 0 𝑝 0 1 𝑝 1 2 𝑝 2 3 𝑝 ′ 2 3 𝑝 3 id 𝑓 id 𝑔 id id ℎ id ℎ (d) After treating 𝑞 3 -we obtain ℜ ∼ (𝑇)
For vertex 𝑞 2 , with 𝑇(𝑞 2 ) = {𝑢 3 , 𝑢 4 , 𝑢 5 }, the partition contains two elements: 𝑃 = {𝑢 3 , 𝑢 4 } and 𝑃 ′ = {𝑢 5 }. We set 𝑠(𝑃) = 𝑢 3 and 𝑠(𝑃 ′ ) = 𝑢 5 , and create two vertices 𝑝 2 and 𝑝 ′ 2 , with respective labels 2 and 3. Both are linked to 𝑝 1 , with arcs bearing ciphers id (for 𝑢 3 ) and 𝑔 (for 𝑢 4 ) for 𝑝 2 , and id (for 𝑢 5 ) for 𝑝 ′ 2 . 𝑢 11 and 𝑢 12 are then removed from 𝑇(𝑞 3 ), and we get the graph of Figure 3.9c.

Finally, considering vertex 𝑞 3 , with 𝑇(𝑞 3 ) = {𝑢 9 , 𝑢 10 , 𝑢 13 , 𝑢 14 }, the partition is reduced to a single element 𝑃 containing all the nodes from 𝑇(𝑞 3 ). We set 𝑠(𝑃) = 𝑢 9 , and create vertex 𝑝 3 , linked to 𝑝 2 and 𝑝 ′ 2 , where two arcs connect both vertex to 𝑝 3 , with ciphers id (for 𝑢 9 and 𝑢 13 ) and ℎ (for 𝑢 10 and 𝑢 14 ). The algorithm stops and returns Figure 3.9d.

Complexity

We are now interested in analyzing the complexity of Algorithm 6. We recall that Algorithm 3, to build ℜ(𝑇), has complexity 𝒪(#𝑇 deg(𝑇)) for ordered trees and 𝒪(#𝑇 deg(𝑇) log(deg(𝑇))) for unordered trees. Moreover, we do not (yet) have at our disposal the algorithm to check whether two trees are isomorphic up to a cipher. This algorithm will be presented in Chapter 4. Since this algorithm is called in Algorithm 6 to test whether subtrees of 𝑇 are isomorphic, the complexity of each of these calls can be bounded by the complexity of calling it on 𝑇 against itself, which we note as 𝐶 ∼ (𝑇).

Under the assumption that the bound above is valid, we have the following theorem.

Theorem 3.6 Algorithm 6 has complexity 𝒪(#𝑇 2 𝐶 ∼ (𝑇)).

Proof. The proof lies in Appendix A.3.

Compared to the classical DAG compression algorithm, the additional complexity can be explained by the phase where the subtrees are partitioned by equivalence class -the reader is referred to the proof for complete details. Between every two pines is a doorway to a new world.

John Muir

As already stated in Chapter 3 (notably in Remark 3.1), the problem of constructing a tree ciphering between two labeled trees is only a problem when the two trees are unordered. It is therefore assumed in this chapter that the trees considered are unordered. The goal of this chapter is to build an algorithm that decides whether a tree ciphering exists between two trees, and if so, builds it.

In Section 4.1, we discuss the difficulty of constructing a tree ciphering -we notably recall that the tree ciphering isomorphism problem is as difficult as graph isomorphism. We also present our srategy to address the problem.

Before introducing a two-fold algorithm -preprocessing then backtracking -to solve the problem in Section 4.3, we first define in Section 4.2 a number of tools and concepts used in our method. Finally, Section 4.4 analyses the effectiveness of the proposed algorithm -from a theoretical point of view but also with numerical simulations. , but has been largely rewritten. In particular, anything related to the backtracking part of the algorithm is new material; the theoretical analysis is also more extensive than in the original paper.

Most of this chapter is reproduced from [26]

Addressing the problem

The tree ciphering isomorphism problem (on unordered trees), previously introduced as "marked trees isomorpism" in [START_REF] Kellog | Problems polynomially equivalent to graph isomorphism[END_REF] [24]: Booth et al. (1979), Problems polynomially equivalent to graph isomorphism , has been proven to be difficult as the following theorem stands.

Theorem 4.1 The tree ciphering isomorphism problem is graph isomorphism complete.

The reduction from an instance of graph isomorphism to an instance of tree ciphering isomorphism is actually linear in the size of the graph, as per the upcoming proof, reproduced from [START_REF] Kellog | Problems polynomially equivalent to graph isomorphism[END_REF]Section 6.4]. Although not necessary for the understanding of this chapter, this linear reduction is of interest and will be discussed in Chapter 9.

Proof. Given a directed graph 𝐺, number its vertices from 1 to 𝑛. Build a tree 𝑇 𝐺 of height 2 such that (i) the root has label 0 and exactly 𝑛 children; (ii) the children of the root are labeled from 1 to 𝑛, each corresponding to a vertex of 𝐺; and (iii) the node labeled 𝑖 ∈ {1, . . . , 𝑛} has a child with label 𝑗 if there exists an arc 𝑖 → 𝑗 in 𝐺. Note that the graph can be reconstructed from the labeled tree. For any two graphs 𝐺 and 𝐺 ′ , if there exists a tree ciphering between 𝑇 𝐺 and 𝑇 𝐺 ′ , then 𝐺 and 𝐺 ′ are isomorphic, and reciprocally. We have seen with Equation 3.1 that the number of isomorphisms between two trees is expressed as a product of factorials. Since we explore this set to find a tree ciphering, it is not difficult to explain the theoretical difficulty of the problem with the combinatorial explosion of the cardinality of the search space.

An example of reduction is presented in

Remark 4.1 In [24]

[24]: Booth et al. (1979), Problems polynomially equivalent to graph isomorphism , the authorship of the term "marked trees" is attributed, via inner reference [START_REF] Ingels | A Reverse Search Method for the Enumeration of Unordered Forests using DAG Compression[END_REF], to D.G. Corneil, M. Klawe and A. Proskurowski, in an article announced as in preparation, and entitled "Marked trees and the graph isomorphism problem". Unfortunately, to the best of our knowledge, this paper was never published.

We also find the term "marked trees" in reference [10] of [START_REF] Babai | Monte-Carlo algorithms in graph isomorphism testing[END_REF] [70]: [START_REF] Babai | Monte-Carlo algorithms in graph isomorphism testing[END_REF], 'Monte-Carlo algorithms in graph isomorphism testing' , referring to an oral communication of M. Klawe, entitled "Marked trees are isomorphism complete". Unfortunately, once again, we were unable to find a written record of this communication.

To the best of our knowledge, the three authors previously mentioned have co-authored only one article [START_REF] Maria M Klawe | Isomorphism testing in hookup classes[END_REF] [71]: Klawe et al. (1982), 'Isomorphism testing in hookup classes' which does not mention the term marked trees. It would seem that besides the complexity result stated above, no research has been published on the practical resolution of the marked tree isomorphism problem, until our contribution.

As mentioned in Connection with the graph isomorphism problem (p. 25), there are efficient practical algorithms for dealing with graph isomorphism [START_REF] Brendan | Practical graph isomorphism, II[END_REF] , although it is still unclear whether the problem is theoretically solvable in polynomial time [START_REF] Schöning | Graph isomorphism is in the low hierarchy[END_REF] [67]: Schöning (1987), 'Graph isomorphism is in the low hierarchy' . These algorithms rely on assigning its equivalence class to a given graph -which is convenient for retrieving graphs from a database and processing graphs independently. However, none of these algorithms explicitly constructs an isomorphism between two graphs. We saw in Section 3.3 that to adapt DAG compression to labeled trees, we need to know explicitly the tree ciphering 𝜙 -or rather, the associated cipher 𝑓 𝜙 . Consequently, the algorithms of the literature for graph isomorphism are not adapted to our need.

In the sequel of this chapter, we propose an algorithm that explicitly builds a tree ciphering. The method we develop is closer to constrained matching problems on bipartite graphs [START_REF] Canzar | On tree-constrained matchings and generalizations[END_REF][START_REF] Mastrolilli | Constrained matching problems in bipartite graphs[END_REF] than to the usual techniques of graph isomorphism resolution. 17: Indeed, 𝜓 is a bijection from 𝑆 𝜓 to 𝐵 restricted to the image of 𝜓.

In details, since we are building two bijections simultaneously -one on trees and the other on labels -that must be compatible, the general idea is to use the constraints of one to make deductions about the other, and vice versa. For instance, whenever two nodes must be mapped together, so are their labels, and therefore you can eliminate all potential tree isomorphisms that would have mapped those labels differently.

The algorithm operates in two phases. First, preprocessing is designed to find as many deductions as possible on the mappings, each of which contributes to decreasing the size of the search space for a solution. When no more deductions are possible, the preprocessing phase stops. To complete (if feasible) the two bijections, and to explore the remaining space, we then launch a backtracking phase [START_REF] Dechter | Backtracking algorithms for constraint satisfaction problems; a survey[END_REF] [74]: Dechter et al. (1998), 'Backtracking algorithms for constraint satisfaction problems; a survey' . The idea is to choose a potential mapping, perform the mapping and look recursively if we can build a solution from this choice. If not, we backtrack to that choice and make another one. If no choice leads to a solution, then we conclude that the problem has no solution.

Framework

In this section, we introduce the tools and concepts that are necessary to understand the algorithm presented in the next section.

Partial bijections

The goal of the algorithm is to construct -if possible -two bijections: 𝜙 ∈ Isom(𝑇 1 , 𝑇 2 ) for the nodes, and 𝑓 : 𝒜(𝑇 1 ) → 𝒜(𝑇 2 ) for the labels (so that 𝑓 = 𝑓 𝜙 with the notation of Section 3.2). They will be built incrementally, starting as empty mappings ∅ ↦ → ∅. Therefore, we are going to increase their domain of definition and their image, as well as assessing at each update that they remain bijective.

A partial bijection 𝜓 from 𝐴 to 𝐵 is an injective function from a subset 𝑆 𝜓 of 𝐴 to 𝐵 17 . Let 𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵; suppose we want to determine if the couple (𝑎, 𝑏) is compatible with 𝜓 -in the sense that it respects (or does not contradict) the partial bijection. First, if 𝑎 ∈ 𝑆 𝜓 , then 𝑏 must be equal to 𝜓(𝑎). Otherwise, if 𝑎 ∉ 𝑆 𝜓 , then 𝑏 must not be in the image of 𝜓, i.e. ∀𝑠 ∈ 𝑆 𝜓 , 𝜓(𝑠) ≠ 𝑏. If those conditions are respected, then (𝑎, 𝑏) is compatible with 𝜓; furthermore, if 𝑎 ∉ 𝑆 𝜓 , then we can extend 𝜓 on 𝑆 𝜓 ∪ {𝑎} by defining 𝜓(𝑎) = 𝑏 so that 𝜓 remains a partial bijection.

Formally, for any 𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵, with 𝜓 a partial bijection from 𝐴 to 𝐵, we define

ExtBij(𝜓, 𝑎, 𝑏) = (𝑎 ∈ 𝑆 𝜓 =⇒ 𝜓(𝑎) = 𝑏) ∧ (𝑎 ∉ 𝑆 𝜓 =⇒ ∀𝑠 ∈ 𝑆 𝜓 , 𝜓(𝑠) ≠ 𝑏) (4.1)
so that ExtBij(𝑎, 𝑏, 𝜓) returns ⊤ if and only if the couple (𝑎, 𝑏) is compatible with the partial bijection 𝜓. For the sake of brevity, we assume that the procedure ExtBij also updates the partial bijection in the case 𝑎 ∉ 𝑆 𝜓 by defining 𝜓(𝑎) = 𝑏 -naturally only if the procedure returned ⊤.

In the sequel, ExtBij is used to update both partial bijections 𝜙 (from 𝑇 1 to 𝑇 2 ) and 𝑓 (from 𝒜(𝑇 1 ) to 𝒜(𝑇 2 )). However, if one uses a restricted version of ciphers as presented in Remark 3.3, one must design a specific version of ExtBij to update 𝑓 , accounting for the desired properties.

Key idea of the algorihm

The fundamental premise of the algorithm is based on the following observation: whenever two nodes are mapped in a tree ciphering, they must share the exact same topology (in the sense that the subtrees rooted in these nodes must be topologically isomorphic), and their labels are mapped together. Namely, let 𝜙 ∈ Cipher(𝑇 1 , 𝑇 2 ), 𝑢 ∈ 𝑇 1 and 𝑣 ∈ 𝑇 2 .

Observation 4.1 If 𝜙(𝑢) = 𝑣, then (i) depth(𝑢) = depth(𝑣); (ii) [𝑢] = [𝑣]; (iii) 𝑓 𝜙 (𝑢) = 𝑣.
These are necessary conditions, but not sufficient. However, if we find two nodes that are the only ones to share the same values on some or all of those criteria, then these two nodes must necessarily be mapped together. For instance, the roots are by definition the only nodes in each tree to have a depth of zero and therefore must be mapped together, without even considering the other criteria.

The core of the algorithm thus consists of partitioning, successively by considering each criterion one after the other, the nodes of each tree; and as soon as we find solitary nodes, we map them together. Moreover, whenever nodes are mapped together, this has repercussions on the whole partition, as per the following observation. The general concept of the algorithm is as follows. At a given instant, the nodes of the trees will be divided into three groups: those that have already been mapped, those that are in bags, and those that are in collections. Bags and collections are structures that will be defined in the following subsections. The nodes present in a bag all have in common some combination of the criteria defined above -and are therefore candidates to be mapped together. Collections contain sets of nodes sharing some criteria, but not yet distributed in bags.

We will define, for bags and collections, deduction rules allowing to change the distribution of nodes in these structures, notably by mapping them. For example, if a bag contains only two nodes, one from each tree, then we can map them together (like the roots in the example above).

Bags

A bag 𝐵 is a couple

(𝐵 1 , 𝐵 2 ) such that 𝐵 1 ⊆ 𝑇 1 , 𝐵 2 ⊆ 𝑇 2 ,
Let 𝐵 𝑢 = 𝐵 1 ∩ 𝐶 𝑢 and 𝐵 𝑣 = 𝐵 2 ∩ 𝐶 𝑣 4 if 𝐵 𝑢 ≠ ∅ and 𝐵 1 \ 𝐵 𝑢 ≠ ∅ then 5 Add (𝐵 𝑢 , 𝐵 𝑣 ) to B and (𝐵 1 \ 𝐵 𝑢 , 𝐵 2 \ 𝐵 𝑣 ) to B 6 SplitChildren(𝐵 𝑢 , 𝐵 𝑣 ) 7 SplitChildren(𝐵 1 \ 𝐵 𝑢 , 𝐵 2 \ 𝐵 𝑣 ) 8 Delete 𝐵 from B
Note that since the bags are modified (either via the children or the parents) after mapping two nodes, the number of bags meeting the prerequisite of Deduction Rule 4.1 can vary after each call to MapNodes. However, the process of deduction ends at some point since we can not map more nodes than there exist in the trees.

Collections

While bags contain nodes that can be mapped together, collections contain sets of nodes that are susceptible to be put together in a bag. The need for such structures arises -as will be seen later -when labels begin to be considered.

Formally, a collection 𝐶 is a couple (𝐶 1 , 𝐶 2 ) where 𝐶 1 ⊆ 2 𝑇 1 and 𝐶 2 ⊆ 2 𝑇 2 -denoting by 2 𝑆 the powerset of 𝑆. We impose the following additional constraints:

(i) ∀𝑃 ∈ 𝐶 𝑖 , ∃𝑎 ∈ 𝒜(𝑇 𝑖 ), ∀𝑢 ∈ 𝑃 𝑖 , 𝑢 = 𝑎 -i.e., all nodes from the same set share a common label. This common label is denoted by 𝑃. (ii) Denoting by 𝐶 𝑖 (𝑛) = {𝑃 ∈ 𝐶 𝑖 : #𝑃 = 𝑛}, #𝐶 1 (𝑛) = #𝐶 2 (𝑛) for all 𝑛 ∈ N. This common cardinality is denoted by #𝐶(𝑛). Note that the number of 𝑛's for which #𝐶(𝑛) > 0 is finite.

The set of all collections is denoted by C. The union of the nodes contained in the bags, in the collections and those already mapped must form a partition of the nodes; in other words, a node can belong at most to only one collection, and to only one set in it. Therefore, we redefine the function 𝜎 : 𝑇 1 ∪ 𝑇 2 → B ∪ C ∪{∅} that associates each node to the bag or the collection it belongs to -if any.

The first deduction rule on collections concerns the labels themselves.

If we find labels in a collection 𝐶 that are already mapped in 𝑓 , then we can isolate the corresponding sets from the rest of the collection. More precisely, denoting by 𝐶 𝑖 [𝑎] = {𝑃 ∈ 𝐶 𝑖 : 𝑃 = 𝑎}, we introduce the following deduction rule.

Deduction Rule 4.2 As long as there exist collections 𝐶 ∈ C and labels

𝑎, 𝑏 verifying 𝑓 (𝑎) = 𝑏, such that 𝐶 1 [𝑎] ≠ ∅ and 𝐶 1 \ 𝐶[𝑎] ≠ ∅, add the two following collections (𝐶 1 [𝑎], 𝐶 2 [𝑏]) and (𝐶 1 \ 𝐶 1 [𝑎], 𝐶 2 \ 𝐶 2 [𝑏]) to C -then remove 𝐶 from C.
Equivalently, we could verify

𝐶 2 [𝑏] ≠ ∅ and 𝐶 2 \ 𝐶 2 [𝑏] ≠ ∅ -if this
equivalence is not true, then the distribution of labels does not allow the construction of a cipher: we can conclude that

𝑇 1 ≁ 𝑇 2 .
The second deduction rule is complementary to the previous one. If a collection contains sets of same cardinality that all share a common label in 𝑇 1 and 𝑇 2 , then those labels must surely be mapped together.

Deduction Rule 4.3

As long as there exist collections 𝐶 ∈ C, integers 𝑛 ∈ N and labels 𝑎, 𝑏 not already mapped in 𝑓 , such that ∀𝑃 ∈ 𝐶 1 (𝑛), 𝑃 = 𝑎 and ∀𝑄 ∈ 𝐶 2 (𝑛), 𝑄 = 𝑏, then call ExtBij( 𝑓 , 𝑎, 𝑏).

If it returns ⊥, conclude that 𝑇 1 ≁ 𝑇 2 .
The last deduction rule concerns the cardinalities: if #𝐶(𝑛) = 1, then the two corresponding sets must form a bag, and their labels must be mapped together -if not already the case. The three previous rules are illustrated in Figure 4.3. Since each deduction rule modifies the collections or the label mapping, each time a deduction is made, we have to look again if one of them applies.

As in Observation 4.2, once two nodes are mapped, this provides information on the mapping of their parent and children. Here is how to take into account this information when dealing with collections:

▶ For the parents, if they were found in a collection, they are mapped together and the other elements of their respective sets are put in a bag.

▶ For the children, the lines presented in Algorithm 9 must be inserted at the end of Algorithm 8. We send in new collections the elements whose intersection with 𝒞(𝑢) (respectively 𝒞(𝑣)) and their complementary are not null. The union of all the elements thus separated is used for the recursive calls, which terminate correctly since, once again, we end up reaching the leaves.

Note that since the bags and collections are modified after this operation, we must apply the Deduction Rules to check whether new deductions can be made or not.

On the cardinality of the search space

The search space for a tree ciphering is that of tree isomorphisms, whose size is given by Equation 3.1. Nevertheless, since the upcoming algorithm does not explicitly parse tree isomorphisms, but rather bijections between 𝑇 1 and 𝑇 2 , in order to directly construct an isomorphism that is already a cipher (if it is possible), we have to analyse the size of the search space differently. In fact, the whole point of bags and collections is to break the size of the bijection space -which is (#𝑇 1 )! -by partitioning the nodes increasingly finely.

First, a 𝐵 bag containing nodes in 𝑇 1 and as many in 𝑇 2 allows to create exactly (#𝐵)! mappings between them (possibly, not all mappings lead to a tree isomorphism). Then, given a collection 𝐶, since we can only put in bags sets of the same size, for each integer 𝑛, there are (#𝐶(𝑛))! possible ways to create bags, each of them yielding in turn 𝑛! possible mappings of the nodes, for a total of (#𝐶(𝑛))! × (𝑛!) #𝐶(𝑛) mappings. Hence, given B and C, the current size of the search space 𝑁(B, C) is given by

𝑁(B, C) = 𝐵∈B (#𝐵)! 𝐶∈C 𝑛 (𝑛!) #𝐶(𝑛) (#𝐶(𝑛))! . (4.2)
Therefore, subdividing bags and collections modifies the size of the search space, as follows:

▶ When a bag of size 𝑛 is split in two due to the action of SplitChildren, say with #𝑃 𝑢 = 𝑝, then we go from 𝑛! possibilities to 𝑝!(𝑛 -𝑝)!, reducing the space by a factor of 𝑛 𝑝 . ▶ When SplitChildren is applied to a collection, several sets can be split and put together in the same collection. Suppose we split 𝑘 sets 𝑃 of size 𝑛 into sets 𝑃 𝑢 of size 𝑝 (and sets 𝑃 \ 𝑃 𝑢 of size 𝑛 -𝑝), where 𝑘 ≤ min(#𝐶(𝑛), deg(𝑢)); we go from

(#𝐶(𝑛))! × (𝑛!) #𝐶(𝑛) possibilities to (#𝐶(𝑛) -𝑘)! × (𝑛!) #𝐶(𝑛)-𝑘 × 𝑘!(𝑝!) 𝑘 × 𝑘!((𝑛 -𝑝)!) 𝑘 .
The space is therefore modified by a factor of 1

𝑘! #𝐶(𝑛) 𝑘 𝑛 𝑝 𝑘 .
Because of the denominator which, depending neither on 𝑝 nor on 𝑛, can be arbitrarily large, it is possible, in some pathological cases, that this term is smaller than 1, and thus reflects an enlargement of the search space.

▶ When recursively mapping the parents of two nodes, if they were present in a bag 𝐵, we go from (#𝐵)! to (#𝐵 -1)!, reducing the space by a factor of #𝐵; if they were present in a collection 𝐶 and sets of size 𝑛, then we go from (#𝐶(𝑛))!(𝑛!) #𝐶(𝑛) possibilities to (#𝐶(𝑛) -1)!(𝑛!) #𝐶(𝑛)-1 × (𝑛 -1)!, reducing the space by a factor of #𝐶(𝑛) × 𝑛. ▶ When applying Deduction Rule 4.

The algorithm

The algorithm we propose to build a tree ciphering is split into two distinct phases. First, we will try to determine as many mandatory mappings as possible on the two bijections we are building, the one on the nodes and the one on the labels. Each mapping reduces the search space; thus the objective of this preprocessing phase is to break, as much as possible, the combinatorial complexity of the search space. Then, we start a backtracking procedure to complete the bijections -if possible.

Preprocessing part

Initialization Let 𝑇 1 and 𝑇 2 two labeled trees. To assess that 𝑇 1 ≃ 𝑇 2 , we call AHU algorithm -see The Aho, Hopcroft & Ullman algorithm (p. 13) -which concludes in linear time, while assigning to the nodes of 𝑇 1 and 𝑇 2 their equivalence classes under ≃ -which we will need later in the algorithm. Let 𝜙 : ∅ ↦ → ∅ and 𝑓 : ∅ ↦ → ∅. We initialize C = ∅ and B = {𝐵} where 𝐵 = ({𝑢 ∈ 𝑇 1 }, {𝑣 ∈ 𝑇 2 }). At this stage, the search space is exactly the bijections between the nodes of 𝑇 1 and 𝑇 2 , for a size of (#𝑇 1 )!. This space is much larger than Isom(𝑇 1 , 𝑇 2 ), and we aim to reduce its cardinality via successive partitioning in the sequel.

Throughout this section, the different steps will be illustrated on a running example, presented in Figure 4.4.

𝐵 𝑢 Depth Following point (𝑖) of Observation 4.1, we know that nodes susceptible to be mapped together must share a common depth. Therefore, we partition the only bag 𝐵 by depth, i.e., we define 𝑇 𝑖 (𝑑) = {𝑢 ∈ 𝑇 𝑖 : depth(𝑢) = 𝑑}, for 𝑑 ∈ {0, . . . , depth(𝑇 𝑖 )}, and add as many bags (𝑇 1 (𝑑), 𝑇 2 (𝑑)) in B -and we remove 𝐵 from B.

After this operation, we apply Deduction Rule 4.1. Since the roots are the only nodes with zero depth, the rule will at least apply to their bags and they will be mapped together. Parents Before considering labels in the next step, we focus first on Observation 4.2. To map two nodes together, their parents must also be mappable with each other. In particular, this implies that such parents belong to the same bag.

Formally, we inspect each bag 𝐵 = (𝐵 1 , 𝐵 2 ) in B by increasing depth (recall that at this point, all nodes of the same bag share the same depth and the same equivalence class). We partition the nodes of 𝐵 as follows: let 𝐵 𝑖 (𝑠) = {𝑢 ∈ 𝐵 𝑖 : 𝜎(𝒫(𝑢)) = 𝑠} -where 𝜎 is the function that associate, to a node, the bag it is contained in, if any. We then add a new bag (𝐵 1 (𝑠), 𝐵 2 (𝑠)) to B for each such 𝑠, and remove 𝐵 from B. Visiting the bags by increasing depth ensures that you have subdivided the bags containing the parents before turning to the children. Once all bags have been partitioned, apply again Deduction Rule 4.1.

This step is illustrated on the running example in Figure 4.7.

Labels

We finally consider the last point (𝑖𝑖𝑖) of Observation 4.1. We are interested in the labels on the nodes; this time, this criterion is not purely topological and for this reason we have to use collections. Indeed, except for the labels already mapped together in the previous deductions, we do not know which labels must go together, and we can not arbitrarily map them by creating bags. Once this procedure has been applied to all bags -and therefore B = ∅we apply Deduction Rule 4.2, Deduction Rule 4.3 and Deduction Rule 4.4 on C. In the case bags were to be created as a result of a deduction, apply also Deduction Rule 4.1. We emphasize that all these rules are intertwined and of the form "as long as. . . ": each deduction made imposes to check again all the rules; the process stops only when no more deductions are made. ▶ Collection 𝐶 ′′′ is split into two collections: 𝐶 (6) = ({{𝑢 5 }}, {{𝑣 6 }}) and 𝐶 (7) = ({{𝑢 6 }}, {{𝑣 5 }}).

𝐴 𝑢

𝑛 = 2 𝐶 ′′ 1 𝐶 ′′ 2 𝐶 ′′ 𝐵 𝑢 5 𝐴 𝑢 6 𝛼 𝑣 5 𝛽 𝑣 6 𝑛 = 2 𝐶 ′′′ 1 𝐶 ′′′ 2 𝐶 ′′′
▶ Collection 𝐶 is unchanged; ▶ Collection 𝐶 ′ is split into three collections: 𝐶 (1) = ({{𝑢 8 }}, {{𝑣 9 }}); 𝐶 (2) = ({{𝑢
𝐵 𝑢 The mapping on nodes and remaining bag (above), the remaining collections (below, left) and the mapping on labels (below, right) at the end of the preprocessing phase. The collection 𝐶 (5) has been split into two new collections 𝐶 * and 𝐶 * * , after the mapping of (𝑢 5 , 𝑣 6 ), via the SplitChildren procedure. The size of the final space is: 2! for the last bag, and 2! for each collections, for a total combined of 8. Note that this number is way below 𝑁 ≃ (𝑇 1 ) = 576, indicating that the preprocessing phase succeeded in reducing the size of the search space.

Deduction Rule 4.3 allows to map 𝑓 (𝐴) = 𝛼 (for instance, with collection 𝐶 (7) ), whereas Deduction Rule 4.4 create several bags, most of them with one node per component, allowing new mappings (via Deduction Rule 4.1), as displayed in Figure 4.9.

Conclusion After all this steps, the preprocessing phase is finished, and the backtracking starts.

Backtracking part

The pseudocode for the backtracking part is provided in Algorithm 11.

During the preprocessing phase, if an operation went wrong, we could immediately conclude that 𝑇 1 ≁ 𝑇 2 ; here it indicates that an unfortunate choice has been made and that another one must be made, if any remains. The detection of these unsuccessful cases is done in the pseudocode via the tags try and catch 19 . A number of new procedures are also introduced: SaveState, RestoreState and NextCandidates. The first two are self-explanatory, while the last one is presented in Algorithm 10.

The main idea behind the latter is the following: in a 𝐵 bag with 𝑛 nodes, we know that there are 𝑛! possible mappings; however, for backtracking, the search tree only needs to branch on 𝑛 children. Indeed, the first node 𝑢 of 𝐵 1 will have to be mapped to one of the nodes of 𝐵 2 , and so we consider all possible mappings between this node of 𝐵 1 and those of 𝐵 2 .

The same idea also applies to collections.

Algorithm 10: NextCandidates Note that all mapping choices between the remaining nodes and labels are acceptable, so the procedure will not go wrong and backtrack on this example.

Input: B, C 1 if B ≠ ∅ then 2 𝜆 ← B 3 Let 𝐵 = (𝐵 1 , 𝐵 2 ) ∈ B so that #𝐵 is minimal 4 Let 𝑢 ∈ 𝐵 1 5 𝐿 ← {(𝑢, 𝑣) : 𝑣 ∈ 𝐵 2 } 6 else if C ≠ ∅ then 7 𝜆 ← C 8 Let 𝐶 = (𝐶

Analysis of the algorithm

The interest of proceeding in two phases, compared to directly launching a backtracking procedure, is to break the cardinality of the search space to allow backtracking to be as fast as possible. From a theoretical point of view, we consider the size of the backtracking search tree, and show that our approach minimizes it. Then, on simulated data, we focus on (i) the extent to which preprocessing does break the cardinality of the search space, (ii) how the computing time is divided between preprocessing and backtracking and (iii) how the algorithm behaves when the trees are not isomorphic -versus when they are.

Theoretical analysis

In spite of an intricate back and forth structure between nodes, bags and collections (notably through deductions rules), which makes it difficult to evaluate the complexity of our algorithm, we have a few comments to offer regarding this matter. Proof. Already, we can note that it is not necessary to scan all the bags and collections at each call: if this allows to lighten the pseudocode, the best way to do it, since we dispose of the function 𝜎 which associates to each node the bag or collection in which it is stored, is to scan only the bags and collections related to the sets 𝐶 𝑢 and 𝐶 𝑣 .

SplitChildren procedure

In particular, since the recursive calls are made on children, i.e. with increasing depth, the same bag or collection is processed only once throughout the calls -since the nodes have been partitioned by depth.

Splitting each bag or element of a collection into two is done in linear time -assuming that checking whether a node is present in 𝐶 𝑢 (or 𝐶 𝑣 ) or not is done in constant time (e.g. with a hash table). In addition, it is necessary to pay twice the computation time of the children (one per recursive call) -this number is bounded by 𝑑 per node.

We can then evaluate the total complexity of the algorithm (including recursive calls), assuming that all bags and collections are visited, to be in the order of

𝐵∈B #𝐵 + 𝐶∈C 𝑘∈N 𝑘#𝐶(𝑘) (2𝑑 + 1).
Since the bags and collections are composed of the nodes of 𝑇 1 and 𝑇 2 , the bracketed term can not be greater than 𝑛, concluding the proof.

Preprocessing part Ignoring the possible recursive call to parents, the expected complexity for MapNodes -Algorithm 7 -is roughly the same of SplitChildren. Since we can not map more nodes than there are in the trees, the number of calls to MapNodes during preprocessing is bounded by the size of the trees, leading to a complexity for this part of 𝒪(𝑛 2 𝑑)ignoring deductions and partitions of the nodes.

Backtracking part

The underlying structure behind the backtracking step is a search tree -whose nodes we call states. In the best case, we simply traverse it from the root to a leaf; in the worst case, we explore the entirety of it. Ensuring that the tree has a minimal number of states is therefore of utmost importance to guarantee that the algorithm finishes rapidly, even in the worst case. 20: Note that it is the multiplicative factor before 𝑒 -1 that can be reduced -see the proof for complete details.

Theorem 4.3 To minimize the size of the backtracking tree,

▶ one must process the bags before the collections; ▶ if there are only bags left, the bag 𝐵 with the smallest cardinality #𝐵 must be processed first; ▶ if there are only collections left, the collection 𝐶(𝑛) with the largest 𝑛 must be processed first; in case of a tie, process first the one with the smallest #𝐶(𝑛);

where "process" 𝐶(𝑛) means to choose 𝑃 ∈ 𝐶 1 (𝑛) and 𝑄 ∈ 𝐶 2 (𝑛) and put them in a bag.

Proof. The proof can be found in Appendix A.4.

Among all algorithms determining the order in which to process bags and collections based on their cardinality, for backtracking, Algorithm 10 is optimal since it implements the strategy induced by the previous theorem.

To give an order of magnitude, we also have the following result (valid even without optimizing the processing order of the bags and collections), that illustrates the interest of preprocessing in reducing the size of the search space as much as possible.

Proposition 4. [START_REF] Chaudhury | Skeletonization of plant point cloud data using stochastic optimization framework[END_REF] The size of the backtracking tree is bounded by 2(𝑒 -1)𝑁(B, C), with 𝑁(B, C) as defined in Equation 4.2.

Proof. The proof can also be found in Appendix A.4.

The leaves of the backtracking tree correspond to each of the possible mappings from (B, C) at the end of preprocessing; thus there are 𝑁(B, C) leaves. The previous result shows that the size of the tree is linear in the quantity of items that we want to enumerate. The constant, here 2(𝑒 -1), expresses how parsimonious the approach is.

If we consider the enumeration tree of all permutations of [[1, 𝑛]], whose number of leaves is 𝑛!, the size of this tree is bounded by (𝑒 -1)𝑛! -see [START_REF] Donald | Fascicle 2: Generating All Tuples and Permutations (Art of Computer Programming[END_REF] [ . If we take this constant, 𝑒 -1, as a baseline of what we can expect to obtain, our constant is only twice as large. Actually, Proposition 4.4 being valid regardless of the order in which bags and collections are processed, the actual constant after optimization is likely to be smaller 20 .

Note also that the complexity to explore each state depends on the state, via the possible deductions and calls to SplitChildren made.

In the rest of this section, we investigate the experimental behavior of our algorithm.

21: We actually use max(⌊𝑝𝑛⌋, 1) in our implementation to avoid pathological cases.

22: Note that this change of a single label to break the isomorphism is made to make the task of detecting the non-isomorphism as difficult as possible.

Experimental protocol

Given two labeled trees 𝑇 1 and 𝑇 2 assumed to be isomorphic up to a cipher, we expect that the complexity of establishing that 𝑇 1 ∼ 𝑇 2 depends only on

[[𝑇 1 ]] = [[𝑇 2 ]].
In particular, for a labeled tree 𝑇, the ratio 𝑝 = # 𝒜(𝑇) #𝑇 is especially interesting to consider. Indeed, if 𝑝 = 1/#𝑇 or 𝑝 = 1, any tree isomorphism is also a tree ciphering -in which case the first isomorphism found is sufficient. If 𝑝 takes intermediate values, the space of tree cipherings is strictly smaller than the one of tree isomorphisms -and one can not use just any one of them. Remark 4.2 Note that we can identify if trees 𝑇 1 and 𝑇 2 are in one of these two special cases (𝑝 = 1 or 𝑝 = 1/#𝑇 𝑖 ) by a linear traversal of the nodes. Since the first isomorphism we find fits, we can easily construct one in linear time. We start by associating to each node its equivalence class -see The Aho, Hopcroft & Ullman algorithm (p. 13) -before mapping the roots. Then, for each pair of mapped nodes, for each equivalence class identified in their children, we map the 𝑛-th child of this class in 𝑇 1 with the 𝑛-th in 𝑇 2 , and so on recursively.

We shall see it later, but our algorithm obtains worse performances if we use it on trees in one of these two cases. So it seems better in this context to use this much simpler procedure instead.

With 𝑛 and 𝑝 fixed, we construct a tree 𝑇 1 with 𝑛 nodes and a proportion of labels equal to 𝑝 as follows. We draw uniformly at random ⌊𝑝𝑛⌋ nodes 21 and they receive the labels 1, . . . , ⌊𝑝𝑛⌋ in this order. The remaining nodes are randomly assigned a label between 1 and ⌊𝑝𝑛⌋. For 𝑝 = 1/𝑛, all nodes receive instead the same label, and for 𝑝 = 1, within a linear traversal of the trees, the 𝑖-th node visited receives label 𝑖. 𝑇 2 is then obtained as a copy of 𝑇 1 , where we shuffled the children of each node. In this case,

𝑇 1 ∼ 𝑇 2 .
To test the case 𝑇 1 ≁ 𝑇 2 , we created a copy 𝑇 ′ 2 of 𝑇 2 , and for a randomly chosen node 𝑢 in 𝑇 ′ 2 , we replaced its label 𝑢 by another one, according to the following procedure. If each label appears only once in the tree -i.e., 𝑝 = 1, then we select a node 𝑢 at random and give it a label randomly drawn among 𝒜(𝑇 2 ) \ {𝑢}. Otherwise, we draw a node 𝑢 at random among all the nodes whose label is present at least twice in the tree, and we give it a new label max(𝒜(𝑇 2 )) + 1. In both cases, 𝑇 1 ≁ 𝑇 ′ 2 22 -notably because, trivially, # 𝒜(𝑇 1 ) ≠ # 𝒜(𝑇 ′ 2 ). We generated 100 couples of trees (𝑇 1 , 𝑇 2 ) and (𝑇 1 , 𝑇 ′

2 ) for each pair (𝑛, 𝑝), where 𝑛 ∈ {25𝑘 : 2 ≤ 𝑘 ≤ 10} and 𝑝 ∈ {1/𝑛} ∪ {𝑘/10 : 1 ≤ 𝑘 ≤ 10} -so 9,900 trees for each case, 𝑇 1 ∼ 𝑇 2 and 𝑇 1 ≁ 𝑇 2 .

The preprocessing breaks the cardinality of the search space

As stated in On the cardinality of the search space (p. 43), the size of the current search space 𝑁(B, C) is given by Equation 4.2 and must be related to the size of Isom(𝑇 1 , 𝑇 2 ), 𝑁 ≃ (𝑇 1 ), given by Equation 3.1. As already mentioned, the initial search space is that of bijections between the nodes of 𝑇 1 and 𝑇 2 , a far larger space than that of isomorphisms.

The goal of the different partitioning steps, presented in Section 4.3, is to break the cardinality of the space at each step, and reduce it enough so that the final size is less than 𝑁 ≃ (𝑇 1 ). We can measure how far the current space is from this goal by calculating the logratio 𝑟(B, C), defined as

𝑟(B, C) = log 10 𝑁(B, C) 𝑁 ≃ (𝑇 1 ) . (4.
3

)
The space is effectively reduced with respect to Isom(𝑇 1 , 𝑇 2 ) if and only if 𝑟(B, C) is a negative number. Figure 4.10a shows the evolution of the ratio after each partitioning step. These steps appear to be sufficient to bring the ratio close to -or below 0. In more details, if we denote by 𝑟 final (B, C) the ratio after the Labels step of preprocessing, Figure 4.10b provide a closer look at the results. We see that excluding the cases 𝑝 = 1 and 𝑝 = 1/𝑛, the space is almost systematically reduced (except for a few pathological cases when 𝑝 is close to 1), with a linear tendency that seems to emerge for values of 𝑝 < 0.5 -meaning that the search space is exponentially more reduced for larger trees. When 𝑝 = 1/𝑛, the unique label is mapped as early as the roots, and thus future deductions rely only on the topology of the tree. The collections step does not bring any additional deduction -and we can see on Figure 4.10a that it is crucial to effectively reduce the search space. Similarly, when 𝑝 = 1, except for mandatory mappings from the topology, the collections step produces few deductions since all labels are different; moreover those collections remain and contribute for much to the size of the space.

In Figure 4.11, one can see the proportion of nodes and labels mapped at the end of the preprocessing. We observe the same trends as before, especially for the 𝑝 < 0.5 cases. Note that in a number of cases, the proportion of mapped nodes reaches 1; in other words, preprocessing alone was sufficient to find a tree ciphering -which explain some of the low values of 𝑟 final in Figure 4.10b.

Computation time repartition between backtracking and preprocessing

The goal of preprocessing, by breaking as much as possible the cardinality of the search space, is to give a chance to the backtracking to converge in reasonable time. The results for 𝑇 1 ∼ 𝑇 2 are gathered in Figure 4.12. As can be seen on Figure 4.12a -where outliers are not showed, the time 𝑡 𝑝 spent in preprocessing seems to grows linearly with tree size, with little variability, while the time 𝑡 𝑏 spent in backtracking seems much more volatile. We did not find any significant influence of the 𝑝 parameter on the time spent in preprocessing.

Nevertheless, a closer look -see Figure 4.12b -shows that backtracking is systematically faster than preprocessing when 𝑝 takes intermediate values, and slower for small or large values of 𝑝. Outliers, with backtracking times several orders of magnitude higher than preprocessing time, only occur for large values of 𝑝 (but stricly < 1). This phenomenon can be explained as follows. Let us say that all the labels are different, except for one that is present in two copies (this is one of the worst possible cases). If this duplicate is not detected until too late in the backtracking, it is easy to imagine that the algorithm will take much longer to complete -since it will have to backtrack a long way to correct its mistake.

The cases 𝑝 < 0.5 that reach very low ratios can be explained in light of Figure 4.11a, where we observe that almost all nodes are mapped at the end of preprocessing. The time spent backtracking is then very short (or even negligible, if there are no nodes left to map) -as seen on Figure 4.12a, where the bottom whisker of the boxplot touches 0.

The cases 𝑝 = 1 and 𝑝 = 1/𝑛 are surprising since these are cases where any tree ciphering works, i.e. the algorithm is not expected to backtrack. On the other hand, these are also the cases where the search space is the largest when the backtracking part starts. This explanation seems sufficient by virtue of Figure 4.13, which shows (at least in the 𝑝 = 1 and 𝑝 = 1/𝑛 cases) that the time spent backtracking is related to the size of the space at the start of the backtracking, in the following manner:

When trees are not isomorphic up to a cipher

In the case where the considered trees 𝑇 1 and 𝑇 2 are not isomorphic, one of the following two outcomes is expected:

▶ Either we detect during the preprocessing that 𝑇 1 ≁ 𝑇 2 , in which case we expect to obtain a faster answer than when 𝑇 1 ∼ 𝑇 2 ; ▶ either the answer is obtained during backtracking, in which case we expect the backtracking tree to be explored more extensively than in case 𝑇 1 ∼ 𝑇 2 , and the answer will be slower to obtain. In Figure 4.14a, we see all the instances where we could determine 𝑇 1 ≁ 𝑇 ′ 2 during the preprocessing. In most cases, and seemingly independently of the parameters 𝑠 and 𝑝, we were able to obtain an answer more quickly than for deciding 𝑇 1 ∼ 𝑇 2 . These instances represent 93% of all the instances tested.

The remaining 7% of instances are shown in Figure 4.14b, where the decision 𝑇 1 ≁ 𝑇 ′ 2 was obtained during the second phase of the algorithm, i.e. the backtracking. We notice in this case that the decision is generally slower to obtain than 𝑇 1 ∼ 𝑇 2 , and particularly when 𝑝 = 1 24 , where the decision can be several orders of magnitude slower.

Enumeration Trees: from Trees to Forests

From tree to forest enumeration 5 In this chapter, we focus on enumeration problems related to trees. First, we present in Section 5.1 a generic method to enumerate structured objects, called reverse search. In particular, this method is an effective tool to solve an important data mining problem, named frequent pattern mining. The goal is to find shared denominators between data in the form of common substructures that appear with a certain minimum frequency among the items in a database.

In a second step, we look at the results of the literature. Section 5.2 presents the existing enumeration algorithms for unlabeled trees, ordered or not.

In particular, the concept of canonical representation of an unordered tree is introduced, consistent with the idea of parsimonious enumeration. Indeed, we want to enumerate each tree only once; but since the order of the children does not matter in unordered trees, we have to make sure that we do not obtain the same tree in duplicate, where nodes have been swapped. The strategy is therefore to impose a systematic order on the children of a node, i.e. to order the unordered trees via a systematic method, and then to enumerate only the canonically ordered trees.

Finally, in Section 5.3, we introduce the problem we are interested in; the enumeration of irredundant forests, i.e. forests without repetition. The trees in these forests are unordered, and so is the forest itself. The purpose of this section is therefore to construct a canonical representation of these forests, in a similar way as trees seen previously. We show in Theorem 5.2 that irredundant forests are in bijection with a certain class of DAGs -for which we construct a canonical form. Their enumeration will then be discussed in upcoming Chapter 6.

Parts of this chapter are reproduced from [START_REF] Ingels | Enumeration of Irredundant Forests[END_REF] [32]: Ingels et al. (2022), 'Enumeration of Irredundant Forests'

, notably Section 5.3.

Enumeration problems

Enumeration problems are recurrent in many fields, notably combinatorial optimization and data mining. They involve the exhaustive listing of a subset of the elements of a search set (possibly all of them), e.g. graphs, trees or vertices of a simplex. Given the possibly high combinatorial nature of these elements, it is essential to adopt clever exploration strategies as opposed to brute-force enumeration, typically to avoid areas of the search set not belonging to the objective subset. Another extremely important point is to perform parsimonious enumeration, in the sense that each element of the objective subset is seen only once.

One proven way of proceeding is to provide the search set with an enumeration tree structure; starting from the root, the branches of the tree are explored recursively, eliminating those that do not address the problem, and visiting each element only once. Based on this principle, we can notably mention the well-known "branch and bound" method in combinatorial optimization [START_REF] Ailsa | An automatic method for solving discrete programming problems[END_REF] [76]: Land et al. (2010), 'An automatic method for solving discrete programming problems'

and the gSpan algorithm for frequent subgraph mining in data mining [START_REF] Yan | gspan: Graph-based substructure pattern mining[END_REF] [77]: [START_REF] Yan | gspan: Graph-based substructure pattern mining[END_REF], 'gspan: Graph-based substructure pattern mining' . Another of these methods is the so-called reverse search technique, which requires that the search set has a partial order structure, and which has solved a large number of enumeration problems since its introduction [START_REF] Avis | Reverse search for enumeration[END_REF] [28]: [START_REF] Avis | Reverse search for enumeration[END_REF], 'Reverse search for enumeration'

until recently [START_REF] Yamazaki | Enumeration of nonisomorphic interval graphs and nonisomorphic permutation graphs[END_REF] [78]: Yamazaki et al. (2020), 'Enumeration of nonisomorphic interval graphs and nonisomorphic permutation graphs' .

Reverse search technique

In this thesis, we restrict ourselves to reverse search methods. While first introduced by Avis and Fukuda [START_REF] Avis | Reverse search for enumeration[END_REF], the formalism adopted here is derived from more recent work [START_REF] Nowozin | Learning with structured data: applications to computer vision[END_REF] [79]: Nowozin (2009), 'Learning with structured data: applications to computer vision.' . Let (S, ⊆) be a partially ordered set, with a unique least element ∅ ∈ S, such that ∀𝑠 ∈ S, ∅ ⊆ 𝑠. Let 𝑔 : S → {⊤, ⊥} be a property, satisfying anti-monotonicity ∀𝑠, 𝑡 ∈ S : (𝑠 ⊆ 𝑡) ∧ 𝑔(𝑡) =⇒ 𝑔(𝑠).

(

The enumeration problem for the property 𝑔 is the problem of listing all elements of 𝐸 S (𝑔) = {𝑠 ∈ S : 𝑔(𝑠) = ⊤}. An enumeration algorithm is an algorithm that returns 𝐸 S (𝑔).

The reverse search technique relies on inverting a reduction rule, defined as follows. In other words, 𝑓 (𝑠) reduces 𝑠 in a minimal way -by the first propertyand reaches the "smallest" element of S, ∅, in a finite number of steps. Then, the expansion rule is defined as 𝑓 -1 (𝑡) = {𝑠 ∈ S : 𝑓 (𝑠) = 𝑡}. 𝑓 defines an enumeration tree rooted in ∅, and repeated calls to 𝑓 -1 can therefore enumerate all the elements of S.

The reverse search algorithm is shown in Algorithm 12. 𝐸 S (𝑔) can be obtained from the call of ReverseSearch((S, ⊆), 𝑓 -1 , 𝑔, ∅). As 𝑔 is antimonotone, if 𝑔(𝑠) = ⊥, then all elements 𝑠 ⊆ 𝑡 also have 𝑔(𝑡) = ⊥, and thefore pruning the enumeration tree in 𝑠 does not miss any element of 𝐸 S (𝑔).

Algorithm 12:

ReverseSearch

Input: (S, ⊆), 𝑓 -1 , 𝑔, 𝑠 0 ∈ S -such that 𝑔(𝑠 0 ) = ⊤ output 𝑠 0 for 𝑡 ∈ {𝑠 ∈ 𝑓 -1 (𝑠 0 )| 𝑔(𝑠) = ⊤} do ReverseSearch((S, ⊆), 𝑓 -1 , 𝑔, 𝑡)
When successfully designed, a reverse search technique should yield polynomial output delay [START_REF] Avis | Reverse search for enumeration[END_REF][START_REF] David S Johnson | On generating all maximal independent sets[END_REF] [ , i.e., the time between the output of one element and the next is bounded by a polynomial function in the size of the input. as the set of elements verifying the property 𝑔. Separating the two induces that the reduction rule 𝑓 formally depends only on S, and not on 𝑔. This allows, once 𝑓 is constructed once and for all, to filter S according to various properties 𝑔 without much additional workprovided they indeed verify Equation 5.1. In particular, this is useful in the case where 𝑔 depends on a tunable parameter -as in the problem introduced below.

Enumeration of permutations

We now illustrate the reverse search process on an example. Suppose we want to enumerate the permutations of [ [1, 𝑛]]. Note first that any permutation 𝜋 can be written as a 𝑛-digit number 25 25: If 𝑛 > 9, one must choose a suitable base to represent the numbers.

; for example the number 321 is read as 𝜋(1) = 3, 𝜋(2) = 2 and 𝜋(3) = 1. We denote by 𝑁(𝜋) this number.

As permutations can be expressed as a composition of transpositions (i.e. a swap of two elements), we can define the following order relation on permutations: 𝜋 ⊂ 𝜋 ′ ⇐⇒ 𝑁(𝜋) < 𝑁(𝜋 ′ ), and 𝜋, 𝜋 ′ only differ by a transposition.

Partially ordered sets are traditionnally represented by Hasse diagrams [START_REF] Di | Algorithms for plane representations of acyclic digraphs[END_REF][START_REF] Freese | Automated lattice drawing[END_REF] Given a permutation 𝜋 = 𝑝 1 • • • 𝑝 𝑛 , we look for the first index 𝑖 such that 𝑝 𝑖 > 𝑝 𝑖+1 ; we construct 𝑓 (𝜋) by swapping 𝑝 𝑖 and 𝑝 𝑖+1 ; this is our reduction rule [START_REF] Yamanaka | Permutation Enumeration[END_REF] [83]: Yamanaka (2016), 'Permutation Enumeration'

. We briefly confirm that it meets the requirements of Definition 5.1. Naturally, 𝑓 (𝜋) ⊂ 𝜋. Since two permutations are related if they differ only by one transposition, we can not find a third permutation 𝜋 ′ such that 𝑓 (𝜋) ⊂ 𝜋 ′ ⊂ 𝜋. Then, since 𝑓 (𝜋) < 𝜋 by construction, a finite number of swaps allows to reach the identity permutation -the root of the enumeration. The enumeration tree obtained is presented, in the case 𝑛 = 3, on Figure 5.1b.

The reduction rule still needs to be inversed to complete the reverse search scheme. The main difficulty is to find the right pairs of indices to swap (for example, we can not reconstruct 321 from 123). We refer the reader to [START_REF] Yamanaka | Permutation Enumeration[END_REF] for complete details.

It is important to note that the main issue with reverse search methods is to find a reduction rule that is "properly" invertible -in other words, the construction of the expansion rule is a key factor of the technique.

Frequent pattern mining

With the ever-increasing accumulation of data, especially structured data, being able to extract information efficiently is a real challenge. The frequent pattern mining problem consists in finding patterns (typically, substructures for structured data) that appear with a certain minimum frequency in the items of a database.

A typical example might be the design of new drugs, where molecules are seen as graphs, with each vertex corresponding to an atom. The expectation is that molecules with similar behavior to treat certain diseases will be made up of similar chemical compounds. Therefore, it becomes crucial to identify these common chemical compounds [START_REF] Deshpande | Mining Chemical Compounds[END_REF] 26: Note that both the elements of 𝒳 and the substructures investigated belong to the same space S. Think of graphs and subgraphs, strings and substrings, etc. There is a kind of recursivity in the considered objects.

The gSpan algorithm, dedicated to frequent subgraph mining, is notably applied to chemical data in the original paper [START_REF] Yan | gspan: Graph-based substructure pattern mining[END_REF] [77]: [START_REF] Yan | gspan: Graph-based substructure pattern mining[END_REF], 'gspan: Graph-based substructure pattern mining' -and uses a reverse search approach.

Formally, the frequent pattern mining problem can be formulated as follows: from a dataset 𝒳 = {𝑠 1 , . . . , 𝑠 𝑛 } with 𝑠 𝑖 ∈ S, and a fixed threshold 𝜎, find all elements 26 𝑠 ∈ S that satisfy freq(𝑠, 𝒳) ≥ 𝜎, where freq(𝑠, 𝒳) is a function that counts the frequency of appearance of 𝑠 in the dataset 𝑋. Typically, freq(𝑠, 𝒳) = 1

𝑛 𝑛 𝑖=1 1 𝑠⊆𝑠 𝑖 . (5.2)
Another option may be to consider the multiplicity of each substructure, replacing 1 𝑠⊆𝑠 𝑖 by N 𝑠 (𝑠 𝑖 ), where N 𝑠 (𝑡) counts how many times 𝑠 appears in 𝑡.

One way to address frequent pattern mining is precisely based on a reverse search approach. Indeed, if we already have a way to enumerate the elements of S, it is sufficient to filter the enumeration according to the following property 𝑔(𝑠, 𝒳 , 𝜎) = (freq(𝑠, 𝒳) ≥ 𝜎), which is antimonotone by virtue of the following lemma -the proof can be found in [START_REF] Nowozin | Learning with structured data: applications to computer vision[END_REF] [79]: Nowozin (2009), 'Learning with structured data: applications to computer vision.'

.

Lemma 5.1 ∀𝑠, 𝑡 ∈ S, 𝑠 ⊆ 𝑡 =⇒ freq(𝑠, 𝒳) ≥ freq(𝑡, 𝒳).
We emphasize here that each possible definition of "𝑠 appears in 𝑋" leads to a different data mining problem. The choice of this definition is therefore of prime importance. In particular, this choice should induce a way of calculating freq(𝑠, 𝒳) that reflects the specificity of the reduction rule 𝑓 , so that {𝑠 ∈ 𝑓 -1 (𝑠 0 ) : 𝑔(𝑠) = ⊤} can be constructed directly, instead of first generating 𝑓 -1 (𝑠 0 ) and then filtering according to the value of 𝑔. Indeed, if 𝑔 is too restrictive, and 𝑓 -1 (𝑠 0 ) too large, one would have to enumerate objects that are not relevant to the enumeration problem, which is not desirable.

We showed that the problem of frequent pattern mining can be solved as soon as we dispose of a reverse search enumeration method of the patterns of interest. We are now interested in specific cases; and we start with trees.

Tree enumeration

This section has a twofold interest: first, it presents existing results in the literature concerning the enumeration of unlabeled trees, ordered or not. Then, through these examples, it introduces a number of practical considerations about the design of reverse search algorithms, which will be exploited to design our forest enumeration algorithm -see Section 5.3 and Chapter 6.

𝑇 𝑇 1 𝑇 2 𝑇 3

Ordered trees

The enumeration of ordered trees has been proposed in [START_REF] Nakano | Efficient generation of plane trees[END_REF] [29]: Nakano (2002), 'Efficient generation of plane trees'

, where they are referred to as plane trees. The reverse search procedure they use is defined as follows.

Given an ordered tree 𝑇 and a node 𝑣 ∈ 𝑇, they call rightmost child the last element of 𝒞(𝑣). The rightmost path of 𝑇, denoted 𝑅𝑃(𝑇), is the sequence starting with ℛ(𝑇), its rightmost child, their rightmost child, and recursively until a leaf is reached. The reduction rule 𝑓 for ordered trees is such that 𝑓 (𝑇) is the tree 𝑇 deprived from the leaf of 𝑅𝑃(𝑇).

The expansion rule 𝑓 -1 (𝑇) constructs all trees such that, if the last element from their rightmost path is removed, we get 𝑇. These trees are exactly those obtained by adding a node as the rightmost child of each of the nodes composing 𝑅𝑃(𝑇). An example is shown in Figure 5.2.

On the enumeration of ordered trees, let us also mention this recent work [START_REF] Parque | An Efficient Scheme for the Generation of Ordered Trees in Constant Amortized Time[END_REF]

Unordered trees

As can be seen in Figure 5.3, a single unordered tree can have several representations. The additional difficulty that arises when going from ordered to unordered is exactly this: how to avoid enumerating the same tree under different representations? Considering that the number of representations is expressed as a product of factorials (since permutations of sibling nodes with different equivalence class are involved 27 ), addressing this issue is critical. This question has been answered in [START_REF] Nakano | Efficient generation of rooted trees[END_REF] , where the idea is to define the so-called canonical form of an unordered tree -i.e. a systematic way of representating trees -and then to enumerate only canonical trees. Note that since the set we aim to enumerate is that of canonical trees, it is imperative that the reduction rule (and thus, the expansion rule) operates on canonical trees. In particular, special care must be taken to ensure that a reduced (or expanded) tree is still canonical after operation. Below is the method used in [START_REF] Nakano | Efficient generation of rooted trees[END_REF].

Given a tree 𝑇, number its nodes 𝑣 1 , . . . , 𝑣 𝑛 by depth-first search. The depth sequence of 𝑇 is defined as the sequence 𝐿(𝑇) = (depth(𝑣 1 ), . . . , depth(𝑣 𝑛 )). Given two trees 𝑇 1 and 𝑇 2 , the depth sequence 𝐿(𝑇 1 ) is said to be heavier than 𝐿(𝑇 2 ) if and only if 𝐿(𝑇 1 ) > lex. 𝐿(𝑇 2 ), where > lex. is the lexicographic order 28 . The left-heavy embedding of 𝑇 is the tree T such that 𝑇 ≃ T, and 𝐿( T) is the heaviest depth sequence among all trees isomorphic to 𝑇. An example is provided in Figure 5.4.

The canonical form of a tree 𝑇 is defined in [START_REF] Nakano | Efficient generation of rooted trees[END_REF] as its left-heavy embedding T. Remember that the interest of this form is to fix the representation; only the canonical trees are then enumerated. The reduction rule employed is the same as the one previously used for ordered trees in [START_REF] Nakano | Efficient generation of plane trees[END_REF] [29]: [START_REF] Nakano | Efficient generation of plane trees[END_REF], 'Efficient generation of plane trees' : remove the leaf from the rightmost path of T. Removing this leaf implies that the depth sequence of the new tree 𝑓 ( T) is the same as T, deprived of its last element. Since 𝐿( T) is maximal, so is 𝐿( 𝑓 ( T)); therefore 𝑓 ( T) = 𝑓 ( T) and the resulting tree is still canonical.

On the other hand, and without going into details, the expansion rule differs from that of ordered trees. If we add a node along the rightmost path, not all choices generate a tree maximizing its depth sequenceand thus some are not canonical. This issue is managed in [START_REF] Nakano | Efficient generation of rooted trees[END_REF], and the final algorithm they propose yields polynomial delay [START_REF] David S Johnson | On generating all maximal independent sets[END_REF] [80]: Johnson et al. (1988), 'On generating all maximal independent sets' . Precisely, each element is enumerated in 𝒪(1) time, making the enumeration very efficient. Finally, it should be noted that since these algorithms explicitly build their enumeration tree, each element is only enumerated incrementally, i.e. the algorithm does not output entire trees but only the difference from the previous tree.

The algorithm for enumerating unordered trees is notably reused in [START_REF] Asai | Discovering frequent substructures in large unordered trees[END_REF] to address the problem of frequent pattern mining on labeled unordered trees -where tree isomorphisms require equality of the labels.

Forest enumeration

The enumeration of unordered trees was discussed in the previous section. On the other hand, the DAG compression presented in Section 2.3 can be seen as a method for enumerating subtrees. Our ambition here is to take these two problems of enumeration -trees and subtrees -to a higher order, i.e. to enumerate sets of trees instead of singletonsforests.

On the other hand, forests, as introduced in Definition 2.2, can have repetitions -it is possible for one tree to be a subtree of another (this includes being a copy of another tree). In a parsimonious enumeration approach, this is problematic. This is also an issue in the context of frequent pattern mining: if one looks at the frequency of appearance of a given subtree (assumed to belong to a forest of subtrees), one does not want to see this subtree appearing several times. This is why we restrict our enumeration to irredundant forests, i.e. forests that contains no repetition, in the sense that no tree is a subtree of another. This condition is not restrictive since one can always introduce repetition afterwards.

We are therefore interested in the problem of enumerating irredundant forests of unordered trees, and then, given a tree or forest, to enumerate all its "subforests" -as forests of subtrees. The latter has already been discussed in the literature, but without consideration on isomorphism [START_REF] Schwikowski | On enumerating all minimal solutions of feedback problems[END_REF] [86]: [START_REF] Schwikowski | On enumerating all minimal solutions of feedback problems[END_REF], 'On enumerating all minimal solutions of feedback problems'

. We emphasize that we aim to enumerate these various items -forests and subforests -up to isomorphism. Such an ambition immediately raises a number of obstacles. First of all, the trees are indeed unordered, but so are the sets of trees. For the former the literature has introduced the notion of the canonical form of a tree, as seen previously. The enumeration therefore focuses only on these canonical trees. Unfortunately, if it is possible to order a set of vertices, there is no total order on the set of trees, to the best of our knowledge. In addition, the condition of non-repetition filters the set of forests in a non-trivial way, making, a priori, the enumeration problem trickier.

In the following, we formally introduce the problem and the measures adopted to address these difficulties.

𝑇 1 𝑇 2 𝑇 3 𝐹 = {𝑇 1 , 𝑇 2 , 𝑇 3 } 2 3 2 ℜ(𝐹)

Irredundant forests

We start by defining irredundant forests.

In other words, no tree in the forest can be a subtree of another (a fortiori, no two trees can be identical either). We denote by ℱ the set of all irredundant forests.

Our goal is to provide a reverse search method that outputs ℱ . As already stated, this goal raises two major difficulties: firstly, the twofold unordered nature of forests (the set of trees and the trees themselves), and secondly, the non-trivial condition of non-repetition. Concerning the latter, we already know a method to eliminate repetitions in a tree or a forest: DAG reduction. By resorting to this technique, we can handle the former as well.

We saw in Section 2.4 that we could compress a forest into a DAG without loss by placing all the trees of the forest under an artificial root. Actually, for irredundant forests, we do not require this artificial root and instead proceed as follows.

Let 𝐹 = {𝑇 1 , . . . , 𝑇 𝑛 } be an irredundant forest. We construct its DAG compression ℜ(𝐹) by using a simple adaptation of Algorithm 3: on Line 4, replace ℋ (𝑇) by max 𝑖 ℋ (𝑇 𝑖 ); and on Line 5, 𝑣 ∈ 𝑇 ℎ by 𝑣 ∈ ∪ 𝑖 𝑇 ℎ 𝑖 , with the convention that 𝑇 ℎ = ∅ if ℎ > ℋ (𝑇). DAG compression of irredundant forests is illustrated on Figure 5.5.

If ever 𝐹 was not an irredundant forest, say if for example 𝑇 1 ∈ 𝒮(𝑇 2 ), then ℜ(𝑇 1 ) would be a subDAG of ℜ(𝑇 2 ); and therefore the number of roots in ℜ(𝐹) would be strictly less than #𝐹. Since such a situation can not occur, there are exactly as many roots in ℜ(𝐹) as there are elements in 𝐹: no information is lost. In other words, 𝐹 can be reconstructed from ℜ(𝐹) and DAG compression is also lossless in this case. Since 𝐷 compresses several trees, 𝐷 has several roots, and the notation ℛ(𝐷) therefore refers to the set of roots of 𝐷.

In the sequel, DAGs compressing irredundant forests are called FDAGs, to distinguish them from general directed acyclic graphs. Since DAG compression is lossless, and since an irredundant forest can be reconstructed from its DAG reduction, we have the following result.

Theorem 5.2 There is a bijection between the set of FDAGs and the set of irredundant forests.

Therefore, the problem of enumerating irredundant forests is equivalent to the problem of enumerating FDAGs. This compression of irredundant forests into FDAGs has the merit of transforming set of trees into unique objects, which makes it possible, if able to design a canonical representation -like the trees in [START_REF] Asai | Discovering frequent substructures in large unordered trees[END_REF][START_REF] Nakano | Efficient generation of rooted trees[END_REF] , to get rid of the twofold unordered nature of forests, as claimed earlier. Indeed, any ordering of the vertices of the DAG induces an order on the roots of the DAG, and therefore on the elements of the forest, as well on the vertices of the trees themselves.

The sequel of this chapter is dedicated to defining such canonical representation. But before getting there, we need to introduce some results on formal languages which will be necessary for the sequel of this chapter and Chapter 6.

A detour through formal languages

Let A be a totally ordered finite set, called alphabet, whose elements are called letters. A word is a finite sequence of letters of A. The length of a word 𝑤 is equal to its number of letters and is denoted by #𝑤. There is a unique word with no letter called the empty word and denoted by 𝜖. The set of all words is denoted by A * . Words can be concatenated to create a new word whose length is the sum of the lengths of the original words; 𝜖 is the neutral element of this concatenation operation.

The lexicographic order over A * , denoted by < lex. is defined as follows.

Let

𝑤 1 = 𝑎 0 • • • 𝑎 𝑝 and 𝑤 2 = 𝑏 0 • • • 𝑏 𝑞 be two words, with 𝑎 𝑖 , 𝑏 𝑗 ∈ A. If #𝑤 1 = #𝑤 2 ,
(i) 𝑎 0 • • • 𝑎 𝑚 < lex. 𝑏 0 • • • 𝑏 𝑚 or (ii) 𝑎 0 • • • 𝑎 𝑚 = lex. 𝑏 0 • • • 𝑏 𝑚 and 𝑚 < 𝑞 -that is, 𝑝 < 𝑞.
Note that, by convention, 𝜖 < lex. 𝑤 for any word 𝑤.

Let 𝑤 ∈ A * . We define the suffix-cut operator 𝑆𝐶(𝑤), which removes the last letter of 𝑤:

𝑆𝐶(𝑤) = 𝑤 ′ if 𝑤 = 𝑤 ′ 𝑎 with 𝑎 ∈ A and 𝑤 ′ ∈ A * , 𝜖 otherwise.
(5.4)

A language is a set of words satisfying some construction rules. We introduce hereafter two languages that will be useful in the sequel of this chapter and the next.

Definition 5.3

The language of decreasing words is defined as ▶ 𝑤 and 𝑤 do not share a common prefix. Necessarily 𝑏 0 > lex. 𝑎 0 , and then the word 𝑏 0 is minimal by applying several suffix-cut operations.

Λ = 𝑤 = 𝑎 0 • • • 𝑎 𝑚 ∈ A * : 𝑎 𝑖 ≥ lex. 𝑎 𝑖+1 ∀𝑖 ∈ [[0, 𝑚 -1]] . Definition
From the above, we deduce a method for constructing all minimal words of Λ 𝑤 . First, we partition A into disjoint -potentially empty -subsets:

A 0 = {𝑎 ∈ A : 𝑎 > lex. 𝑎 0 }, A 𝑖 = {𝑎 ∈ A : 𝑎 𝑖-1 ≥ lex. 𝑎 > lex. 𝑎 𝑖 } 1 ≤ 𝑖 ≤ 𝑝, A 𝑝+1 = {𝑎 ∈ A : 𝑎 𝑝 ≥ lex. 𝑎}.
It then follows that -empty A 𝑖 's not being considered,

▶ ∀𝑏 ∈ A 0 , the word 𝑏 is minimal, ▶ ∀𝑏 ∈ A 𝑖 with 𝑖 ∈ {1, . . . , 𝑝}, the word 𝑎 0 • • • 𝑎 𝑖-1 𝑏 is minimal, ▶ ∀𝑏 ∈ A 𝑝+1
, the word 𝑤𝑏 is minimal.

As we partitioned A, we have proved the following proposition.

Proposition 5. [START_REF] Guédon | Pattern identification and characterization reveal permutations of organs as a key genetically controlled property of post-meristematic phyllotaxis[END_REF] The number of minimal words of Λ 𝑤 is exactly #A.

As a follow-up of the example some lines ago, with A = {0, 1, 2, 3} and 𝑤 = 211, we apply the proposed method to find the minimal elements of Λ 𝑤 . We partition A into:

A 0 = {3}, A 1 = {2}, A 2 = ∅, A 3 = {0, 1}.
The four minimal words are therefore 3, 22, 2111 and 2110.

Although the previous result is completely general, if we require that A = {0, . . . , 𝑛}, then the partition method described above can be rewritten into Algorithm 13. While this is not included in the pseudocode provided, note that the algorithm should return an empty list if 𝑎 0 > 𝑛, as in this case there would be no minimal word to look for.

Algorithm 13: MinimalWords

Input: 𝑤 = 𝑎 0 • • • 𝑎 𝑝 , A = {0, . . . ,

Canonical FDAGs

FDAGs are unordered objects, like the trees they compress, and therefore their enumeration requires to reflect this nature. In practice, finding a systematic way to order them makes it possible to design a simpler reduction rule, as done for unordered trees [START_REF] Nakano | Efficient generation of rooted trees[END_REF], ignoring the combinatorics of permutations. The purpose of this subsection is to provide a unique way to order FDAGs. We show that such an order exists in Theorem 5.4, unambiguously characterizing FDAGs. The approach chosen is based on the notion of topological ordering.

As we shall see, the topological orderings of a DAG are generally not unique. We will constrain them with carefully chosen conditions, so that there is only one topological order verifying said conditions: this one will induce our canonical form. ( Topological ordering Let 𝐷 be a directed graph, where multiple arcs are allowed. A topological ordering on 𝐷 is an ordering of the vertices of 𝐷 such that for every arc 𝑢 → 𝑣, 𝑢 comes after 𝑣 in the ordering. Formally, 𝜓 : 𝐷 → [[0, #𝐷 -1]] is a topological ordering if and only if 𝜓 is bijective and 𝜓(𝑢) > 𝜓(𝑣) for all 𝑢, 𝑣 ∈ 𝐷 such that there exists at least one arc 𝑢 → 𝑣 in 𝐷. A well known result establishes that 𝐷 is a DAG if and only if it admits a topological ordering [START_REF] Arthur B Kahn | Topological sorting of large networks[END_REF] [87]: Kahn (1962), 'Topological sorting of large networks' . Nonetheless, when a topological ordering exists, it is in general not unique -see Figure 5.6, which will serve as a followed example throughout this section. A reverse search enumeration of topological orderings of a given DAG can actually be found in [START_REF] Avis | Reverse search for enumeration[END_REF] [28]: [START_REF] Avis | Reverse search for enumeration[END_REF], 'Reverse search for enumeration' .

𝜓 1 ( ) 3 2 1 0 𝜓 2 ( ) 3 2 0 1 𝜓 3 ( ) 2 3 0 1 𝜓 4 ( ) 2 3 1 0 𝜓 5 ( ) 1 3 0 2

Constrained topological ordering

We aim to reduce the number of possible topological orderings of a DAG by constraining them. Let 𝐷 be a DAG and 𝜓 a topological ordering. Taking advantage of the vertical hierarchy of DAG, our first constraint is

∀(𝑢, 𝑣) ∈ 𝐷 2 , ℋ (𝑢) > ℋ (𝑣) =⇒ 𝜓(𝑢) > 𝜓(𝑣).
(5.5)

Applying Equation 5.5 to the topological orderings presented in Figure 5.6, 𝜓 5 must be removed, as 𝜓 5 ( ) > 𝜓 5 ( ) but ℋ ( ) > ℋ ( ).

For any vertex 𝑣, and any 𝑢 ∈ 𝒞(𝑣), by definition, ℋ (𝑣) > ℋ (𝑢). Therefore, there can be no arcs between vertices at same height. Any arbitrary order on them leads to a different topological ordering. The next constraint we propose relies on the lexicographic order;

∀(𝑢, 𝑣) ∈ 𝐷 2 , (ℋ (𝑢) = ℋ (𝑣)) ∧ (𝒞 𝜓 (𝑢) > lex. 𝒞 𝜓 (𝑣)) =⇒ 𝜓(𝑢) > 𝜓(𝑣), (5.6)
where 𝒞 𝜓 (𝑣) is the sequence (𝜓(𝑤) : 𝑤 ∈ 𝒞(𝑣)) sorted by decreasing order with respect to the lexicographic order. In other words, 𝒞 𝜓 (𝑣) is a decreasing word -see Definition 5.3 -on the alphabet A = [[0, #𝐷 -1]]. Table 5.1 illustrates the behavior of Equation 5.6 on the followed example of Figure 5.6.

The combination of those two constraints imposes uniqueness in all cases except when there exist 𝑢, 𝑣 ∈ 𝐷 2 such that 𝒞 𝜓 (𝑢) = 𝒞 𝜓 (𝑣) and 𝑢 ≠ 𝑣. It should be clear that if we impose the condition of upcoming Equation 5.7, such a pathological case can not occur. In Chapter 6, we shall only consider FDAGs. Consequently, from Theorem 5.4, they admit a unique topological ordering 𝜓 satisfying both Equation 5.5 and Equation 5.6, called canonical ordering. Thus, for any FDAG 𝐷, the associated canonical ordering 𝜓 will be implicitly defined. The vertices will be numbered accordingly to their ordering, i.e 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ) with 𝜓(𝑣 𝑖 ) = 𝑖. Finally, as a consequence of Equation 5.5 and Equation 5.6, note that 𝐷 can be partitioned in subsets of vertices with same height, each of them containing only consecutive numbered vertices. Figure 5.7 provides an example of a FDAG and its canonical ordering.

∀(𝑢, 𝑣) ∈ 𝐷 2 , 𝑢 ≠ 𝑣 =⇒ 𝒞(𝑢) ≠ 𝒞(𝑣). ( 5

Gunter Grass

This chapter is dedicated to the problem of enumerating unordered irredundant forests, as defined in Definition 5.2. By virtue of Theorem 5.2, it is equivalent to enumerate FDAGs, i.e. DAGs compressing (without loss) irredundant forests. Furthermore, it has been shown that FDAGs can be ordered in a canonical way, through Theorem 5.4.

Consequently, the majority of this chapter is dedicated to the enumeration of canonical FDAGs. In particular, we set up a reverse search procedurepresented in Section 5.1. As we have already seen, two points must be taken into consideration when building a reverse search method:

▶ the difficulty lies mainly in the expansion rule (i.e. the inverse of the reduction rule);

▶ the rules (reduction and expansion) must respect the canonicity of the enumerated items.

With regard to the first point, we intend in this chapter to build the reverse search procedure in reverse. That is, we construct three expansion rules in Section 6.1, which, given a canonical FDAG, construct a new FDAG (also canonical, according to the second point). We then show that any canonical FDAG has a unique antecedent by one of these three rules. This allows us to construct the reduction rule (which associates a unique antecedent to a FDAG), and to complete the reverse search scheme.

This defines an enumeration tree of canonical FDAGs, whose properties are studied in Section 6.2. We show that as the depth increases, the number of nodes in the enumeration tree at this depth grows exponentially. However, a given FDAG in the tree has a number of successors linear in the size of the FDAG; these successors can be computed in linear or quadratic time (depending on the chosen implementation). The growth of the tree is therefore, from this point of view, controlled. This allows us to conclude by showing that our algorithm runs with a polynomial delay, which is expected from a reverse search method.

The sequel of the chapter is devoted, first, to exploring three variants of our algorithm in Section 6.3, allowing in particular (i) to enumerate classical forests, with redundancy; (ii) self-nested trees, a particular class of trees where all subtrees of the same height are isomorphic; and finally (iii) to constrain enumeration by imposing a certain number of criteria (degree, height, maximum number of nodes) on the enumerated FDAGs. Finally, a particular instance of the frequent pattern mining problemthe frequent subforest mining problem is considered in Section 6.4, where the notion of subforest is defined first, and an enumeration algorithm is provided afterwards (largely based on the previous algorithm for enumerating FDAGs).

Most of this chapter makes a consistent use of previously introduced concepts, in particular those presented in A detour through formal languages (p. 66) and Canonical FDAGs (p. 67). The entire chapter is reproduced from [START_REF] Ingels | Enumeration of Irredundant Forests[END_REF] [32]: Ingels et al. (2022), 'Enumeration of Irredundant Forests'

, with the notable exception of Enumeration of self-nested trees (p. 83), which is new material.

Exhaustive enumeration of FDAGs

Reverse search techniques imply finding reduction rules, and then invert them. Equally, we will define instead three expansion rules, whose inverse will be reduction rules. An expansion rule takes a FDAG and creates a new FDAG, that is "expanded" in the sense of having either more vertices or more arcs. We show then that these rules preserve the canonicity of FDAGs, and that any FDAG admits a unique antecedent by one of the three rules in Proposition 6.3. The mapping of a FDAG to its unique antecedent is exactly our reduction rule, whose inverse are the three expansion rules. From this, we can derive an enumeration tree of canonical FDAGs, as claimed.

Expansion rules

We begin with a preliminary definition. Definition 6.1 Let 𝐷 be a FDAG, with 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ). We define the two following alphabets

A = = {𝜓(𝑣) : 𝑣 ∈ 𝐷, ℋ (𝑣) = ℋ (𝑣 𝑛 )} = {𝑝 + 1, . . . , 𝑛}, A < = {𝜓(𝑣) : 𝑣 ∈ 𝐷, ℋ (𝑣) < ℋ (𝑣 𝑛 )} = {0, . . . , 𝑝},
where 𝑝 ∈ [[0, 𝑛 -1]], 𝜓(•) is the canonical ordering of 𝐷, and ℋ (•) is the height as defined in Equation 2.1.

In other words, A = contains the indices of all vertices that have the same height as the vertex with the highest index according to 𝜓, and A < the indices of all vertices that have an inferior height. The FDAG presented in Figure 5.7 -reproduced here -will serve as a guideline example all along this subsection. Here, we have A = = {4, 5} and A < = {0, 1, 2, 3}.

The three expansion rules are now introduced. Let 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ). Each of these rules is associated with an explicit symbol, which may be used, when necessary, to designate the rule afterward. It is worth noting that all of these rules will operate according to the vertex of highest index, i.e. 𝑣 𝑛 .

Branching rule

This rule adds an arc between 𝑣 𝑛 and a vertex below. The end vertex of the new arc is chosen such that 𝒞 𝜓 (𝑣 𝑛 ) remains a decreasing word. In Figure 6.1, is applied on our guideline example.

Definition 6.2

Let 𝒞 𝜓 (𝑣 𝑛 ) = 𝑎 0 • • • 𝑎 𝑚 . Choose 𝑎 𝑚+1 ∈ A < such that 𝑎 𝑚 ≥ lex. 𝑎 𝑚+1 and add an arc between 𝜓 -1 (𝑎 𝑚+1 ) and 𝑣 𝑛 .

Elongation rule

This rule adds a new vertex 𝑣 𝑛+1 so that ℋ (𝑣 𝑛+1 ) = ℋ (𝑣 𝑛 ) + 1. Consequently, the alphabets change and become A = = {𝑛 + 1} and A < = {0, . . . , 𝑛}. Note that after using this rule, it is not possible to ever add a new vertex at height ℋ (𝑣 𝑛 ). See Figure 6.2 for an illustration of this rule on the guideline example.

Definition 6.3

Add a new vertex 𝑣 𝑛+1 such that 𝒞 𝜓 (𝑣 𝑛+1 ) = 𝑎 0 ∈ A = .

Widening rule

This rule adds a new vertex 𝑣 𝑛+1 at height ℋ (𝑣 𝑛 ). The vertex is added with children that respects the canonicity of the DAG, that is, such that 𝒞 𝜓 (𝑣 𝑛+1 ) > lex. 𝒞 𝜓 (𝑣 𝑛 ) -as in Equation 5.6. In other terms, denoting Λ < the language of decreasing words on alphabet A < , and with 𝑤 = 𝒞 𝜓 (𝑣 𝑛 ), 𝒞 𝜓 (𝑣 𝑛+1 ) must be chosen in Λ 𝑤 < -see Definition 5.4. However, this set is infinite, so we restrict 𝒞 𝜓 (𝑣 𝑛+1 ) to be chosen among the minimal words of Λ 𝑤 < . It follows from the definition of suffix-cut operator 𝑆𝐶(•) that, by inverting the said operator, the other words in Λ 𝑤 < can be obtained by performing repeated operations. Finally, this new vertex is added to A = .

Definition 6.4

Add a new vertex 𝑣 𝑛+1 such that

𝒞 𝜓 (𝑣 𝑛+1 ) ∈ 𝑤 ∈ Λ 𝑤 < : 𝑤 is a minimal word of Λ 𝑤 < with 𝑤 = 𝒞 𝜓 (𝑣 𝑛 ).
From Proposition 5.3 we know that such minimal words exist. We prove in the upcoming lemma that, as claimed, ℋ (𝑣 𝑛+1 ) = ℋ (𝑣 𝑛 ).

Lemma 6.1 Any element of Λ 𝑤

< defines a new vertex 𝑣 𝑛+1 so that ℋ (𝑣 𝑛+1 ) = ℋ (𝑣 𝑛 ).

Proof. From the definition of ℋ (•), it suffices to prove that 𝑣 𝑛+1 admits at least one child at height ℎ = ℋ (𝑣 𝑛 ) -1. Let us denote 𝑏 0 and 𝑎 0 the first letter of, respectively, 𝒞 𝜓 (𝑣 𝑛+1 ) and 𝒞 𝜓 (𝑣 𝑛 ). Denoting 𝑣 = 𝜓 -1 (𝑏 0 ) and 𝑢 = 𝜓 -1 (𝑎 0 ), we already know that ℋ (𝑢) = ℎ -as 𝜓 respects Equation 5.6 and 𝒞 𝜓 (𝑣 𝑛 ) is a decreasing word. Therefore, as by construction 𝒞 𝜓 (𝑣 𝑛+1 ) > lex. 𝒞 𝜓 (𝑣 𝑛 ), either (i) 𝑏 0 = 𝑎 0 and therefore 𝑣 = 𝑢, or (ii) 𝑏 0 > lex. 𝑎 0 . In the latter, as 𝜓 respects both Equation 5.5 and Equation 5.6, ℋ (𝑣) ≥ ℋ (𝑢) = ℎ. But, as 𝑏 0 ∈ A < , ℋ (𝑣) < ℋ (𝑣 𝑛 ) = ℎ + 1. In both cases, ℋ (𝑣) = ℎ. Figure 6.3 illustrates the use of the widening rule on the followed example. It should be noted that the possible outcomes of are obtained by using Algorithm 13, applied to 𝑤 = 𝒞 𝜓 (𝑣 𝑛 ) and 𝑝 -with A < = {0, . . . , 𝑝}.

Analysis of the rules

Since our goal is to enumerate canonical FDAGs, it is required that the expansion rules indeed construct canonical FDAGs. This is achieved by virtue of the following proposition.

Proposition 6.2 The expansion rules preserve the canonicity property.

Proof. Let 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ) be a canonical FDAG. The proposition follows naturally from the definitions:

Let 𝑎 be the letter added to 𝑤 = 𝒞 𝜓 (𝑣 𝑛 ). As 𝑤𝑎 > lex. 𝑤 > lex. 𝒞 𝜓 (𝑣 𝑛-1 ), the ordering is unchanged. The new vertex 𝑣 𝑛+1 is such that ℋ (𝑣 𝑛+1 ) > ℋ (𝑣 𝑛 ), so Equation 5.5 is still met. The new vertex 𝑣 𝑛+1 is chosen so that ℋ (𝑣 𝑛+1 ) = ℋ (𝑣 𝑛 ) and 𝒞 𝜓 (𝑣 𝑛+1 ) > lex. 𝒞 𝜓 (𝑣 𝑛 ), so Equation 5.6 is also still met.

Therefore, any FDAG obtained from 𝐷 is still a canonical FDAG.

From now on, since it is assured that the canonicity is preserved, we shall use the term FDAG for "canonical FDAG" for the sake of simplicity. Furthermore, since our goal is to provide the FDAGs space with an enumeration tree, which will be explored via the expansion rules, it is important that these expansion rules are "bijective" in the following sense: for any FDAG 𝐷, there exists a unique FDAG 𝐷 ′ such that 𝐷 is obtained from 𝐷 ′ via one of the three rules , or .

Such 𝐷 ′ can be constructed via Algorithm 14 as shown in upcoming Proposition 6. ▶ If 𝑣 𝑛 admits only one child, it must come from an step, since would imply that #𝑤 ≥ 2. Therefore, in this case, 𝐷 can be retrieved among the outcomes of rule applied to 𝐷 ′ = (𝑣 0 , . . . , 𝑣 𝑛-1 ). ▶ Otherwise, when #𝑤 > 1, 𝐷 can not come from an step, and must therefore come from . Denoting 𝑣 ′ 𝑛 the vertex with list of children 𝑆𝐶(𝑤) -see Equation 5.4, 𝐷 is one of the outcomes of 𝐷 ′ = (𝑣 0 , . . . , 𝑣 𝑛-1 , 𝑣 ′ 𝑛 ) via .

(ii) following the same logic as (i), 𝐷 can not be obtained via . We discriminate between rules and when comparing 𝑤 and 𝑤 ′ . If 𝑤 is a minimal word of Λ 𝑤 ′ < , then 𝐷 can not be obtained from -this would break the canonical order. Therefore, in this case, 𝐷 is an outcome of rule applied to 𝐷 ′ = (𝑣 0 , . . . , 𝑣 𝑛-1 ). Otherwise, if 𝑤 is not a minimal word, then it can not be obtained from , and must come from a step, applied to 𝐷 ′ = (𝑣 0 , . . . , 𝑣 𝑛-1 , 𝑣 ′ 𝑛 ) where 𝒞 𝜓 (𝑣 ′ 𝑛 ) = 𝑆𝐶(𝑤). Whatever the case among those evoked, they correspond exactly to the conditional expressions of the Algorithm 14, which therefore constructs the correct antecedent of 𝐷, which is unique by virtue of the previous discussion.

Enumeration tree

In this subsection, we construct the enumeration tree of FDAGs derived from the expansion rules. As aimed, their inverse is indeed a reduction rule. Theorem 6.4 Algorithm 14 is a reduction rule, as in Definition 5.1.

Proof. Let us denote 𝑓 (𝐷) the output of Algorithm 14 applied to a FDAG 𝐷. We need to prove that: (i) 𝑓 (𝐷) is a "maximal " subgraph of 𝐷 and (ii) for any 𝐷 ≠ 𝐷 0 , there exists an integer 𝑘 such that 𝑓 𝑘 (𝐷) = 𝐷 0 , where 𝐷 0 is the FDAG with one vertex and no arcs.

▶ Since Algorithm 14 deletes either one vertex and its leaving arcs, or just one arc, 𝑓 (𝐷) is indeed a subgraph of 𝐷. Moreover, by the construction of the expansion rules (and thus the reduction rule), there is no FDAG 𝐷 ′ (different from 𝑓 (𝐷) and 𝐷) such that 𝑓 (𝐷) is a subgraph of 𝐷 ′ and 𝐷 ′ a subgraph of 𝐷. ▶ The sequence of general terms 𝑓 𝑘 (𝐷) is made of discrete objects whose size is strictly decreasing, therefore the sequence is finite and reaches 𝐷 0 .

The associated expansion rule is exactly, in light of Proposition 6.3, the union of the three expansion rules , and . Since 𝐷 0 , the DAG with one vertex and no arcs, is a FDAG, by virtue of what precedes and with Algorithm 12 -here with 𝑔(•) = ⊤, we just defined an enumeration tree covering the whole set of FDAGs, whose root is 𝐷 0 . A fraction of this enumeration tree is shown in Figure 6.4, illustrating the path from the root 𝐷 0 to the FDAG of Figure 5.7. Unexplored branches are ignored, but are still indicated by their respective root.

Growth of the tree

In this section, we analyse the enumeration tree defined in Section 6.1. We exhibit a bijection -Theorem 6.5 -between FDAGs and a class of combinatorial objects from the literature, allowing us to obtain an asymptotic expansion of the growth of the tree. Moreover, we show that any FDAG has a linear number of children in that tree in Theorem 6.7, and that the complexity to construct those children is quadratic -see

𝑘 #𝐸 𝑘 0 1

Asymptotic growth

In this subsection, we show that FDAGs are in bijection with a set of particular matrices, whose combinatorial properties are known and give us access to an asymptotic expansion of the enumeration tree growth.

Let us denote 𝐸 𝑘 the set of all FDAGs that are accessible from 𝐷 0 in exactly 𝑘 steps in the enumeration tree -with 𝐸 0 = {𝐷 0 }; then Table 6.1 depicts the values of #𝐸 𝑘 for the first nine values of 𝑘.

Actually, the terms of Table 6.1 coincide with the first terms of OEIS sequence A158691 29 , which counts the number of row-Fishburn matrices that are upper-triangular matrices with at least one nonzero entry in each row. The size of such a matrix is equal to the sum of its entries. Theorem 6.5 There exists a bijection Φ between the set of FDAGs and the set of row-Fishburn matrices, such that if 𝐷 is a FDAG and 𝑀 = Φ(𝐷), then 𝐷 ∈ 𝐸 𝑘 ⇐⇒ size(𝑀) = 𝑘.

Proof. The proof lies in Appendix B.

This connection is to our advantage since Fishburn matrices (in general) are combinatorial objects widely explored in the literature as they are in bijection with many others -see [START_REF] Hwang | Asymptotics and statistics on Fishburn matrices and their generalizations[END_REF]

Branching factor

Given the overall structure of FDAGs, it is no surprise that the enumeration tree grows extremely fast. However, despite this combinatorial explosion, we show in this subsection that the branching factor, i.e., the outdegree of the nodes in the enumeration tree, is controlled. Actually, we prove that any FDAG has a linear number of successors 30 30: "successor" in the sense of "children in the enumeration tree". We make the distinction to avoid confusion with the children denoted by 𝒞(•).

in the enumeration tree. Theorem 6.7 Any FDAG 𝐷 has Θ(#𝐷) successors in the FDAG enumeration tree.

Proof. Let 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ) be a FDAG. We denote 𝒞 𝜓 (𝑣 𝑛 ) = 𝑎 0 • • • 𝑎 𝑚 . Depending on the rule chosen: 𝑎 𝑚+1 belongs to A < = {0, . . . , 𝑝}, so the maximum number of successors is at most 𝑝 + 1, and at least 1, depending on the condition 𝑎 𝑚 ≥ lex. 𝑎 𝑚+1 . The child of the new vertex is taken from A = = {𝑝 + 1, . . . , 𝑛} so the number of successors is exactly 𝑛 -𝑝. Following Proposition 5.3, the number of successors is exactly #A < = 𝑝 + 1.

Combining everything, the number of successors is at least 𝑛 + 2 and at most 𝑛 + 𝑝 + 2 ≤ 2𝑛 + 1 (as 𝑝 ≤ 𝑛 -1, with equality for FDAGs obtained just after using rule). In the previous proof, we have shown that the number of successors of a FDAG with 𝑛 vertices is between 𝑛 + 1 and 2𝑛 -1. Figure 6.5 illustrates that these boundaries are tight, on 1 000 randomly generated FDAGs. A random FDAG is constructed as follows.

Definition 6.5 (Random FDAG) Let 𝑘 ≥ 0. Starting from 𝐷 0 -the root, construct iteratively 𝐷 𝑖 as a successor of 𝐷 𝑖-1 in the enumeration tree, picked uniformly at random. We stop after 𝑘 steps, and keep 𝐷 𝑘 .

In Figure 6.5, we generated 10 random FDAGs for each 𝑘 ∈ {1, . . . , 100}.

It is indeed a suitable property that any FDAG admits a linear number of successors; but it would be of little use if the time required to compute those successors is too important. We demonstrate in the following proposition that the complexity is manageable. There are two possible strategies: (i) one can keep the enumeration tree in memory, and store on each node only the increment allowing to construct a FDAG from its predecessor; or (ii) one can explicitly build the successors by copying the starting FDAG, so that the tree can be forgotten. Depending on whether one wants to build the tree itself or only the FDAGs that compose it, one will choose either strategy.

Proposition 6.8 Computing the successors of any FDAG 𝐷 has complexity:

(i) 𝒪(#𝐷 deg(𝐷)) if the construction is incremental from 𝐷;

(ii) 𝒪 (#𝐷 deg(𝐷)) 2 if the construction involves copying 𝐷.

Proof. Let 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ) be a FDAG with 𝑛 + 1 vertices, with 𝒞 𝜓 (𝑣 𝑛 ) = 𝑎 0 • • • 𝑎 𝑚 , A < = {0, . . . , 𝑝} and A = = {𝑝 + 1, . . . , 𝑛}. Although the alphabets A < and A = can be retrieved in linear time, it is more efficient to maintain the pair (𝑛, 𝑝) during enumeration; how to update these indices has already been presented in Expansion rules (p. 72), when introducing each rule.

The explicit construction of the successors in case (𝑖𝑖) requires to copy the vertices of 𝐷 and their children, leading to a complexity in the order of 𝑛 𝑖=0 (1 + deg(𝑣 𝑖 )), which can be roughly bounded by (𝑛 + 1)(deg(𝐷) + 1). Depending on the expansion rule, the complexity for computing the new vertex or new arc varies:

The last letter of 𝒞 𝜓 (𝑣 𝑛 ) determines the number of successorsbut it is no more than 𝑝 + 1. In case (𝑖), although we could just store the information of the new letter, it is better to copy 𝒞 𝜓 (𝑣 𝑛 ) and add the new letter and store the result. Indeed, this allows to always have the knowledge of 𝒞 𝜓 (𝑣 𝑛 ) in the enumeration tree. The complexity for case (𝑖) is therefore bounded by deg(𝑣 𝑛 )(𝑝 + 1); whereas it is 𝑝 + 1 in case (𝑖𝑖) since 𝒞 𝜓 (𝑣 𝑛 ) is already copied. Each successor is obtained by picking one element of A = = {𝑝 + 1, . . . , 𝑛}. The complexity is exactly (up to a constant) 𝑛 -𝑝 in both cases. The successors are obtained by Algorithm 13, involving copying subwords of 𝒞 𝜓 (𝑣 𝑛 ) -the overall complexity is bounded by (𝑝 + 1) deg(𝑣 𝑛 ).

The overall complexity is therefore of the order of 2(𝑝 + 1) deg(𝑣 𝑛 ) + 𝑛 -𝑝 in case (𝑖) and of (𝑛 + 1)(deg(𝐷) + 1) [(𝑝 + 1)(deg(𝑣 𝑛 ) + 1) + 𝑛 -𝑝] in case (𝑖𝑖). Using rough bounds, with deg(𝑣 𝑛 ) ≤ deg(𝐷) and 𝑝 ≤ 𝑛, we end up with the stated complexity. Whereas Figure 6.5 shows the number of successors of 1,000 random FDAGs, we measured the time needed to compute explicitly -i.e., implying copy, which is case (𝑖𝑖) in the previous Proposition 6.8 -these successors.

The results are depicted in Figure 6.6, where we plotted (in blue) the total time 𝑡 𝐷 for computing all successors of a given FDAG 𝐷, and (in red) what we call amortized time, i.e. 𝑡 𝐷 /(#𝐷 deg(𝐷)) 2 . As expected from Proposition 6.8, one can observe an asymptotic quadratic behaviour for the total time (in blue); concerning amortized time (in red), despite some variability, the upper bound seems to be constant.

Polynomial delay

Let 𝐸 ≤𝐾+1 = 𝑘≤𝐾+1 𝐸 𝑘 be the set of all FDAGs reachable in at most 𝐾 + 1 steps from the root of the FDAG enumeration tree. In this subsection, we show that the complexity for enumerating 𝐸 ≤𝐾+1 can be expressed as a function of the cardinality of 𝐸 ≤𝐾 and has polynomial delay. Theorem 6.9 Enumerating 𝐸 ≤𝐾+1 has complexity 𝒪(𝐾 2 #𝐸 ≤𝐾 ).

Proof. We adopt the configuration where we keep the enumeration tree in memory and where each node contains the incremental information to construct a FDAG from its predecessor.

We first observe the following: as 𝐷 0 , the root, has one vertex and no arcs, and since the rules of expansion can only add one vertex and/or increase the degree of the last vertex by one, for any 𝐷 ∈ 𝐸 𝑘 , it follows naturally that #𝐷 ≤ 𝑘 + 1 and deg(𝐷) ≤ 𝑘. It implies that the complexity for generating the successors of a FDAG in 𝐸 𝑘 is 𝒪(𝑘 2 ), according to case (𝑖) of Proposition 6.8.

Thus, enumerating all the elements of 𝐸 𝑘+1 requires a complexity of 𝒪(𝑘 2 #𝐸 𝑘 ). It follows that we have a complexity of 𝒪 𝑘≤𝐾 𝑘 2 #𝐸 𝑘 for enumerating 𝐸 ≤𝐾+1 . Since 𝑘 ≤ 𝐾 and 𝑘≤𝐾 #𝐸 𝐾 = #𝐸 ≤𝐾 , we end up with the announced complexity.

As such, our algorithm has a polynomial delay, which is desirable for this kind of enumeration [START_REF] David S Johnson | On generating all maximal independent sets[END_REF] [80]: Johnson et al. (1988), 'On generating all maximal independent sets' .

Variations on the enumeration tree

In this section, three variants of the enumeration tree presented in Section 6.1 are introduced. First, we propose a way to enumerate forests in their classical sense, i.e., where redundancies within the forest are accepted, by adding an extra step following the previous enumeration. Then, a very simple adaptation is proposed to restrict the enumeration to a very specific class of trees, the self-nested trees. Finally, options to constrain the enumeration tree -on maximum number of vertices, height or outdegree -and making it finite are proposed.

Extension to forests with repetitions

The enumeration tree constructed in Section 6.1 only allows to enumerate, in their compressed form, irredundant forests, where no tree can be a subtree of (or equal to) another. In this subsection, we propose a method to enumerate forests in the usual sense, without this non-redundancy restriction.

31: Note that this is different from the presence defined in Connection between a forest and its compressed form (p. [START_REF] Kubale | Graph colorings[END_REF], where the presence counts how many nodes in a tree or forest have a given equivalence class.

Let 𝐹 be a forest in the classical sense, i.e., where some trees may be identical to or subtrees of other trees. If we compute 𝐷 = ℜ(𝐹) -without resorting to an artificial root, i.e. following the method described in Irredundant forests (p. 65), all these redundancies will be lost: if a tree is a subtree of another one, then it will be compressed with this subtree as a same vertex in the DAG. This is why DAG compression of forestswithout artificial root -is lossless if and only if the forest is irredundant.

We can preserve the information lost by the compression if we keep, in addition, a presence vector 31 . Let us rewrite 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ) according to the canonical order. Each tree 𝑇 ∈ 𝐹 is associated with an index 𝑖 ∈ {0, . . . , 𝑛} such that 𝑇 = ℜ -1 (𝐷[𝑣 𝑖 ]). The presence vector 𝜋 𝐹 : {0, . . . , 𝑛} → N is constructed such that 𝜋 𝐹 (𝑖) counts how many times the tree ℜ -1 (𝐷[𝑣 𝑖 ]) appears in 𝐹. Thus, the couple (𝐷, 𝜋 𝐹 ) completely characterizes the forest 𝐹. To enumerate all (redundant) forests, it is therefore sufficient to enumerate both all FDAGs (corresponding to irredundant forests) and the presence vectors that may be associated with them.

Let 𝐷 be an FDAG constructed in the FDAG enumeration tree. We define 𝜋 𝐷 as the presence vector associated to the (irredundant) forest ℜ -1 (𝐷). This vector can be computed in a linear traversal of 𝐷, where the sources of 𝐷 are assigned a value of 1 and the other vertices are assigned a value of 0. Adding redundancies in a forest means incrementing the presence vector, each +1 resulting in a new tree, whether it is equal to an existing tree or a subtree of it.

Our strategy is to enumerate, from 𝜋 𝐷 , all presence vectors corresponding to forests whose DAG reduction would be exactly 𝐷. To do so, we use a reverse search structure, with the following expansion rule (𝐸). Let 𝑗 be the index of the last increment, initialized to 𝑗 = 0, and let 𝜋 be the current presence vector. This rule allows to get any presence vector from 𝜋 𝐷 in a unique way, i.e., each index must be increased to its desired final value before moving to the next index. This defines an enumeration tree of presence vectors. If we implement this tree in such a way that each node contains only the new index 𝑗 ′ , we obtain an algorithm that enumerates each presence vector from its parent in constant time and space. The growth of this (infinite) new enumeration tree is given by the following proposition. Proposition 6. 10 The number of redundant forests that can be constructed in at most 𝑘 ≥ 1 steps from ℜ -1 (𝐷) -following expansion rule (𝐸) -is given by 𝑛+1+𝑘 𝑘 -1.

Proof. We first notice that the expected number is exactly the same as the number of presence vectors constructible in at most 𝑘 steps from 𝜋 𝐷 . We then notice that if the current node (in the presence vector enumeration tree) has index 𝑗, then it has 𝑛 + 1 -𝑗 successors by the expansion rule (𝐸) of Definition 6.6. For instance, since the starting index is 0, for 𝑘 = 1, we obtain the indices 0, . . . , 𝑛 in one copy each. We denote by 𝑛 𝑝 (𝑗) the 𝑇 ℜ(𝑇) number of times the index 𝑗 appears in the nodes obtained in exactly 𝑝 steps from the origin. Thus, 𝑛 1 (𝑗) = 1 by the above. Each index 𝑗 ′ ≤ 𝑗 existing at step 𝑝 -1 will induce a successor with index 𝑗 at step 𝑝, so that 𝑛 𝑝 (𝑗)

= 𝑗 𝑗 ′ =0 𝑛 𝑝-1 (𝑗 ′ ).
We establish by induction on 𝑝 that 𝑛 𝑝 (𝑗) = 𝑘-1+𝑗 𝑗 , using the so called hockey-stick identity 𝑚 𝑟=0 𝑛+𝑟 𝑟 = 𝑛+1+𝑚 𝑚 [START_REF] Charles | Generalized Hockey Stick Identities and N-dimensional Blockwalking[END_REF] [91]: Jones (1994), 'Generalized Hockey Stick Identities and N-dimensional Blockwalking'

. Since the number of presence vectors that can be constructed in at most 𝑘 ≥ 1 steps from 𝜋 𝐷 is given by 𝑘 𝑝=1 𝑛 𝑗=0 𝑛 𝑝 (𝑗), we obtain the expected result after applying twice the hockey-stick identity.

We can merge the enumeration tree of repetitions with the enumeration tree of FDAGs, to form a single enumeration tree, which enumerates forests in the classical sense (and in compressed form), as follows: the nodes of the enumeration tree carry a couple (FDAG, presence vector), and the available expansion rules are , , and (𝐸). However, successors created with the last rule produce branches where it becomes the only rule available. In other words, once one chooses repetition, one can not modify any longer the topology of the FDAG -this is to ensure that each forest can only be enumerated in a unique way.

Enumeration of self-nested trees

Self-nested trees are a class of trees introduced in [START_REF] Greenlaw | Subtree isomorphism is in DLOG for nested trees[END_REF] [92]: [START_REF] Greenlaw | Subtree isomorphism is in DLOG for nested trees[END_REF], 'Subtree isomorphism is in DLOG for nested trees' that achieve maximum redundancy in their subtrees. More precisely, Definition 6.7 A tree 𝑇 is called self-nested if for any 𝑢, 𝑣 ∈ 𝑇,

ℋ (𝑢) = ℋ (𝑣) =⇒ 𝑇[𝑢] ≃ 𝑇[𝑣].
Self-nested trees are closely related with linear DAGs (i.e. DAGs containing at least one path going through all vertices), as per the following proposition [START_REF] Godin | Quantifying the degree of self-nestedness of trees: application to the structural analysis of plants[END_REF] [61]: [START_REF] Godin | Quantifying the degree of self-nestedness of trees: application to the structural analysis of plants[END_REF], 'Quantifying the degree of self-nestedness of trees: application to the structural analysis of plants'

. See also Figure 6.7.

Proposition 6.11 (Godin, Ferraro) A tree 𝑇 is self-nested if and only if ℜ(𝑇) is linear.

These trees have many algorithmic qualities, both from the point of view of compression rates and the evaluation of recursive functions, or even the calculation of editing distances, as shown in [START_REF] Azaïs | Approximation of trees by self-nested trees[END_REF] . In particular, it is shown that self-nested trees are particularly rare within the space of unordered trees. It follows that the exhaustive exploration of the space of self-nested trees is exponentially easier than for general trees -although [START_REF] Azaïs | Approximation of trees by self-nested trees[END_REF] does not provide an enumeration algorithm for it.

Thanks to the expansion rules introduced earlier, it becomes straightforward to propose an enumeration tree for self-nested trees: it is enough to forbid the rule, and keep only and . Indeed, there can be only one vertex at each height (obtained by ), and thus the enumerated FDAGs will be linear. Also note that since each enumerated FDAG has only one root, it does compress a single tree and not a forest.

Constraining the enumeration

In [START_REF] Nakano | Efficient generation of rooted trees[END_REF] [30]: [START_REF] Nakano | Efficient generation of rooted trees[END_REF], 'Efficient generation of rooted trees' , the authors propose an algorithm to enumerate all trees with at most 𝑛 vertices. They simply check whether the current tree has 𝑛 vertices or not, and as their expansion rule adds one vertex at a time, they decide to cut a branch in the enumeration tree once they have reached 𝑛 vertices. Similarly, adding a vertex to a tree can only increase its height or outdegree, so we can proceed in the same way to enumerate all trees with maximal height 𝐻 and maximal outdegree 𝑑. Indeed, the number of trees satisfying those constraints is finite [START_REF] Azaïs | Approximation of trees by self-nested trees[END_REF] . This property also holds with the approach presented in Section 6.1: following one of the three expansion rules, we can only increase the height, outdegree or number of vertices of the FDAG. So, it makes sense to define similar constraints on the enumeration. However, for this constrained enumeration to generate a finite number of FDAGs, constraints must be chosen wisely, as shown in the following proposition.

Proposition 6.12 The enumeration tree of FDAGs is finite if at least one of those set of constraints is chosen:

(i) maximum number of vertices 𝑛 and maximum outdegree 𝑑, (ii) maximum height 𝐻 and maximum outdegree 𝑑.

Proof. As

allows to add arcs indefinitely without changing the numbers of vertices, constraining on the maximum outdegree is mandatory in both cases. As the two others rules add vertices, constraining by the number of vertices leads to a finite enumeration tree -(i) is proved. To conclude, we only need to prove that can not be repeated an infinite number of times, i.e. there is only a finite number of new vertices that can be added at a given height, up to the maximum outdegree. This is achieved by virtue of the upcoming lemma.

Let 𝐻 > 2 and 𝑑 ≥ 1. Let 𝐷 be the FDAG constructed so that for each 0 ≤ ℎ ≤ 𝐻, 𝐷 has the maximum possible number 𝑛 ℎ of vertices of height ℎ and with maximum outdegree 𝑑. Initial values are 𝑛 0 = 1 and 𝑛 1 = 𝑑.

Lemma 6.13 ∀2 ≤ ℎ ≤ 𝐻, 𝑛 ℎ = 𝑑 𝑘=1 𝑘 + 𝑛 ℎ-1 -1 𝑘 𝑑 -𝑘 + 𝑛 0 + • • • + 𝑛 ℎ-2 𝑑 -𝑘 .
Let ℎ ≥ 2 be fixed. To lighten the notation, let 𝑛 = 𝑛 ℎ-1 and

𝑚 = 𝑛 0 + • • • + 𝑛 ℎ-2 .
Let 𝑣 be a vertex to be added at height ℎ. For any vertex 𝑣 𝑖 at height ℎ -1, let 𝑥 𝑖 be the multiplicity of 𝑣 𝑖 in 𝒞(𝑣) -0 if 𝑣 𝑖 ∉ 𝒞(𝑣).

Similarly, for any vertex 𝑣 ℎ with ℋ (𝑣 𝑗 ) ≤ ℎ -2, 𝑦 𝑗 is the multiplicity of 𝑣 𝑗 in 𝒞(𝑣) -possibly 0. By definition of ℋ (•) -see Equation 2.1, at least one 𝑥 𝑖 is non-zero. Therefore, there exist 𝑘 ∈ [ [1, 𝑑]] such that: 32: Not to be confused with subDAG, introduced in Section 2.3. A subDAG admits a single root and therefore compresses a single tree, whereas a subFDAG admits several roots and compresses a forest.

𝑥 1 + • • • + 𝑥 𝑛 = 𝑘 𝑦 1 + • • • + 𝑦 𝑚 ≤ 𝑑 -𝑘 2 3 2 (a) 2 (b) 𝑡 1 𝑡 2 𝑓 = {𝑡 1 , 𝑡 2 } (c) 𝑇 1 𝑇 2 𝑇 3 𝐹 = {𝑇 1 , 𝑇 2 , 𝑇 3 } (d)
Proof. We recall that the notation 𝐷[𝑣] stands for the subDAG of 𝐷 rooted in 𝑣 composed of 𝑣 and all its descendants 𝒟(𝑣).

𝑡 = ℜ -1 (𝐷[𝜌]) is a subtree of 𝑇 = ℜ -1 (𝐷[𝑟]) - with 𝑇 ∈ 𝐹 = ℜ -1 (𝐷). As Δ[𝜌] and 𝐷[𝜌] are isomorphic, 𝑡 ∈ 𝑓 = ℜ -1 (Δ).
Therefore we have proved that ∀𝑡 ∈ 𝑓 , ∃𝑇 ∈ 𝐹, 𝑡 ∈ 𝒮(𝑇).

We say that the FDAG Δ is a subFDAG 32 of 𝐷. Figure 6.8 provides an example of such a construction.

Enumeration of subFDAGs

We now solve the following enumeration problem: given a forest 𝐹, find all forests of subtrees of 𝐹. Equally, given a FDAG 𝐷, find all subFDAGs of 𝐷. To address this, we make extensive use of the reverse search technique, adapting the one presented in Section 6.1.

Since a subFDAG is also a FDAG, it admits successors in the enumeration tree defined in Section 6.1. We are interested in those of these successors that are also subFDAGs (if any). In fact, since a subFDAG can be defined from a set of vertices, all one has to do is determine which new vertex can be chosen to expand an existing subFDAG -corresponding to a or step.The covering of all added new arcs is implicit in this construction and corresponds to some steps of .

Let Δ be a subFDAG of 𝐷 and 𝑣 its last inserted vertex -it is also the vertex with the largest ordering number in Δ. We denote by 𝑆(Δ) the set of all vertices 𝑣 ′ ∈ 𝐷 that can be added to Δ to expand it to a new subFDAG. Let us call 𝑆(Δ) the set of candidate vertices of Δ. More precisely: Lemma 6.15 𝑆(Δ) is the set of vertices 𝑣 ′ ∈ 𝐷 that satisfies both:

(i) 𝒞(𝑣 ′ ) ⊆ Δ, (ii) 𝜓(𝑣 ′ ) > 𝜓(𝑣),
where 𝜓(•) is the canonical ordering of 𝐷. Proof. (i) This condition is necessary so that Δ ′ = Δ ∪ {𝑣 ′ } fulfill the requirements for Proposition 6.14. (ii) This condition is necessary so that Δ ′ remains a FDAG. As 𝜓(𝑣 ′ ) > 𝜓(𝑣), either ℋ (𝑣 ′ ) = ℋ (𝑣) + 1 -then it is a step -or ℋ (𝑣 ′ ) = ℋ (𝑣) and 𝒞 𝜓 (𝑣 ′ ) > lex. 𝒞 𝜓 (𝑣) -for a step.

Algorithm 15: Heirs

Input: 𝐷, Δ, 𝑆(Δ) Set 𝐿 to the empty list for 𝑠 ∈ 𝑆(Δ) do

Let 𝑆 ′ be a copy of 𝑆(Δ)

𝑆 ′ ← 𝑆 ′ \ {𝑣 ′ ∈ 𝑆 ′ : 𝒞 𝜓 (𝑣 ′ ) ≤ lex. 𝒞 𝜓 (𝑠)} 𝑆 ′ ← 𝑆 ′ ∪ 𝑣 ′ ∈ 𝐷 : 𝑠 ∈ 𝒞(𝑣 ′ ) ⊆ Δ ∪ {𝑠} Add Δ ∪ {𝑠}, 𝑆 ′ to 𝐿 return 𝐿 When 𝑆(Δ) is not empty, picking 𝑠 ∈ 𝑆(Δ) ensure that Δ ′ = Δ ∪ {𝑠} is a subFDAG of 𝐷.
With respect to the enumeration tree of Section 6.1, Δ is an ancestor of Δ ′ -but not necessarily its parent, since the steps of are implicit. Δ ′ is called an heir of Δ. We can in turn calculate 𝑆(Δ ′ ), by updating 𝑆(Δ): (i) remove from 𝑆(Δ) all vertices 𝑣 ′ such that 𝜓(𝑠) > 𝜓(𝑣 ′ );

(ii) in 𝐷, look only after the vertices 𝑣 ′ such that 𝑠 ∈ 𝒞(𝑣 ′ ) ⊆ Δ ∪ {𝑠} and add them to 𝑆(Δ ′ ).

If Δ ′ is an heir of Δ, then by removing the last inserted vertex of Δ ′ , one can retrieve Δ. This defines a reduction rule 𝑓 , and therefore an enumeration tree. Algorithm 15 is meant to construct the set 𝑓 -1 (Δ).

Applying Algorithm 12 together with it, and starting from Δ = ℒ(𝐷) 33 -in this case, 𝑆(Δ) is the set of parents of ℒ(𝐷) of height 1 -permits to enumerate all subFDAGs of 𝐷.

Frequent subFDAG mining problem

We focus here on a particular instance of the frequent mining pattern problem, as defined in Section 5. A first, naive strategy would be to first build the ℱ 𝑖 's, e.g. by using Algorithm 15 on ℜ(𝑇 𝑖 ), and then construct ∩ 𝑖∈𝐼 𝜎 ℱ 𝑖 for all possible choices of 𝐼 𝜎 . Obviously, this approach has its weaknesses: (i) many subFDAGs will be enumerated for nothing or in several copies, and (ii) it does not take into account that 𝒳 is itself a forest. Our aim is to propose a variant of Algorithm 15 that, applied to ℜ(𝒳), would enumerate only subFDAGs appearing in the ℜ(𝑇 𝑖 )'s with a large enough frequency.

Given a forest 𝐹 = {𝑇 1 , . . . , 𝑇 𝑛 } and its DAG compression 𝐷 = ℜ(𝐹), we have to retrieve, for each vertex in 𝐷, its origin in the dataset, that is, which tree they come from. This issue has already been addressed in Connection between a forest and its compressed form (p. [START_REF] Kubale | Graph colorings[END_REF], under the name of origin. We recall that, the origin of a vertex 𝑣 ∈ 𝐷, denoted by o(𝑣), represents the set of trees in 𝐹 for which ℜ -1 (𝐷[𝑣]) is a subtree.

Let Δ be a subFDAG of 𝐷. For Δ to compress a forest of subtrees of a tree 𝑇 𝑖 , it is necessary that 𝑖 ∈ o(𝑣) for all 𝑣 ∈ Δ. Therefore, the set of trees for which Δ compress a forest of subtrees -the origin of Δ, denoted by o(Δ)is equal to

o(Δ) = 𝑣∈Δ o(𝑣). If Δ ′ = Δ ∪ {𝑠} is an heir of Δ -as defined earlier, then o(Δ ′ ) = o(Δ) ∩ o(𝑠).
Algorithm 15 can therefore be refined so that Δ ′ should be ignored if o(Δ ′ ) = ∅ -as Δ ′ does not anymore compresses any forest of subtrees actually present in the trees of 𝐹.

So far we neglected the threshold 𝜎. We only want to keep subFDAGs that appear in at least 𝜎% of the data. If # o(Δ)/#𝐹 < 𝜎, then the successors of Δ are not investigated. Indeed, as o(•) is a decreasing function, successors of Δ can not exceed the threshold again.

We can finally introduce Algorithm 16 that solves the frequent subFDAG mining problem for trees. With the notations of Section 5.1, this algorithm builds the set {Δ ′ ∈ 𝑓 -1 (Δ) : freq(Δ ′ , 𝐹) ≥ 𝜎}, with freq(Δ ′ , 𝐹) = # o(Δ ′ )/#𝐹. The set is also built directly, without any posterior filtering, which is suitable as discussed at the beginning of the present subsection.

Algorithm 16:

FrequentHeirs

Input: 𝐷 = ℜ(𝐹), Δ, 𝑆(Δ), o(Δ) , 𝜎 1 Set 𝐿 to the empty list 2 for 𝑠 ∈ 𝑆(Δ) do 3 if o(Δ) ∩ o(𝑠) ≠ ∅ and #(o(Δ) ∩ o(𝑠)) ≥ 𝜎 • #𝐹 then 4 Let 𝑆 ′ be a copy of 𝑆(Δ) 5 𝑆 ′ ← 𝑆 ′ \ {𝑣 ′ ∈ 𝑆 ′ : 𝒞 𝜓 (𝑣 ′ ) ≤ lex. 𝒞 𝜓 (𝑠)} 6 𝑆 ′ ← 𝑆 ′ ∪ 𝑣 ′ ∈ 𝐷 : 𝑠 ∈ 𝒞(𝑣 ′ ) ⊆ 𝐷 0 ∪ {𝑠} 7 Add Δ ∪ {𝑠}, 𝑆 ′ , o(Δ) ∩ o(𝑠) to 𝐿 8 return 𝐿
We stated earlier that we wanted to avoid generating unnecessary or multiple copies of subFDAGs, which is achieved with Algorithm 16. We now empirically study what we have gained from this, by comparing the use of Algorithm 16 on 𝐷 = ℜ(𝐹), with the use of Algorithm 15 on each ℜ(𝑇 𝑖 ). As in Branching factor (p. 78), we generated 1 000 random FDAGs 𝐷 𝑘 , 10 repetitions for each 𝑘 ∈ {1, . . . , 100}, creating 𝐷 𝑘 as in Definition 6.5. We assume 𝐷 𝑘 = ℜ( 𝑓 ) where 𝑓 = {ℜ -1 (𝐷 𝑘 [𝑟]) : 𝑟 ∈ ℛ(𝐷 𝑘 )}. For each 𝐷 𝑘 , we have computed the quotient

𝑄(𝐷 𝑘 ) = #{subFDAGs of 𝐷 𝑘 enumerated via Algorithm 16} 𝑟∈ℛ(𝐷 𝑘 ) #{ subFDAGs of 𝐷 𝑘 [𝑟] enumerated via Algorithm 15}
with parameter 𝜎 = 0 when using Algorithm 16. The results are provided in Figure 6.10. Despite a rather marked variability, there is a general trend of decreasing as the number of vertices increases. We obtain fairly low quotients, around 20%, quite quickly. Given the combinatorial explosion of the objects to be enumerated, such an advantage is of the greatest interest.

The Subtree Kernel Revisited

The subtree kernel 7 In this chapter and the next one, we focus on the issue of statistical analysis of tree data, which is difficult given their non-Euclidean nature.

In Section 7.1, we introduce kernel methods, a family of techniques particularly useful for dealing with tree data. In particular, we introduce the subtree kernel, on which our analysis focuses.

Section 7.2 is dedicated to the introduction of a stochastic tree model that allows us to perform a performance analysis of said kernel, and in particular to infer a desirable property on one of the kernel parametersnamed the weight.

Parts of this chapter are reproduced from [START_REF] Azaïs | The weight function in the subtree kernel is decisive[END_REF] [39]: Azaïs et al. ( 2020), 'The weight function in the subtree kernel is decisive'

, in particular Section 7.2.

Kernel methods

Suppose we have data (of any nature) and we want to find relations and structures in this data -e.g. clusters, correlations, etc. There is no guarantee that these relationships, if they exist, are immediately accessible. Sometimes it is better not to use the raw data, but rather to transform them, via an user-specified feature map. They are sent to a (inner product) feature space, in which it is expected that relations between the data will appear more naturally. This approach is particularly relevant for non-Euclidean data (such as trees), since by choosing an appropriate feature space, one can use standard statistical methods to process them. A very simple example is presented in Figure 7.1. .1: Suppose we want to build a classifier to separate the red and blue data (on the left). However, imagine the algorithm we have only allows to build linear classifiers: there is no hope to succeed. On the other hand, via a well-chosen feature map 𝜑, one can send the data into a space in which they are linearly separable -see the green line (on the right).

On the other hand, choosing the proper feature space and finding out the mapping might be very difficult. Furthermore, the curse of dimensionality takes place and the feature space may be extremely big, therefore impossible to use. Fortunately, a wide range of prediction algorithms do not need to access that feature space, but only the inner product between elements of the feature space. Building a function, called a kernel, that simulates an inner product in an implicit feature space, frees us from constructing a mapping.

Kernel trick

Let us first define kernels. Let 𝒳 be the space of considered data. The main interest of kernels comes from Mercer's theorem [START_REF] Mercer | XVI. Functions of positive and negative type, and their connection the theory of integral equations[END_REF] [96]: Mercer (1909), 'XVI. Functions of positive and negative type, and their connection the theory of integral equations' .

Theorem 7.1 (Mercer) If 𝐾 is a (positive semi-definite) kernel, then there exists a (inner product) feature space 𝒴 and a mapping 𝜑 : 𝒳 → 𝒴 such that, for any 𝑥, 𝑦 ∈ 𝒳, 𝐾(𝑥, 𝑦) = ⟨𝜑(𝑥), 𝜑(𝑦)⟩ 𝒴 .

Proof. The proof can be found in [START_REF] Cristianini | An introduction to support vector machines and other kernel-based learning methods[END_REF].

This technique is known as the kernel trick. It is sufficient to construct a function 𝐾 verifying Equation 7.1 on the data space (even non-Euclidean), to be certain of the existence of a feature space, on which 𝐾 plays the role of an inner product. From then on, all the statistical methods which only use the inner product of the data become accessible, without even needing to explicitly exhibit the feature space nor the mapping allowing to access it.

Algorithms that can use kernels include Support Vector Machines (SVM), Principal Components Analysis (PCA) and many others. We refer the reader to the books [33, 97- and the references therein for more detailed explanations of theory and applications of kernels.

The construction of kernels is facilitated by virtue of the following proposition, whose proof can also be found in [START_REF] Cristianini | An introduction to support vector machines and other kernel-based learning methods[END_REF]. Proposition 7.2 Let 𝐾 1 , 𝐾 2 be two kernels on 𝒳 and 𝑎 ∈ R + . Let also (𝐾 𝑛 ) 𝑛∈N be a sequence of kernels on 𝒳. Then, are also kernels on 𝒳:

▶ 𝐾 1 + 𝐾 2 , 𝑎𝐾 1 and 𝐾 1 𝐾 2 , ▶ 𝐾 = lim 𝑛→∞ 𝐾 𝑛 .
, which establishes a unifying formalism to express most convolution kernels on trees.

In this chapter and the next, we focus on the subtree kernel as defined by [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF]. The subtree kernel is a convolution kernel on trees for which the similarity between two trees is measured through the similarity of their subtrees. A subtree kernel 𝐾 on trees (ordered or not, unlabeled 34 ) is defined as,

∀𝑇 1 , 𝑇 2 ∈ 𝒯 , 𝐾(𝑇 1 , 𝑇 2 ) = 𝑡∈𝒯 𝑤 𝑡 𝜅 (N 𝑡 (𝑇 1 ), N 𝑡 (𝑇 2 )) , (7.2)
where 𝑤 𝑡 is a weight associated to the tree 𝑡, N 𝑡 (𝑇) 35 35: 𝑁 𝑡 (𝑇) is exactly equal, with the notations of Connection between a forest and its compressed form (p. [START_REF] Kubale | Graph colorings[END_REF], to the presence 𝜋([𝑡]) of vertex [𝑡] in the DAG ℜ(𝑇). This will be exploited in upcoming Chapter 8.

counts the number of subtrees of 𝑇 that are isomorphic to 𝑡 and 𝜅 is a kernel function on N, Z or R. Assuming 𝜅(0, 𝑛) = 𝜅(𝑛, 0) = 0, Equation 7.2 becomes

𝐾(𝑇 1 , 𝑇 2 ) = 𝑡∈𝒮(𝑇 1 )∩𝒮(𝑇 2 ) 𝑤 𝑡 𝜅 (N 𝑡 (𝑇 1 ), N 𝑡 (𝑇 2 )) , (7.3)
making the sum finite. Indeed, all the subtrees 𝑡 ∈ 𝒯 \ (𝒮(𝑇 1 ) ∩ 𝒮(𝑇 2 )) do not count in the sum Equation 7.2. Here, as for [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF], we assume that 𝜅(𝑛, 𝑚) = 𝑛𝑚, then we get the subtree kernel as introduced in [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF].

Definition 7.2

The subtree kernel between two trees 𝑇 1 and 𝑇 2 is defined as

𝐾(𝑇 1 , 𝑇 2 ) = 𝑡∈𝒮(𝑇 1 )∩𝒮(𝑇 2 ) 𝑤 𝑡 N 𝑡 (𝑇 1 ) N 𝑡 (𝑇 2 ). (7.4)
An example of kernel computation is provided in Figure 7.2.

The weight function 𝑡 ↦ → 𝑤 𝑡 is the only remaining parameter to be tuned.

In the literature, the weight is usually assumed to be a function of a quantity measuring the "size" of 𝑡, in particular its height ℋ (𝑡). Then 𝑤 𝑡 is taken as an exponential decay of this quantity, 𝑤 𝑡 = 𝜆 ℋ (𝑡) for some 𝜆 ∈ [0, 1] -as in [START_REF] Collins | Convolution kernels for natural language[END_REF][START_REF] Da | Kernel methods for tree structured data[END_REF][START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF][START_REF] Kimura | A subpath kernel for rooted unordered trees[END_REF] and [START_REF] Aiolli | Fast on-line kernel learning for trees[END_REF] [102]: Aiolli et al. ( 2006), 'Fast on-line kernel learning for trees'

. This choice can be justified in the following manner. If a subtree 𝑡 is counted in the kernel, then all its subtrees are also counted. Then an exponential decay counterbalances the growth of subtrees. On the other hand, as can be seen from the example of Figure 7.2, the contribution of leaves is generally preponderant over the contribution of other subtrees since 𝑤 • = 𝜆 0 = 1. One of the goals of Section 7.2 is to show that it is better to impose 𝑤 • = 0.

Theoretical study

In this section, we define a stochastic model of 2-classes tree data. From this ideal data set, we prove the efficiency of the subtree kernel and derive the sufficient size of the training data set to get a classifier with a given prediction error. We also state on this simple model that the weight of leaves should always be 0. We emphasize that this study is valid for both ordered and unordered trees.

Two trees as different as possible

Our goal is to build a 2-classes data set of random trees. To this end, we first define two typical trees 𝑇 0 and 𝑇 1 that are as different as possible in terms of subtree kernel.

Let 𝑇 0 and 𝑇 1 be two trees that fulfill the following conditions:

(i) ∀𝑖 ∈ {0, 1}, ∀𝑢, 𝑣 ∈ 𝑇 𝑖 \ ℒ(𝑇 𝑖 ), if 𝑢 ≠ 𝑣 then 𝑇 𝑖 [𝑢] 𝑇 𝑖 [𝑣], i.e, two subtrees of 𝑇 𝑖 are not isomorphic (except leaves). (ii) ∀𝑢 ∈ 𝑇 0 \ ℒ(𝑇 0 ), ∀𝑣 ∈ 𝑇 1 \ ℒ(𝑇 1 ), 𝑇 0 [𝑢] 𝑇 1 [𝑣],
i.e., any subtree of 𝑇 0 is not isomorphic to a subtree of 𝑇 1 (except leaves).

These two assumptions ensure that the trees 𝑇 0 and 𝑇 1 are as different as possible. Indeed, it is easy to see that

𝐾(𝑇 0 , 𝑇 1 ) = 𝑤 • # ℒ(𝑇 0 )# ℒ(𝑇 1 ),
which is the minimal value of the kernel and where 𝜔 • is the weight of leaves. We refer to Figure 7.3 for an example of trees that satisfy these conditions.

Trees of class 𝑖 will be obtained as random editions of 𝑇 𝑖 . In the sequel, 𝑇 𝑖 (𝑣 ↦ → 𝜏) denotes the tree 𝑇 𝑖 in which the subtree rooted at 𝑣 has been replaced by 𝜏. These random edits will tend to make trees of class 0 closer to trees of class 1. To this end, we introduce the following additional assumption. Let (𝜏 ℎ ) a sequence of trees such that ℋ (𝜏 ℎ ) = ℎ.

(iii) Let 𝑢 ∈ 𝑇 0 and 𝑣 ∈ 𝑇 1 . We consider the edited trees

𝑇 ′ 0 = 𝑇 0 (𝑢 ↦ → 𝜏 ℋ (𝑢) ) and 𝑇 ′ 1 = 𝑇 1 (𝑣 ↦ → 𝜏 ℋ (𝑣) ). Then, ∀ 𝑢 ′ ∈ 𝑇 ′ 0 \ 𝜏 ℋ (𝑢) ∪ ℒ(𝑇 ′ 0 ) , ∀ 𝑣 ′ ∈ 𝑇 ′ 1 \ 𝜏 ℋ (𝑣) ∪ ℒ(𝑇 ′ 1 ) , 𝑇 ′ 0 [𝑢 ′ ] 𝑇 ′ 1 [𝑣 ′ ].
In other words, if one replaces subtrees of 𝑇 0 and 𝑇 1 by subtrees of the same height, then any subtree of 𝑇 0 is not isomorphic to a subtree of 𝑇 1 (except the new subtrees and leaves). This means that the similarity between random edits of 𝑇 0 and 𝑇 1 will come only from the new subtrees and not from collateral modifications. We refer to Figure 7.4 for an example of trees that satisfy these conditions.

A stochastic model of 2-classes tree data

From now on, we assume that, for any ℎ > 0, 𝜏 ℎ is not a subtree of 𝑇 0 or 𝑇 1 . For the sake of simplicity, 𝑇 0 and 𝑇 1 have the same height 𝐻. In addition, if 𝑢 ∈ 𝑇 𝑖 then 𝑇 𝑢 𝑖 denotes 𝑇 𝑖 (𝑢 ↦ → 𝜏 ℋ (𝑢) ). The stochastic model of 2-classes tree data that we consider is defined from the binomial distribution 𝑃 𝜌 = ℬ(𝐻, 𝜌/𝐻) on support {0, . . . , 𝐻} with mean 𝑃 𝜌 = 𝜌. The parameter 𝜌 ∈ [0, 𝐻] is fixed. In the data set, class 𝑖 is composed of random trees 𝑇 𝑢 𝑖 , where the vertex 𝑢 has been picked uniformly at random among vertices of height ℎ in 𝑇 𝑖 , where ℎ follows 𝑃 𝜌 . Furthermore, the considered training data set is well-balanced in the sense that it contains the same number of data of each class.

Intuitively, when 𝜌 increases, the trees are more degraded and thus two trees of different class are closer. 𝜌 somehow measures the similarity between the two classes. In other words, the larger 𝜌, the more difficult is the supervised classification problem.

Remark 7.1

The structure of a markup document such as an HTML page can be described by a tree (see Preliminaries (p. 106) and especially Figure 8.2 for more details). In this context, the tree 𝑇 𝑖 , 𝑖 ∈ {0, 1}, can be seen as a model of the structure of a webpage template. By assumption, the two templates of interest are as different as possible. However, they are completed in a similar manner, for example to present the same content in two different layouts. Edition of the templates is modeled by random edit operations. They tend to bring trees from different templates closer.

Theoretical guarantees on the subtree kernel

E 𝑥 ′ ,𝑦 [𝐾(𝑥, 𝑥 ′ ) -𝐾(𝑥, 𝑦)] ≥ 𝛾,
where label(𝑥) = label(𝑥 ′ ) ≠ label(𝑦). From this definition, the authors derive the following simple classifier: the class of a new data 𝑥 is predicted by 1 if 𝑥 is more similar on average to points in class 1 than to points in class 0, and 0 otherwise -see Algorithm 17. In addition, they prove [103, Theorem 1] that a well-balanced training data set of size 32/𝛾 2 log(2/𝛿) is sufficient so that, with probability at least 1 -𝛿, the above algorithm applied to an (𝜖, 𝛾)-strongly good similarity function produces a classifier with error at most 𝜖 + 𝛿.

Algorithm 17: Classifier

Input: 𝑥 ∈ 𝒳 1 Let 𝑆 𝑖 be the set of known data of class 𝑖. We aim to prove comparable results for the subtree kernel -which is not a similarity function. To this end, we focus for 𝑖 ∈ {0, 1} on

2 if 1 #𝑆 1 𝑦∈𝑆 1 𝐾(𝑥, 𝑦) ≥ 1 #𝑆 0 𝑦∈𝑆 0 𝐾(𝑥, 𝑦)
Δ 𝑖 𝑥 = E 𝑢,𝑣 [𝐾(𝑇 𝑥 𝑖 , 𝑇 𝑢 𝑖 ) -𝐾(𝑇 𝑥 𝑖 , 𝑇 𝑣 1-𝑖 )]. (7.5)
We emphasize that the two following results (Proposition 7.3 and Corollary 7.4) assume that the weight of leaves 𝜔 • is 0. For the sake of readability, we introduce the following notations, for any 0 ≤ ℎ ≤ 𝐻 and 𝑖 ∈ {0, 1},

𝐾 𝑖,ℎ = max {𝑢∈𝑇 𝑖 : ℋ (𝑢)=ℎ} 𝐾(𝑇 𝑖 [𝑢], 𝑇 𝑖 [𝑢]), 𝐶 𝑖,ℎ = 𝐾(𝑇 𝑖 , 𝑇 𝑖 ) -𝐾 𝑖,ℎ # ℒ(𝑇 𝑖 ) , 𝐺 𝜌 (ℎ) = 1 - 𝐻 𝑘=ℎ+1 𝑃 𝜌 (𝑘).
The following results are expressed in terms of a parameter 0 ≤ ℎ < 𝐻.

The statement is then true with probability 𝐺 𝜌 (ℎ). This is equivalent to state a result that is true with probability 1 -𝜖, for any 𝜖 > 0 -except that here, 𝜖 is not arbitrary but taken from a discrete range of values.

Proposition 7.3 If 𝑤 𝑇 𝑖 > 0 then Δ 𝑖 𝑥 = 0 if and only if 𝑥 = ℛ(𝑇 𝑖 ).
In addition, if 𝜌 > 𝐻/2, for any 0 ≤ ℎ < 𝐻, with probability 𝐺 𝜌 (ℎ), one has

Δ 𝑖 𝑥 ≥ 𝑃 𝜌 (0)𝐶 𝑖,ℎ . (7.6)
Proof. The proof lies in Appendix A.5.

This result shows that the two classes can be well-separated by the subtree kernel. The only data that can not be separated are the trees completely edited. In addition, the lower-bound in Equation 7.6 is of order 𝐻 exp(-𝜌) (up to a multiplicative constant).

where 𝛾 can be read in Proposition 7.3, 𝛾 = 𝑃 𝜌 (0)𝐶 𝑖,ℎ ≥ 𝑃 𝜌 (0) min 𝑖 𝐶 𝑖,ℎ . The coefficient 2 lies because we consider here the total size of the data set and not only the number of examples of each class. Together with 𝑃 𝜌 (0) ∼ 𝐻 exp(-𝜌), we obtain the expected result.

Weight of leaves

Here 𝐾 + is the subtree kernel obtained from the weights used in the computation of 𝐾 together with a positive weight on leaves, 𝑤 • > 0. We aim to show that 𝐾 + separates the two classes less than 𝐾. Δ +,𝑖 𝑥 denotes the conditional expectation Equation 7.5 computed from 𝐾 + . Proposition 7.5 For any 𝑥 ∈ 𝑇 𝑖 ,

Δ +,𝑖 𝑥 = Δ 𝑖 𝑥 + 𝑤 • # ℒ(𝑇 𝑖 [𝑥])𝐷 𝑖,1-𝑖 ,
where

𝐷 𝑖,1-𝑖 = E 𝑢,𝑣 [# ℒ(𝑇 𝑢 𝑖 ) -# ℒ(𝑇 𝑣 1-𝑖 )].
Proof. We have the following decomposition, for any trees 𝑇 1 and 𝑇 2 ,

𝐾 + (𝑇 1 , 𝑇 2 ) = 𝐾(𝑇 1 , 𝑇 2 ) + 𝑤 • # ℒ(𝑇 1 )# ℒ(𝑇 2 ),
in light of Equation 7.4. Thus, with Equation 7.5,

Δ +,𝑖 𝑥 = E 𝑢,𝑣 𝐾(𝑇 𝑥 𝑖 , 𝑇 𝑢 𝑖 ) + 𝑤 • # ℒ(𝑇 𝑥 𝑖 )# ℒ(𝑇 𝑢 𝑖 ) -𝐾(𝑇 𝑥 𝑖 , 𝑇 𝑣 1-𝑖 ) -𝑤 • # ℒ(𝑇 𝑥 𝑖 )# ℒ(𝑇 𝑣 1-𝑖 ) = Δ 𝑖 𝑥 + E 𝑢,𝑣 𝑤 • # ℒ(𝑇 𝑥 𝑖 )(# ℒ(𝑇 𝑢 𝑖 ) -# ℒ(𝑇 𝑣 𝑖 )) ,
which ends the proof.

The sufficient number of data provided in Corollary 7.4 is obtained in Equation 7.7 through the square ratio of max 𝑖 𝐾(𝑇 𝑖 , 𝑇 𝑖 ) over min 𝑖 Δ 𝑖 𝑥 . First, it should be noticed that 𝐾 + (𝑇 𝑖 , 𝑇 𝑖 ) > 𝐾(𝑇 𝑖 , 𝑇 𝑖 ). In addition, by virtue of Proposition 7.5, either Δ +,0

𝑥 ≤ Δ 0 𝑥 or Δ +,1 𝑥 ≤ Δ 1
𝑥 (and the inequality is strict if trees of classes 0 and 1 have not the same number of leaves on average). Consequently,

min 𝑖 Δ +,𝑖 𝑥 ≤ min 𝑖 Δ 𝑖 𝑥 ,
and thus the sufficient number of data mentioned above is minimum for 𝜔 • = 0.

Remark 7.2

The results stated in this section establish that the subtree kernel is more efficient when the weight of leaves is 0. It should be placed in perspective with the exponential weighting scheme of the literature [35-37, 100, for which the weight of leaves is maximal. We conjecture that the accuracy of the subtree kernel should be in general improved by imposing a null weight to any subtree present in two different classes. This can not be established from the model for which the only such subtrees are the leaves. Relying on this, one of the objectives of the next chapter is to develop a learning method for the weight function that improves in practice the classification results. All forests have their own personality.

Charles de Lint

In the previous chapter, we introduced the subtree kernel and showed, in the framework of a stochastic model, that it was preferable to set the weight of the leaves to zero.

In this chapter, we briefly present the existing methods to compute the subtree kernel before introducing our framework, in Section 8.1, which computes the kernel from the DAG compression of the trees, and that allows us to choose an arbitrary weight function. In particular, we propose the discriminance weight function, which sets the leaf weights to zero and learns from the data what weight to assign to each subtree, in a supervised classification context.

We then apply our method to 8 different datasets in Section 8.2, for which we show that the discriminance weight function can improve the performance of the kernel. Finally, the chapter ends with a discussion of the interests of our approach in Section 8.3.

The majority of the chapter is reproduced from [START_REF] Azaïs | The weight function in the subtree kernel is decisive[END_REF] [39]: Azaïs et al. (2020), 'The weight function in the subtree kernel is decisive' .

Framework

State of the art

We present here an overview of the existing methods to compute the subtree kernel, whose general formula is recalled below.

𝐾(𝑇 1 , 𝑇 2 ) = 𝑡∈𝒮(𝑇 1 )∩𝒮(𝑇 2 )
𝑤 𝑡 N 𝑡 (𝑇 1 ) N 𝑡 (𝑇 2 ). (Equation 7.4)

Substrings

The approach of [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] [37]: Vishwanathan et al. ( 2004), 'Fast kernels for string and tree matching' is based on string representations of (labeled or not) ordered trees, as seen in Encoding of trees (p. 11). Recall that this allows a tree to be encoded as a sequence of brackets. In this context, a substring with balanced brackets corresponds exactly to a subtree. Since the authors of [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] introduce a string kernel operating on substrings, they notice that by giving a zero weight to substrings with unbalanced brackets, they retrieve exactly the subtree kernel.

Given two strings 𝑥 and 𝑦, 𝑦 is converted into a suffix tree (which enumerates all the suffixes of a string). This tree allows to check which substrings of 𝑥 also exist in 𝑦, which then enables the calculation of the kernel. We refer the reader to [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] for complete details. The weights 36: Where we impose equality of labels in the isomorphisms. allowed by the algorithm are typically exponential, constant, or binary (0 or 1).

Recursive computation Given a tree 𝑇, the subtree rooted in 𝑢 is defined as 𝑢 and all its descendants. We construct a subset tree, rooted in 𝑢, in the following way: either we take all the children of 𝑢, or none of them -and then recursively on the nodes kept. If we choose consistently to take all the children of all the nodes encountered, we get the subtree rooted in 𝑢.

The subset tree kernel, introduced in [START_REF] Collins | Convolution kernels for natural language[END_REF] , is defined exactly as the subtree kernel, but where the subtrees are replaced by the subset tree we just defined. In this paper, a recursive method for computing the subset tree kernel is proposed. Noting that subtrees are a special case of subset trees, it turns out that the proposed recursive formula can be modified to compute, instead, the subtree kernel -see [START_REF] Da | Kernel methods for tree structured data[END_REF]. This recursive formula imposes an exponential or constant weight. Here also, trees are ordered.

Computing 𝐾(𝑇 1 , 𝑇 2 ) has complexity 𝒪(#𝑇 1 + #𝑇 2 ) for the first option, and 𝒪(#𝑇 1 #𝑇 2 ) for the second one. Also, to the best of our knowledge, the case of unordered trees has only been considered through the arbitrary choice of a sibling order. Finally, labeled trees are treated by imposing label equality.

Our proposition Our goal in this chapter is to propose a new way of computing the kernel, based on the explicit enumeration of 𝒮(𝑇 1 ) ∩ 𝒮(𝑇 2 ). In fact, we already know a tool that allows to enumerate the subtrees, i.e. DAG compression; so we propose to compute the kernel directly from the DAG compression of trees -the forest when treating a dataset. It is not the first time that DAG compression is used in a kernel computation context since the authors of [START_REF] Da | Kernel methods for tree structured data[END_REF][START_REF] Aiolli | Fast on-line kernel learning for trees[END_REF] [102]: [START_REF] Aiolli | Fast on-line kernel learning for trees[END_REF], 'Fast on-line kernel learning for trees' [START_REF] Da | Kernel methods for tree structured data[END_REF]: Da San Martino (2009), 'Kernel methods for tree structured data' extensively use DAG reduction -with a focus on ordered trees. However, the method developed by [START_REF] Da | Kernel methods for tree structured data[END_REF][START_REF] Aiolli | Fast on-line kernel learning for trees[END_REF] is only adapted to exponential weights (see equations (3.12) and (6.2) from [START_REF] Da | Kernel methods for tree structured data[END_REF]).

Our ambition is to propose a general framework capable of handling ordered or unordered, labeled 36 or unlabeled trees, and where the weight function can be chosen arbitrarily. Finally, in [102, Section 4], the timecomplexities are studied only from a numerical point of view, while we state theoretical results.

Context

We place ourselves in a context of supervised classification. We consider a data set composed of two parts: the training data set 𝒳 train = (𝑇 1 , . . . , 𝑇 𝑛 ) where the class of each tree is assumed to be known, and the data set 𝒳 pred = (𝑇 𝑛+1 , . . . , 𝑇 𝑁 ) whose classes we want to predict.

Our aim is to compute two Gram matrices 𝐺 = 𝐾(𝑇 𝑖 , 𝑇 𝑗 ) 𝑖,𝑗 , where:

▶ (𝑖, 𝑗) ∈ 𝒳 train × 𝒳 train for the training matrix 𝐺 train ; ▶ (𝑖, 𝑗) ∈ 𝒳 pred × 𝒳 train for the prediction matrix 𝐺 pred .

SVM algorithms will use 𝐺 train to learn their classifying rule, and 𝐺 pred to make predictions [START_REF] Cristianini | An introduction to support vector machines and other kernel-based learning methods[END_REF] [33]: [START_REF] Cristianini | An introduction to support vector machines and other kernel-based learning methods[END_REF], An introduction to support vector machines and other kernel-based learning methods

. Other algorithms, such as kernel PCA, would also require to compute a Gram matrix before processing [START_REF] Schölkopf | Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond[END_REF]

Kernel computation on DAGs

Our goal here is to compute the subtree kernel 𝐾(𝑇 𝑖 , 𝑇 𝑗 ) between two trees 𝑇 𝑖 and 𝑇 𝑗 from the DAG compression of 𝑇 𝑖 and 𝑇 𝑗 -as defined in Section 2.3. In particular, we compress all the trees into a same DAG, using the method developed in Section 2.4, by introducing an artificial root. We denote by Δ = ℜ(𝒳 train ∪ 𝒳 pred ) the DAG reduction of the data set and, for any 1 ≤ 𝑖 ≤ 𝑁, 𝐷 𝑖 = ℜ(𝑇 𝑖 ). Since the root ℛ(Δ) is artificial, and to simplify the notations, in the following we will note 𝑣 ∈ Δ as an abuse of language for 𝑣 ∈ Δ \ ℛ(Δ).

DAG computation of the subtree kernel requires to annotate the DAG with different pieces of information. We use extensively the notions of origin and presence, defined in Connection between a forest and its compressed form (p. [START_REF] Kubale | Graph colorings[END_REF], whose definition we briefly recall here:

▶ The origin o(𝑣) of a vertex 𝑣 ∈ Δ is defined at the subset of [[1, 𝑁]] so that 𝑖 ∈ o(𝑣) ⇐⇒ 𝑣 ∈ 𝐷 𝑖 -in other words, ℜ -1 (Δ[𝑣]) ∈ 𝒮(ℜ -1 (𝐷 𝑖 )). ▶ The presence vector 𝜋(𝑣) of a vertex 𝑣 ∈ Δ is defined, for each 𝑖 ∈ [[1, 𝑁]], as 𝜋 𝑖 (𝑣) = #{𝑢 ∈ 𝑇 𝑖 : [𝑢] = 𝑣}. Equivalently, denoting 𝑡 = ℜ -1 (Δ[𝑣]), 𝜋 𝑖 (𝑣) = 𝑁 𝑡 (𝑇 𝑖 )
-with the notation of Equation 7.2.

Both origin and presence can be computed in linear time in one exploration of Δ -as stated in Connection between a forest and its compressed form (p. [START_REF] Kubale | Graph colorings[END_REF].

DAG weighting

The last thing that we lack to compute the kernel is the weight function. Remember that it is defined for trees as a function 𝑤 : 𝒯 → R + . As we only need to know the weights of the subtrees associated with vertices of Δ, we define the weight function for DAG as, for any 𝑣 ∈ Δ, 𝜔 𝑣 = 𝑤 𝑡 , where 𝑡 = ℜ -1 (Δ[𝑣]).

Note that 𝜔 𝑣 can be computed during the same exploration of Δ for comparing o(•) and 𝜋(•), as soon as 𝜔 𝑣 depends only on a topological property of 𝑣 that can be computed recursively, such as ℋ (•) -see Equation 2.1.

DAG computation of the subtree kernel

We introduce the matching subtrees function ℳ as

ℳ : {1, . . . , 𝑁 } 2 → 2 Δ (𝑖, 𝑗) ↦ → {𝑣 ∈ Δ : {𝑖, 𝑗} ⊆ o(𝑣)}
where 2 Δ is the powerset of the vertices of Δ. Note that ℳ is symmetric. This leads us to the following proposition. 𝜔 𝑣 𝜋 𝑖 (𝑣) 𝜋 𝑗 (𝑣).

Proof. By construction, it suffices to show that ℜ(𝒮(𝑇 𝑖 ) ∩ 𝒮(𝑇 𝑗 )) = ℳ(𝑖, 𝑗).

Let 𝑡 ∈ 𝒮(𝑇 𝑖 ) ∩ 𝒮(𝑇 𝑗 ). Then ℜ(𝑡) ∈ ℜ(𝑇 𝑖 ) and ℜ(𝑡) ∈ ℜ(𝑇 𝑗 ). Necessarily, ℜ(𝑡) ∈ Δ and {𝑖, 𝑗} ⊆ o(ℜ(𝑡)). So ℜ(𝑡) ∈ ℳ(𝑖, 𝑗). Reciprocally, let 𝑣 ∈ ℳ(𝑖, 𝑗). We denote 𝑡 = ℜ -1 (𝑣). As {𝑖, 𝑗} ⊆ o(𝑣), then 𝑡 ∈ 𝒮(𝑇 𝑖 ) ∩ 𝒮(𝑇 𝑗 ).

Remark 8.1 ℳ can be created in 𝒪(𝑁 2 #Δ) within one exploration of Δ and allows afterward computations of the subtree kernel 𝐾(𝑇 𝑖 , 𝑇 𝑗 ) in 𝒪(#ℳ(𝑖, 𝑗)) = 𝒪(min(#𝐷 𝑖 , #𝐷 𝑗 )), which is more efficient than the 𝒪(#𝑇 𝑖 + #𝑇 𝑗 ) algorithm proposed by [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] [37]: Vishwanathan et al. ( 2004), 'Fast kernels for string and tree matching'

(the complexity is announced by [START_REF] Kimura | A subpath kernel for rooted unordered trees[END_REF] [100]: Kimura et al. (2011), 'A subpath kernel for rooted unordered trees'

). However, since the whole process through Algorithm 3 or Algorithm 4 is costly, the global method that we propose here is not faster than existing algorithms. Nonetheless, our algorithm is particularly adapted to repeated computations from the same data, e.g., for tuning parameters. Indeed, once ℳ and Δ have been created, they can be stored and are ready to use. An illustration of this property is provided from experimental data in Figure 8.15.

Discriminance weight function

For a given probability level and a given classification error, and under the stochastic model of Section 7.2, we state in Weight of leaves (p. 99) that the sufficient size of the training data set is minimum when the weight of leaves is 0. In other words, counting the leaves, which are the only subtrees that appear in both classes, does not provide any relevant information to the classification problem associated with this model. As mentioned in Remark 7.2, we conjecture that, in a more general model, this result would be true for any subtree present in both classes. In this section, we propose to rely on this idea by defining a new weight function, learned from the data and called discriminance weight that assigns a large weight to subtrees, that help to discriminate the classes, i.e., that are present or absent in exactly one class, and a low weight otherwise.

The training data set is divided into two parts: 𝒳 weight = (𝑇 1 , . . . , 𝑇 𝑚 ) to learn the weight function, and 𝒳 class = (𝑇 𝑚+1 , . . . , 𝑇 𝑛 ) to estimate the Gram matrix. For the sake of readability, Δ denotes the DAG reduction of the whole data set, including 𝒳 weight , 𝒳 class and 𝒳 pred . In addition, we assume that the data are divided into 𝐾 classes numbered from 1 to 𝐾.

For any vertex 𝑣 ∈ Δ, we define the vector 𝜌 𝑣 of length 𝐾 as,

∀1 ≤ 𝑘 ≤ 𝐾, 𝜌 𝑣 (𝑘) = 1 #𝐶 𝑘 𝑇 𝑖 ∈𝐶 𝑘 1 {𝑖∈o(𝑣)} ,
where (𝐶 𝑘 ) 1≤𝑘≤𝐾 forms a partition of 𝒳 weight such that 𝑇 𝑖 ∈ 𝐶 𝑘 if and only if 𝑇 𝑖 is in class 𝑘. In other words, 𝜌 𝑣 (𝑘) is the proportion of data in class 𝑘 that contain the subtree ℜ -1 (Δ[𝑣]). Therefore, 𝜌 𝑣 belongs to the 𝐾-dimensional hypercube. It should be noticed that 𝜌 𝑣 is a vector of zeros as soon as ℜ -1 (Δ[𝑣]) is not a subtree of a tree of 𝒳 weight .

For any 1 ≤ 𝑘 ≤ 𝐾, let 0 𝑘 (1 𝑘 , respectively) be the vector of zeros with a unique 1 in position 𝑘 (vector of ones with a unique 0 in position 𝑘, respectively). If 𝜌 𝑣 = 0 𝑘 , the vertex 𝑣 corresponds to the subtree ℜ -1 (Δ[𝑣]), which only appears in class 𝑘: 𝑣 is thus a good discriminator of this class. Otherwise, if 𝜌 𝑣 = 1 𝑘 , the vertex 𝑣 appears in all the classes except class 𝑘 and is still a good discriminator of the class. For any vertex 𝑣, 𝛿 𝑣 measures the distance between 𝜌 𝑣 and its nearest point of interest 0 𝑘 or 1 𝑘 ,

𝛿 𝑣 = 𝐾 min 𝑘=1 min(|𝜌 𝑣 -0 𝑘 |, |𝜌 𝑣 -1 𝑘 |).
It should be noted that the maximum value of 𝛿 𝑣 depends on the number of classes and can be larger than 1. If 𝛿 𝑣 is small, then 𝜌 𝑣 is close to a point of interest. Consequently, since 𝑣 tends to discriminate a class, its weight should be large. In light of this remark, the discriminance weight of a vertex 𝑣 is defined as 𝜔 𝑣 = 𝑓 (1 -𝛿 𝑣 ), where 𝑓 : (-∞, 1] → [0, 1] is increasing with 𝑓 (𝑥) = 0 for 𝑥 ≤ 0 and 𝑓 (1) = 1. Figure 8.1 illustrates some usual choices for 𝑓 . In the sequel, we chose 𝜔 𝑣 = 𝑓 * (1 -𝛿 𝑣 ) with the smoothstep function 𝑓 * : 𝑥 ↦ → 3𝑥 2 -2𝑥 3 . We borrowed the smoothstep function from computer graphics [START_REF] Ebert | Texturing & modeling: a procedural approach[END_REF] , where it is mostly used to have a smooth transition in a threshold function.

Since leaves appear in all the trees of the training data set, 𝜌 • is a vector of ones and thus 𝛿 • = 1, which implies 𝜔 • = 0. This is consistent with the result developed in Section 7.2 on the stochastic model. As aforementioned, the discriminance weight is inspired from the theoretical results established in Weight of leaves (p. 99) and the conjecture presented in Remark 7.2. The relevance in practice of this weight function will be investigated in the sequel of this chapter.

Remark 8.2

The discriminance weight is defined from the proportion of data in each class that contain a given subtree, for all the subtrees appearing in the data set. It is thus required to enumerate all these subtrees. This is done, without redundancy, via the DAG reduction Δ of the data set defined and investigated in Section 2.3. As the 𝑚 trees of the training data set dedicated to learning the discriminance weight are partitioned into 𝐾 classes, computing one 𝜌 𝑣 vector is of complexity 𝒪(𝑚). Therefore, computing all of them is in 𝒪(#Δ𝑚). In addition, computing all values of 𝛿 𝑣 is in 𝒪(#Δ𝐾 2 ), as there are 2𝐾 Euclidean distances to be computed for each vector of length 𝐾. All gathered, computing the discriminance weight function has an overall complexity of 𝒪(#Δ(𝑁 + 𝐾 2 )).

Real data analysis

This section is dedicated to the application of the methodology developed before to eight real data sets with various characteristics in order to show its strengths and weaknesses.

As mentioned in Kernel computation on DAGs (p. 103), our approach consists in computing the Gram matrices of the subtree kernel via DAG reduction and with a new weight function called the discriminance (see Section 36). In particular, we aim to compare the usual exponential weight of the literature and the latter in terms of prediction capability. In all the sequel, the Gram matrices are used as inputs to SVM algorithms in order to tackle these classification problems. We emphasize that this approach is not restricted to SVM but can be applied with other prediction algorithms.

Preliminaries

In this subsection, we introduce (i) the protocol that we have followed to investigate several data sets, together with a description of (ii) the classification metrics that we use to assess the quality of our results, (iii) an extension of DAG reduction to take into account discrete labels on vertices of trees, and (iv) the standard method to convert a markup document into a tree. It should be already noted that all the data sets presented in the sequel are composed of trees (that can be ordered or unordered, labeled or not) together with their class. Protocol For each data set, we have followed the same presentation and procedure. First, a description of the data is made notably via histograms describing the size, outdegree, height and class distribution of trees. Given the dispersion of some of these quantities, we have binned together the values that do not fit inside the interval [𝑄 1 -1.5 • 𝐼𝑄𝑅; 𝑄 3 + 1.5 • 𝐼𝑄𝑅] where 𝐼𝑄𝑅 = 𝑄 3 -𝑄 1 is the interquartile range. Therefore, the flattenedlarge bins that appears in some histograms represents those outliers bins. The objective of this part is to show the wide range of data sets considered in this chapter.

Second, we evaluated the performance of the subtree kernel on a classification task via two methods: (i) for exponential weights 𝑡 ↦ → 𝜆 ℋ (𝑡) we randomly split the data in thirds, two for training a SVM, and one for prediction; (ii) for discriminance weight, we also randomly split the data in thirds, one for training the discriminance weight, one for training a SVM, and the last one for prediction. We repeated 50 times this random split for discriminance, and for different values of 𝜆. The classification results are assessed by some metrics defined in the upcoming paragraph, and gathered in boxplots. The first application example, presented in Prediction of the language of a Wikipedia article from its topology (p. 108), is slightly different since (i) we have worked with 50 distinct databases, and (ii) the results have been completed with a deeper analysis of the discriminance weights, in relation to the usual weighting scheme of the literature. .

Classification metrics

For a problem with 𝐾 > 2 classes, we adopt the macro-average approach, that is,

Metric = 1 𝐾 𝐾 𝑘=1 Metric(𝑘).
We used the implementation available in the scikit-learn Python library, namely via the functions accuracy _ score and precision _ recall _ fscore _ support.

DAG reduction with labels

In the sequel, some of the presented data sets are composed of labeled trees. The isomorphism between them is assumed to impose the equality of labels, as was done in [START_REF] Da | Kernel methods for tree structured data[END_REF][START_REF] Aiolli | Fast on-line kernel learning for trees[END_REF] [102]: , but for ordered trees only.

From a markup document to a tree Some of the data sets come from markup documents (XML or HTML files). From such a document, one can extract a tree structure, identifying each couple of opening and closing tags as a vertex, whose children are the inner tags. It should be noticed that, during this transcription, semantic data is forgotten: the tree only describes the topology of the document. Figure 8.2 illustrates the conversion from HTML to tree on a small example. Such a tree is ordered but can be considered as unordered. Finally, a tag can also be chosen as a label for the corresponding vertex in the tree.

Prediction of the language of a Wikipedia article from its topology

Classification problem and results Wikipedia pages are encoded in HTML and, as aforementioned, can therefore be converted into trees. In this context, we are interested in the following question: does the (ordered or unordered) topology of a Wikipedia article (as an HTML page) contain the information of the language in which it has been written? This can be formulated as a supervised classification problem: given a training data set composed of the tree structures of Wikipedia articles labeled with their language, is a prediction algorithm able to predict the language of new data only from its topology? The interest of this question is discussed in Remark 8.3.

In order to tackle this problem, we have built 50 databases of 480 trees each, converted from Wikipedia articles as follows. Each of the databases is composed of 4 data sets: For each data set, and each language, we picked Wikipedia articles at random using the Wikipedia API 37 , and converted them into unlabeled trees. It should be noted that the probability to have the same article in at least two different languages is extremely low. For each database, we aim at predicting the language of the trees in 𝒳 pred using a SVM algorithm based on the subtree kernel for ordered and unordered trees, and trained with 𝒳 size train where size ∈ {small, medium, large}. Figure 8.3 provides the description of one typical database. All trees seem to share common characteristics, regardless of their class. all metrics seem to decrease with the size of the training data set when using discriminance.

These numerical results show the great interest of the discriminance weight, in particular with respect to an exponential weight decay. Nevertheless, it should be compelling in this context to understand the classification rule learned by the algorithm. Indeed, this could lead to explain how the information of the language is present in the topology of the article.

Comprehensive learning and data visualization

When a learning algorithm is efficient for a given prediction problem, it is interesting to understand which features are significant. In the subtree kernel, the features are the subtrees appearing in all the trees of all the classes. Looking at Equation 7.4, the contribution of any subtree 𝑡 to the subtree kernel with discriminance weighting is the product of two terms: the discriminance weight 𝑤 𝑡 quantifies the ability of 𝑡 to discriminate a class, while 𝜅(𝑁 𝑡 (𝑇 1 ), 𝑁 𝑡 (𝑇 2 )) evaluates the similarity between 𝑇 1 and 𝑇 2 with respect to 𝑡 through the kernel 𝜅. As explained in Section 36, if 𝑤 𝑡 is close to 1, 𝑡 is an important feature in the prediction problem.

As shown in Section 2.3, DAG reduction provides a tool to compress a data set without loss. We recall that each vertex of the DAG represents a subtree appearing in the data. Consequently, we propose to visualize the important features on the DAG of the data set where the vertices are drawn with a radius that is an increasing function of the discriminance weight (i.e. the bigger the weight, the bigger the node). In addition, each vertex of the DAG can be colored by the class that it helps to discriminate, either positively (the vertex of the DAG corresponds to a subtree that is present almost only in the trees of this class), or negatively. This provides a visualization at a glance of the whole data set that highlights the significant features for the underlying classification problem. We refer the reader to Figure 8.5 for an application to one of our data sets. Thanks to this tool, we have remarked that the subtree corresponding to the is scaled according to 𝑓 * (1 -𝛿 𝑣 ) so that the largest vertices are those that best discriminate the different classes. For each 𝑣, we find the class 𝑘 such that 𝜌 𝑣 has minimal distance to either 0 𝑘 or 1 𝑘 . If it is 0 𝑘 , we say that 𝑣 discriminates by its presence, and if it is 1 𝑘 , 𝑣 discriminates by its absence. We color 𝑣 following this distinction according to the legend, where the flags indicate the language.

License at the bottom of any article highly depends on the language, and thus helps to predict the class.

Distribution of discriminance weights

To provide a better understanding of our results, we have analyzed in Figure 8.6 the distribution of discriminance weights of one of our large training data sets. It shows that the discriminance weight behaves on average as a shifted exponential.

Considering the great performance achieved by the discriminance weight, this illustrates that exponential weighting presented in the literature is indeed a good idea, when setting 𝑤 • = 0 as shown in Weight of leaves (p. 99) or suggested in [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] [37]: Vishwanathan et al. ( 2004), 'Fast kernels for string and tree matching'

. However, a closer look at the distribution in Figure 8.6 (left) reveals that important features in the kernel are actually outliers: relevant information is both far from the average behavior and scarce. To a certain extent and regarding these results, discriminance weight is the second order of the exponential weight.

Remark 8.3

The classification problem considered in this subsection may seem unrealistic as ignoring the text information is obviously counterproductive in the prediction of the language of an article. Nevertheless, this application example is of interest for two main reasons. First, this prediction problem is difficult as shown by the bad results obtained from the subtree kernel with exponential weights (see Figure 8.4). As highlighted in Figure 8.5 and Figure 8.6 (left), the subtrees that can discriminate the classes are very infrequent and diverse (in terms of size and structure), so difficult to be identified. On a different level, as Wikipedia has a very large corpus of pages, it provides a practical tool to test our algorithms and investigate the properties of our approach. Indeed, we can virtually create as many different data sets as we want by randomly picking articles, ensuring that we avoid overfitting.

Markup documents data sets

We present and analyse in this subsection three data sets obtained from markup documents. The classification results are depicted in Figure 8.8, for both data sets, and with trees considered successively as ordered and unordered. For INEX 2005, both exponential decay and discriminance achieve similar good performance. However, for INEX 2006, neither of them are able to achieve significant results. Actually, discriminance performs slightly worse than exponential decay. From these results we deduce that subtrees do not seem to form the appropriate substructure to capture the information needed to properly classify the data.

INEX

Videogame sellers

We manually collected, for two major websites selling videogames 38 , the URLs of the top 100 best-selling games, and converted them into ordered labeled trees. Although webpages might seem similar to some extent, the trees are actually very different, as highlighted in Figure 8.9. We found that the subtree kernel retrieves this information as, for both exponential decay and discriminance weights, we achieved 100% of correct classifications in all our tests.

Biological data sets

In this subsection, three data sets from the literature are analyzed, all related to biological topics. VascuSynth The VascuSynth data set from [START_REF] Hamarneh | VascuSynth: Simulating Vascular Trees for Generating Volumetric Image data with Ground Truth Segmentation and Tree Analysis[END_REF][START_REF] Jassi | VascuSynth: Vascular Tree Synthesis Software[END_REF] [106]: is composed of 120 unordered trees that represent blood vasculatures with different bifurcations numbers. In a tree, each vertex has a continuous label describing the radius 𝑟 of the corresponding vessel. We have discretized these continuous labels in three categories: small if 𝑟 < 0.02, medium if 0.02 ≤ 𝑟 < 0.04 and large if 𝑟 ≥ 0.04 (all values are in arbitrary unit). We split up the trees into three classes, based on their bifurcation number. Based on Figure 8.10 (left), we can distinguish between the three classes by looking only at the size of trees. Contrary to the videogame sellers data set that had the same property, the classification does not achieve 100% of good classification, as depicted in Figure 8.10 (right). On average, discriminance performs better than the other weights, despite having a larger variance. This is probably due to the small size of the data set, as the discriminance is learned only with around 13 trees per class. have been investigating the variability inside cell lineage trees of three different species. From the encoding of the data that they have provided as supplementary material 39 , we have extracted ordered unlabeled trees that are presented in Figure 8.11 (left). The data set contains, for two classes, trees of outdegree 0 (i.e., isolated leaves) that can be considered as noise. With respect to the exponential weight, the value of the kernel between such trees will be identical, whether they belong to the same class or to two different classes. They therefore contribute to reducing the kernel's ability to effectively discriminate between these two classes.

On the other hand, the discriminance weight will assign them a zero value, "de-noising", in a way, the data. This observation may explain why discriminance weight achieves better results than exponential weight. have developed a method to construct cell lineage trees from microscopy and provided their data online 40 . We extracted 300 unordered and unlabeled trees, divided into three classes. It seems from Figure 8.12 (left) that one class among the three can be distinguished from the two others. Classification results can be found in Figure 8.12 (right): the discriminance weight performs better than the exponential weight, whatever the value of the parameter.

Faure et al. cell lineage trees [109]

LOGML

The LOGML data set is made of user sessions on an academic website, namely the Rensselaer Polytechnic Institute Computer Science Department website 41 , that registered the navigation of users across the website.

Interest of the DAG approach

Learning the weight function As a conclusion of our experiments, we have analyzed the relative improvement in prediction obtained with the discriminance weight against the best exponential weight in order to show both the importance of the weight function and the relevance of the method we developed in this paper. More precisely, for each data set and each classification 8.14. We have found that, except in one case, discriminance behaves as good as exponential weight decay and even performs better in most of the data sets. Furthermore, one can observe a kind of trend, where the relative improvement decreases when the number of trees in the training data set is increasing, which proves the great interest of the discriminance to handle small data sets, provided that (i) the problem is difficult enough that the exponential weights are not already high performing, as it is the case in the Videogames sellers data set, and (ii) the data set is not too small, as for VascuSynth. Indeed, as the discriminance is learned independently from the SVM, one must have enough training data to divide them efficiently. Nevertheless, it should be noted that, in the framework of the DAG approach, results from the discriminance weight can be obtained much faster due to the fact that the Gram matrices are estimated from one half of the training data set, while learning the discrimance is very fast as it can be done in one traversal of the DAG (see the complexity presented in Remark 8.2). Finally, we have investigated on a single example some properties of the discriminance, discovering that it can be interpreted as a second-order exponential weight, as well as a method for visualizing the important features in the data.

Computation time

As shown in Figure 8.12 (right), the exponential decay classification results for the Faure et al. data set are very dependent on the value chosen for the parameter 𝜆. In this case, it can be interesting to tune this parameter and estimate its best value with respect to a prediction score. This requires to compute the Gram matrices from different weight functions. We present in Figure 8.15 the computation time required to compute the Gram matrices from a given number of values of the parameter. As expected from the theoretical results, we observe a linear dependency: the intercept corresponds to the computation time required to compute and annotate the DAG reduction, while the slope is associated with the time required to compute the Gram matrices, which is proportional to the average of 𝒪(min(#𝑇 𝑖 , #𝑇 𝑗 )) (see Remark 8.1). This can be compared to the complexity of the algorithm developed in [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] [37]: Vishwanathan et al. ( 2004), 'Fast kernels for string and tree matching'

, which is the average of 𝒪(#𝑇 𝑖 + #𝑇 𝑗 ). Consequently, the corresponding computation times should be proportional to at least twice the slope that we observe with the DAG approach. This shows another interest of our method that is not related to the discriminance weight function. It should be faster to compute several repetitions of the subtree kernel from the DAG approach than from the previous algorithm [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] provided that the number of repetitions is large enough. We have devoted Chapter 4 to the treatment of this problem, and proposed an algorithm that constructs an isomorphism -when it exists -between two labeled trees. Our algorithm operates in two phases: (i) the first drastically breaks the cardinality of the search space, by determining a number of mandatory mappings of the isomorphism; and (ii) the second is a backtracking phase that completes the construction.

Refining the algorithm

We saw in Section 4.4 that the first phase, preprocessing, drastically reduces the search space, which allows the subsequent backtracking to be efficient. On the other hand, in some configurations, the latter can be considerably slow to converge, so there is still room for improvement. Two possibilities are presented here. , we can compare the histograms of the number of occurrences of the labels (sorted from the most frequent to the least frequent) and if they differ, decide on non-isomorphism.

Bags on labels

If the histograms are identical, not only is there a chance that the trees are isomorphic, but labels with identical numbers of occurrences are candidates to be mapped together. The notion of bags, used for the nodes in our algorithm, naturally arises to treat the labels as well. A deduction rule similar to Deduction Rule 4.1 can be used, which maps labels together if they are alone in their bag. This refinement is likely to improve the performance of the algorithm when the number of labels is smaller than the number of nodes in the trees. Unfortunately, the most problematic cases at the moment are not in this category. To apply our algorithm to real data, nevertheless, it will be desirable to implement this improvement.

Backtracking strategy So far, the strategy used in backtracking, in light of Theorem 4.3, is to prioritize bags and collections according to their number of elements, but without consideration for the elements themselves.

Consider what could be gained by taking into account the elements of the bags rather than just their cardinality.

A reward could be associated with each possible mapping, for example in terms of the reduction of the search space that it produces. This reward is difficult to estimate without actually doing the mapping and observing all the deductions involved. On the other hand, we can set a "horizon", a limit level of recursion in the mappings and deductions which allows us to estimate this reward.

For example, a horizon of 1 would look at whether the mapping of two nodes also causes the mapping of their parents; and how the bags and collections containing their children are split (without going into the recursion of SplitChildren). Since the depth of nodes has an influence on the amount of maximal successive parent mappings possible, and on the maximal level of recursion of the SplitChildren procedure, this could be an indicator of great interest.

The backtracking tree exploration problem might also be approached with stochastic methods like Monte Carlo Tree Search -a method widely used to explore decision trees (e.g. in the context of game theory) whose large number of states makes exhaustive exploration impossible. The tree is explored partially, via random sampling, in order to explore only the most promising options. On that topic, see [START_REF] Cameron B Browne | A survey of Monte Carlo tree search methods[END_REF]

Application to graph isomorphism

The problem of tree ciphering isomorphism is graph isomorphism complete, by virtue of Theorem 4.1. Figure 4.1, reproduced below, illustrates how to transform a graph into a labeled tree -note that this reduction is linear in the size of the graph. Since we have constructed an algorithm to determine tree isomorphism up to a cipher, one may wonder how well it would solve the graph isomorphism problem. Recall that most algorithms addressing the problem [START_REF] Brendan | Practical graph isomorphism, II[END_REF] do not directly construct isomorphisms between graphs, but rather check if they belong to the same equivalence class (by constructing a representative of each class). Given a graph 𝐺 = (𝑉 , 𝐸), we can notice that the tree 𝑇 𝐺 constructed by the reduction has #𝑉 + #𝐸 + 1 nodes, is of height 2, and of degree #𝑉. All leaves have the same equivalence class (for ≃), and the equivalence class of intermediate nodes is directly related to their degree: for any nodes

𝑢, 𝑣 with ℋ (𝑢) = ℋ (𝑣) = 1, we have [𝑢] = [𝑣] ⇐⇒ #𝐶(𝑢) = #𝐶(𝑣).
Therefore, we can only expect the preprocessing to ▶ map the vertices of the graph that are the only ones to have a given degree;

▶ partition the other vertices of the graph according to their degree.

Actually, this classification of the graph vertices by degree corresponds exactly to the state of the graph after the first color refinement pass of the Weisfeiler-Leman algorithm [START_REF] Weisfeiler | The reduction of a graph to canonical form and the algebra which appears therein[END_REF][START_REF] Grohe | Color refinement and its applications[END_REF] [68]: .

Since we then proceed with a backtracking step, there is little hope that our algorithm is competitive against the state of the art for graph isomorphism. Recall, however, that competing algorithms do not explicitly construct isomorphism, and so our algorithm paves the way in this direction. Moreover, given the very particular shape of the trees obtained by the reduction, one can imagine rethinking the algorithm while taking into account these specificities (the algorithm being currently much more generic), or even following the same kind of strategy but operating directly on the graph.

Optimization on the cipher space

Consider two isomorphic labeled trees 𝑇 1 and 𝑇 2 , and assume that # 𝒜(𝑇 𝑖 ) = #𝑇 𝑖 -in other words, all labels are different. In this case, any tree isomorphism between 𝑇 1 and 𝑇 2 is also a tree ciphering, i.e., Isom(𝑇 1 , 𝑇 2 ) = Cipher(𝑇 1 , 𝑇 2 ). So far, we have been interested in tree isomorphisms that induce a bijection on the label space. One may want to impose additional conditions on the ciphers; especially in our example where all isomorphisms are valid. For instance, one might want to favor the red isomorphism in the example of Figure 9.1 for its underlying linearity, as opposed to the "sawtooth" behaviour of the blue isomorphism. We developed in Chapter 4 an algorithm to build one tree ciphering; we are interested here in finding the best one (even in the case where # 𝒜(𝑇 𝑖 ) ≠ #𝑇 𝑖 ). There are many ways to make sense of "best" so, in order to fix things, we consider here just one particular problem among others.

Let 𝑇 1 and 𝑇 2 be two labeled trees. Let us denote by G the space of functions 𝒜(𝑇 1 ) → 𝒜(𝑇 2 ). Suppose there exist 𝜙 0 ∈ Cipher(𝑇 1 , 𝑇 2 ) and 𝑓 0 ∈ G so that ∀𝑢 ∈ 𝑇 1 , 𝜙 0 (𝑢) = 𝑓 0 (𝑢). Moreover, let F be a subspace of G; suppose that 𝑓 0 ∈ F -in the example of Figure 9.1, where 𝒜(𝑇 𝑖 ) ⊆ R, G is the space of real functions. We could take F = {𝑥 ↦ → 𝑎𝑥 + 𝑏 : 𝑎, 𝑏 ∈ R}i.e. linear functions. We have 𝑓 0 = id ∈ F.

If we know 𝜙 0 , then finding the function 𝑓 0 is akin to a standard regression problem. 𝑓 𝜙 0 provides a list of couples (𝑢, 𝜙 0 (𝑢)) on which the regression can be performed; and since 𝑓 0 ∈ F, we are sure to retrieve 𝑓 0 .

Now suppose that we ignore 𝜙 0 . For each 𝜙 ∈ Cipher(𝑇 Note that since they are of the same nature, the min operators can be freely exchanged. Given a fixed 𝜙, finding an optimal 𝑓 ∈ F is is as easy as solving a regression problem on F. On the other hand, with fixed 𝑓 , finding 𝜙 that minimizes the objective function is as difficult as exploring the space Cipher(𝑇 1 , 𝑇 2 ). This prevents us from solving the problem by component-wise optimization (i.e., fix 𝜙, minimize according to 𝑓 , fix 𝑓 , minimize according to 𝜙, etc), since we would need to investigate this challenging space numerous times.

On the other hand, one can imagine a greedy strategy allowing to build a pair (𝜙, 𝑓 ) whose least squares error will hopefully be not too far from the actual minimum. Let us only perform preprocessing between 𝑇 1 and 𝑇 2 to get a partial mapping of nodes and a preliminary list of label pairs. From this partial list, we can estimate a first candidate 𝑓 ∈ F. The collections resulting from the preprocessing are merged to create bags, and then we can look, among the possible pairings of nodes in all bags, at the pair closest to 𝑓 . We map these two nodes, and make deductions as for the normal algorithm. We then re-estimate 𝑓 on the basis of the mapping obtained, and we repeat until we run out of nodes.

Assuming that this greedy algorithm allows to build a fairly good solution -which would remain to be investigated, we can go further and imagine an approximate DAG compression. Let's go back to the example in Figure 3.6 (only the tree is reproduced here). If the coordinates of the points are noisy, it will no longer be possible to find the symmetries of the figure using an exact cipher -any association of the labels becoming acceptable.

On the other hand, considering the above optimization problem and choosing F the space of rigid transformations of the plane, one will notice that the left red subtree is approximately transformed into the right red subtree, that the top left blue subtree is approximately transformed into the bottom left blue subtree, and so on.

We can then recursively construct a DAG representing the symmetries of the tree, at the cost of an approximation error. It is notable that the DAG is constructed in the same way as in Section 3.3, by placing the transformations on the arcs, each vertex having a label representing its class (no longer of equivalence, but of approximation).

44: One may want to fix the alphabet before observing the FDAG 𝐷. It does not affect the argument afterwards, but it will obviously affect the combinatorics and the number of labeled DAGs that can be constructed from 𝐷.

We can then reconstruct a tree from this DAG using Algorithm 5. Because of the successive and recursive approximations, one can expect the labels of this tree to be further from the original ones the deeper the nodes are in the tree; but if the greedy algorithm is effective, one can hope that the global error will not be too high either.

Search for frequent patterns

In Chapter 5 and Chapter 6, we developed a reverse search scheme allowing, first of all, to enumerate irredundant forests in their compressed DAG form. We have also shown that this enumeration can be adapted to address several related problems: (i) the enumeration of forests in their classical sense, (ii) the enumeration of "subforests" of a forest, and (iii) the frequent "subforest" problem. These results generalize previous results from the literature allowing to enumerate trees and to deal with the problem of frequent pattern mining on trees.

Extension to labeled FDAGs

In our enumeration of irredundant forests, we considered only unlabeled trees. One way to add labels could follow the strategy developed for classical forests, in Extension to forests with repetitions (p. 81): we build an unlabeled FDAG, stop the enumeration, and start a second enumeration procedure to add labels.

This new enumeration will obviously depend on the underlying isomorphism (imposing label equality or up to a cipher); and it should also be noted that it will require modifying the FDAG structure. Indeed, two subtrees with the same topological structure have no particular reason to be isomorphic when labels are added, and thus could generate two vertices in a labeled DAG instead of one. For example, with equality of labels, a leaf with label 𝐴 is not compressed together with a leaf with label 𝐵.

Note that even if we modify the structure, we create topologically equivalent vertices and therefore we can not accidentally create an FDAG obtained by another path in the enumeration tree: the uniqueness of the enumeration is preserved.

The number of distinct labels in a forest is limited by the total number of nodes in the forest. Given a FDAG 𝐷, and a vertex 𝑣 ∈ 𝐷, we denote by 𝑠(𝑣) the number of nodes in ℜ -1 (𝐷[𝑣]); i.e., with 𝑇 𝑣 = ℜ -1 (𝐷[𝑣]), 𝑠(𝑣) = #𝑇 𝑣 . We have

𝑠(𝑣) = 1 if 𝑣 ∈ ℒ(𝐷), 1 + 𝑢∈𝒞(𝑣) 𝑛(𝑣, 𝑢)𝑠(𝑢) otherwise;
where 𝑛(𝑣, 𝑢) is the multiplicity of arc 𝑣 → 𝑢 in 𝐷. Therefore, the maximal number of distinct labels we can choose is given by 𝑠(𝐷) = 𝑟∈ℛ(𝐷) 𝑠(𝑟). Let 𝒜 = {1, . . . , 𝑠(𝐷)} be the alphabet from which we will draw labels 44 .

45: With the notable exception where an alphabet would be imposed for the enumeration, and where the labels would not be interchangeable. If we were to enumerate labeled FDAGs according to the definition of isomorphism imposing equality of labels, we would end up enumerating the same FDAG several times, up to a rewriting of the labels -for example, one leaf with label A and another with label B. From the point of view of parsimonious enumeration, it would therefore be more judicious 45 to adopt another approach, i.e. isomorphism up to a cipher.

This question is closely related to the number of non-isomorphic ways one can label a tree of a given size. Then, we have to retranscribe these labelings into a DAG, and in particular find the ciphers that go on the arcs. Moreover, the DAG compression with labels is not unique in general and we will have to find a systematic way to choose the compression (a kind of canonical DAG compression). These arguments are developed below.

Let 𝑎(𝑛) be the number of non-isomorphic (from the topology point of view) trees of size 𝑛, and 𝑏(𝑛) the number of non-isomorphic (up to a cipher) labeled trees of size 𝑛. Remark 9.1 Note that the difficulty of the problem is not so much in the total number of possibilities as a function of 𝑛, but rather in the way this number grows by going from 𝑛 to 𝑛 + 1. Indeed, the reverse search method is only effective if the successors of an element in the enumeration tree can be calculated in a reasonable time. More than 𝑏(𝑛), it is therefore 𝑏(𝑛 + 1) -𝑏(𝑛) that is the quantity of interest; and we can see that it seems to grow faster than 𝑎(𝑛 + 1) -𝑎(𝑛).

Let us now relate non-isomorphic labeled trees to their labeled DAG. We can already identify several difficulties to be taken into account in the enumeration.

First, there is no uniqueness of the labeled DAG compressing a given tree, since there might be several possible choices of representatives for each DAG vertex, as shown in Figure 9.3. One way to deal with this would be to find a "canonical" compression that provides a systematic way to choose among the possible representatives of a vertex.

Second, you need to make sure that the ciphers on the arcs compose correctly with each other. This typically requires choosing the labels and ciphers on lower height vertices before the higher ones. A cipher placed on an arc leading to a subtree with 𝑘 different colors has a domain of cardinality at most 𝑘 -which represents, at most, 𝑘 𝑖=1 𝑘 𝑖 different ciphers, which must then be reported on the arcs, with the resulting combinatorics.

Note that the enumeration of labeled trees (as DAGs or not) contains the enumeration of labeled trees of height 2, and thus a fortiori, the entirety of (unlabeled) graphs by the reduction of Theorem 4.1 -whose combinatorics is illustrated in Table 9.2; see also [START_REF] Harary | The number of linear, directed, rooted, and connected graphs[END_REF] [112]: [START_REF] Harary | The number of linear, directed, rooted, and connected graphs[END_REF], 'The number of linear, directed, rooted, and connected graphs' . This inclusion of unlabeled graphs in the set of labeled trees highlights the gain in difficulty of the problem. As for the enumeration of FDAGs, one can imagine a frequent pattern mining application to the enumeration of labeled FDAGs, but in view of the additional difficulty, a very efficient algorithm will be required to hopefully address the issue on a practical level.

Toward the enumeration of DAGs

Our enumeration of FDAGs opens the way to the enumeration of DAGs in general, which to the best of our knowledge has never been addressed in the literature. In detail, we recall that the key to our method relies on the existence of a canonical ordering on the vertices of a FDAG, allowing then to enumerate only such canonical FDAGs, as developed in Canonical FDAGs (p. 67). Given any DAG 𝐷, we introduced the following constraints on an ordering 𝜓: We proved in Theorem 5.4 that these constraints are sufficient to ensure the uniqueness of an ordering if and only if 𝐷 is a FDAG; indeed, it is not possible to find in such a DAG two vertices 𝑢 and 𝑣 such that 𝒞 𝜓 (𝑢) = 𝒞 𝜓 (𝑣) and 𝑢 ≠ 𝑣 -which is the only ambiguous case not covered by the two previous constraints.

If one were to attempt to define a canonical ordering for any generic DAG, based on the constraints introduced here, then one could introduce the following additional constraint.

∀(𝑢, 𝑣) ∈ 𝐷 2 , (ℋ (𝑢) = ℋ (𝑣)) ∧ (𝒞 𝜓 (𝑢) = 𝒞 𝜓 (𝑣)) ∧ (𝒫 𝜓 (𝑢) > lex. 𝒫 𝜓 (𝑣)) =⇒ 𝜓(𝑢) > 𝜓(𝑣); (9.2)
where 𝒫 𝜓 (𝑢) is the sequence (𝜓(𝑤) : 𝑤 ∈ 𝒫(𝑢)) sorted in decreasing order with respect to the lexicographical order -similarly to 𝒞 𝜓 .

This new constraint would then allow to discriminate more vertices, but would not allow to distinguish between vertices 𝑢, 𝑣 such that 𝒫 𝜓 (𝑢) = 𝒫 𝜓 (𝑣). One could also discriminate according to other computable properties on the vertices, but we have exhausted the most obvious ones. In fact, one can hardly expect any better by virtue of the following argument.

Let us assume that we can exhibit a canonical ordering on (general) DAGs, computable in polynomial time. .

Therefore, unless graph isomorphism is polynomial -for which we have no proof [START_REF] Schöning | Graph isomorphism is in the low hierarchy[END_REF] [67]: Schöning (1987), 'Graph isomorphism is in the low hierarchy'

, we can not hope to find a canonical ordering on DAGs that is computable in polynomial time, which implies that the discriminating properties must be more sophisticated than those we considered in our approach. We recall that all properties we used to discriminate vertices (such as height) are computable at worst in linear time.

In order to enumerate DAGs by imposing a canonical ordering, one would have to develop a completely different method from ours to find such an ordering. Actually, since finding a canonical ordering is equivalent to defining a representative of the equivalence class of a given DAG (for the graph isomorphism equivalence relation), it would be appropriate to consider methods from the literature that already have this kind of approach [START_REF] Brendan | Practical graph isomorphism, II[END_REF]

Classification of trees

In Chapter 7, we focused on the issue of statistical analysis of trees, and in particular on convolution kernels, which are widely used in the literature. We were especially interested in the subtree kernel, and we showed, in a theoretical framework, that it is always preferable that the leaves of the trees have a weight of zero in the computation of the kernel.

We then developed in Chapter 8 a new framework to compute the subtree kernel, based on DAG compression of trees, which allowed us to introduce the discriminance weight, learned from the data, that sets the weight of leaves to zero. Generally speaking, it assigns a high weight to subtrees allowing to better discriminate the classes (in a supervised classification context) and a zero weight to the others. On several datasets, we showed that this new weight significantly improves the performance of the kernel. We emphasize here that the calculation of this discriminance weight was made possible by the exhaustive enumeration of the subtrees.

The forest kernel

In Section 6.4, it was shown how to exploit the enumeration of irredundant forests of Section 6.1 to address the frequent subforest problem. We can reuse this result to define a new kernel on trees: the forest kernel. Recall that ℱ denotes the set of irredundant forests; similarly to Equation 7.2, we define this new kernel 𝐾 as

∀𝑇 1 , 𝑇 2 ∈ 𝒯 , 𝐾(𝑇 1 , 𝑇 2 ) = 𝑓 ∈ℱ 𝑤 𝑓 𝜅 N 𝑓 (𝑇 1 ), N 𝑓 (𝑇 2 ) , (9.3)
46: The definition of forest of subtrees is given only for irredundant forests. Here, we use 𝑇 as an abuse of language for the forest {𝑇}, which is trivially irredundant.

where N 𝑓 (𝑇) counts how many times the forest 𝑓 is a forest of subtrees of 𝑇 -as in Definition 6.8 46 . We can relate N 𝑓 (𝑇) to N 𝑡 (𝑇) (where 𝑡 is a tree) with N 𝑓 (𝑇) = min 𝑡∈ 𝑓 N 𝑡 (𝑇). Besides, 𝑤 𝑓 is the weight associated to 𝑓 and 𝜅 a kernel on N, Z or R. As for the subtree kernel, assuming 𝜅(0, •) = 𝜅(•, 0) = 0 makes the sum finite and then

𝐾(𝑇 1 , 𝑇 2 ) = 𝑓 ∈ℱ (𝑇 1 )∩ℱ (𝑇 2 ) 𝑤 𝑓 𝜅 N 𝑓 (𝑇 1 ), N 𝑓 (𝑇 2 ) , (9.4)
where ℱ (𝑇) stands for the set of forests of subtrees of 𝑇 -which we can enumerate via Algorithm 15, from the DAG compression of 𝑇.

Since we introduced, in Section 6.4, the Algorithm 16, which directly enumerates the most frequent forests of subtrees in a tree database, we can compute this new kernel in a very similar way to the one we developed in Kernel computation on DAGs (p. 103).

Given a database of trees {𝑇 1 , . . . , 𝑇 𝑛 }, we compress them together into a single DAG, set the frequency threshold 𝜎 to 0 (to enumerate all the forests of subtrees) and run Algorithm 16. We can compute N 𝑡 (•) using Equation 2.4, and so the value of N 𝑓 (•) follows.

Actually, one must imagine that the number of enumerated forests of subtrees may be much too large to handle large databases. Since we have not yet defined the weight, and following a logic close to the discriminance weight introduced in Section 36, we can mitigate the previous problem. Indeed, it is useless to enumerate the forests of subtrees whose weight would be negligible.

In the context of supervised classification, we can in fact replace the frequency function used in the enumeration by one that reflects the idea of discriminance. We only want to enumerate forests of subtrees that occur fairly frequently in certain classes (rather than just the trees themselves), so that we can use them to further discriminate these classes.

Note that this will allow forests present in all classes (such as leaves), but we must accept them to preserve the antimonotonicity of the frequency function. It will then be necessary to filter them to have a real discriminating weight.

What can we expect to gain from this new kernel compared to the subtree kernel? First, the computation time is likely to be longer -since all the forests of subtrees have to be enumerated in addition to the existing procedure. Second, since subtrees are forests made of singletons, the forest kernel is expected to retrieve at least the same information as the subtree kernel. But more importantly, it is expected to capture much richer information.

Consider the example in Figure 9.4: the subtree kernel -via the discriminance weight -would be unable to distinguish the classes from each other, since no subtree is sufficient to discriminate (by its presence or absence) the classes. On the other hand, just by considering forests of two trees, we are able to discriminate perfectly each class. The forest kernel does not consider only the appearance (or absence) of one tree in a class, but the simultaneous appearance (or absence) of several of them.

Explicit enumeration with other kernels

Constructing a convolution kernel on the space of trees requires choosing a family of substructures, and finding a way to enumerate them either explicitly or implicitly -for example via a recursive kernel computation, as in [START_REF] Haussler | Convolution kernels on discrete structures[END_REF][START_REF] Collins | Convolution kernels for natural language[END_REF] [34]: [START_REF] Haussler | Convolution kernels on discrete structures[END_REF] . There is a wide variety of possible choices of substructures, an overview of which can be found in [START_REF] Da | Kernel methods for tree structured data[END_REF] [36]: Da San Martino (2009), 'Kernel methods for tree structured data' .

We have shown in Chapter 8 the interest of having an explicit enumeration, especially in the choice of weights. But as soon as we try to consider substructures finer than subtrees, the number of elements to enumerate increases drastically. It is therefore essential to implement strategies to reduce the number of elements enumerated, such as frequent pattern mining.

Subset trees

Along with the subtree kernel, the subset tree kernel [START_REF] Collins | Convolution kernels for natural language[END_REF] uses one of the most straightforward substructures to build. Recall that a subset tree is a subgraph of the tree such that, for each node, either all children are taken or none is taken. Let 𝑇 be a tree, and we denote by 𝜆(𝑣) the number of possible subset trees rooted in 𝑣. We have

𝜆(𝑣) =        1 if 𝑣 ∈ ℒ(𝑇); 1 + 𝑢∈𝒞(𝑣)
𝜆(𝑢) otherwise. (9.5)

The number of subset trees of 𝑇 is then given by 𝑣∈𝑇 𝜆(𝑣) -recall that the number of subtrees of 𝑇 is ≤ #𝑇.

If we assume that 𝑇 is a full tree of degree 𝑑 and height 𝐻, we obtain the recurrence 𝜆 ℎ+1 = 1 + 𝜆 𝑑 ℎ with 𝜆 0 = 1. It can be shown that the general term of this kind of sequence is expressed as 𝑐 𝑑 ℎ , where [𝑥] denotes the integer part of 𝑥, and 𝑐 > 1 is a constant [START_REF] Alfred | Some doubly exponential sequences[END_REF] . The total number of subset trees of 𝑇 is then given by ℎ 𝑖=0 𝑑 ℎ-𝑖 𝑐 𝑑 𝑖 . The number of nodes of 𝑇 is given by 𝑑 ℎ+1 -1 𝑑 -1 and provides an upper bound on the number of subtrees: we see that the increase of the number of substructures is of an exponential order of magnitude.

Subgraph At the other end of the spectrum of substructures on trees, the most general are (connected, induced) subgraphs. If we were able to enumerate them efficiently, we could construct the most generic convolution kernel on trees possible. Moreover, by constructing a weight that filters out all subgraphs except those of a particular class, we could recover the kernel associated with that class of substructures.

Naturally, such an universal kernel is very ambitious. To get an idea of the difficulty, let us look at the number of possible subgraphs of a tree.

Let 𝑇 be a tree, and 𝑣 ∈ 𝑇. The subgraphs of 𝑇[𝑣] can be separated into two groups:

▶ If the subgraph does not contain 𝑣, then it is completely contained in one of the subtrees of 𝑣. Let 𝛼(𝑣) be the number of these subgraphs. ▶ If the subgraph contains 𝑣, then the rest of the subgraph is distributed over the subtrees of 𝑣 and contains their respective roots.

Let 𝛽(𝑣) be the number of these subgraphs.

The total number of subgraphs of 𝑇[𝑣] is given by 𝛼(𝑣) + 𝛽(𝑣), and thus those of 𝑇 by 𝛼(ℛ(𝑇)) + 𝛽(ℛ(𝑇)). We have Since 𝛽 ℎ -𝜆 ℎ > 0, 𝛾 > 𝑐; and the two sequences have the same exponent 𝑑 ℎ . In light of Remark 9.1, it is not the absolute number of objects to be enumerated that is an issue, but rather the growth of this number as the size of the objects increases. Therefore, what is important here is the ratio 𝛾/𝑐, which determines how much faster 𝛽 ℎ grows compared to 𝜆 ℎ .

𝛼(𝑣) =
Both constants should be computed to get an idea of how much simpler the enumeration of subset trees is compared to subgraphs. Typically, if 𝛾 and 𝑐 are of the same order of magnitude, it may be worthwhile to attempt the enumeration of subgraphs directly; whereas if 𝛾 ≫ 𝑐, it may be more reasonable to address the enumeration of subset trees prior to the enumeration of subgraphs. case, we also need to sort them, so that we get rid of the order and can properly compare them). Then we only need to explore once the image and check whether an element has two or more antecedents. The global cost is then 𝒪( 𝑣∈Δ ℎ 𝑔 ★ (# 𝒞(𝑣))).

We reuse the notation 𝑔 ★ from the proof of Lemma A.1. With respect to Δ, the complexity for constructing 𝜎(•) is 𝒪(𝑁 𝑛 𝑔 ★ (𝑑)). Exploring the elements of 𝜎(ℎ) for (i) choosing a vertex 𝑣 𝑀 to remain, and (ii) delete the other elements 𝛿 𝑀 has complexity 𝒪(𝑁 𝑛). In addition, at height ℎ ′ > ℎ, exploring the children to replace them or not costs 𝒪( 𝑣∈Δ ℎ ′ # 𝒞(𝑣)) = 𝒪(𝑁 𝑑𝑛).

A.2 Proofs of Section 3.2

The preliminary reminders and the first proof are reproduced from [START_REF] Ingels | Isomorphic Unordered Labeled Trees up to Substitution Ciphering[END_REF]

Preliminary reminders

Let 𝑅 be a relation over sets 𝐸 and 𝐹. 𝑅 is a bijection if and only if ▶ ∀𝑥 ∈ 𝐸, ∃!𝑦 ∈ 𝐹, 𝑥 𝑅 𝑦; ▶ ∀𝑦 ∈ 𝐸, ∃!𝑥 ∈ 𝐸, 𝑥 𝑅 𝑦.

The converse relation 𝑅 -1 over sets 𝐹 and 𝐸 is defined as 𝑦 𝑅 -1 𝑥 ⇐⇒ 𝑥 𝑅 𝑦. If 𝑅 is a bijection, then so is 𝑅 -1 .

Let also 𝑆 be a relation over sets 𝐹 and 𝐺.

The composition of 𝑅 and 𝑆, denoted by 𝑆 • 𝑅, is a relation over 𝐸 and 𝐺, and defined as 𝑥 (𝑆 • 𝑅) 𝑧 ⇐⇒ ∃𝑦 ∈ 𝐹, (𝑥 𝑅 𝑦) ∧ (𝑦 𝑆 𝑧). If 𝑅 and 𝑆 are bijections, then so is 𝑆 • 𝑅.

𝑆 is said to be finer than 𝑅 if 𝑥 𝑆 𝑦 =⇒ 𝑥 𝑅 𝑦. If 𝑅 is a bijection, then so is 𝑆.

Proof of Theorem 3.1

Let 𝑇 1 , 𝑇 2 and 𝑇 3 be trees such that 𝑇 1 𝜙 -→ 𝑇 2 and 𝑇 2 𝜓 -→ 𝑇 3 . Therefore, 𝜙 ∈ Isom(𝑇 1 , 𝑇 2 ) and 𝜓 ∈ Isom(𝑇 2 , 𝑇 3 ); also, 𝑅 𝜙 and 𝑅 𝜓 are bijections.

It should be clear that trivially, 𝑇 1 id -→ 𝑇 1 . We aim to prove the following:

▶ 𝑇 1 𝜓•𝜙 ---→ 𝑇 3 ; ▶ 𝑇 2 𝜙 -1 --→ 𝑇 1 .
First of all, it is trivial that 𝜓 • 𝜙 ∈ Isom(𝑇 1 , 𝑇 3 ). The proof then follows directly from the reminders above and the two following lemmas. ( =⇒ ) There exists 𝑢 ∈ 𝑇 1 so that 𝑥 = 𝑢 and 𝑦 = 𝜙(𝑢). Let 𝑣 = 𝜙(𝑢).

Since 𝑢 = 𝜙 -1 (𝑣), 𝑦 𝑅 𝜙 -1 𝑥.

( ⇐= ) There exists 𝑣 ∈ 𝑇 2 so that 𝑣 = 𝑦 and 𝑥 = 𝜙 -1 (𝑣). Let 𝑢 = 𝜙 -1 (𝑣).

Since 𝑣 = 𝜙(𝑢), 𝑥 𝑅 𝜙 𝑦.

Proof of Proposition 3.2

Let 𝑇 1 𝜙 -→ 𝑇 2 and 𝑢 ∈ 𝑇 1 . Let 𝜓 be the restriction of 𝜙 to the nodes of From the definition of tree isomorphism, it is clear that 𝜓 ∈ Isom(𝑇 1 [𝑢], 𝑇 2 [𝜙(𝑢)]). To prove that 𝑅 𝜓 is bijective, it suffices to prove that 𝑅 𝜓 is finer than 𝑅 𝜙 ; this is achieved by virtue of the following lemma. ▶ From lines 7 to 14, we test each node 𝑢 ∈ 𝑇(𝑞) against each representative 𝑠(𝑃) for 𝑃 ∈ 𝔓. We assume constant operation costs for lines 9, 12, 13 and 14. Since all nodes 𝑢 ∈ 𝑇(𝑞) have the same equivalence class, for a fixed 𝑢, the cost of testing it against the partition is of the order of #𝔓 × 𝐶 ∼ (𝑞). Storing the nodes of 𝒟(𝑢) in 𝑁 has complexity 𝒪(# 𝒟(𝑢)) per 𝑢 ∈ 𝑇(𝑞) (except those chosen to represent their part). Actually, the total number #𝑁 of descendants can not exceed #𝑇. In addition, since #𝔓 is smaller than or equal to the number of nodes 𝑢 already processed, the overall cost of this step is 𝒪(#𝑇(𝑞) 2 𝐶 ∼ (𝑞) + #𝑇). ▶ We then delete from 𝑇(𝑞 ′ ), for 𝑞 ′ ∈ 𝒟(𝑞), the elements stored in 𝑁. Since the elements of 𝑁 are the same for each vertex 𝑞 ′ , an efficient approach is to place the nodes of 𝑁 in a hash table [START_REF] Donald | The art of computer programming[END_REF] [59]: Knuth (1973), 'The art of computer programming. Vol. 3, Sorting and Searching'

with complexity 𝒪(#𝑁) and test whether each 𝑣 ∈ 𝑇(𝑞 ′ ) is also in 𝑁 with complexity 𝒪(1). The overall complexity for this step is therefore of 𝒪 #𝑁 + 𝑞 ′ ∈𝒟(𝑞) #𝑇(𝑞 ′ ) , assuming a perfect hash function [START_REF] Lu | Perfect hashing for network applications[END_REF] [114]: [START_REF] Lu | Perfect hashing for network applications[END_REF], 'Perfect hashing for network applications' . Since #𝑁 ≤ #𝑇 and 𝑞 ′ ∈𝒟(𝑞) #𝑇(𝑞 ′ ) ≤ #𝑇 (with equality when 𝑞 is the root), the complexity can be simplified to 𝒪(#𝑇). Remark A.1 If we reject the hypothesis of a perfect hash function, the worst case complexity becomes 𝒪(𝑛) instead of 𝒪 (1). The complexity associated with the concerned step becomes 𝒪(#𝑇 2 ), which is reflected in the final complexity to yield 𝒪 #𝑇 2 (𝐶 ∼ ([𝑇]) + #𝑇) .

Since 𝐶 ∼ ([𝑇]) measures the complexity of attesting for the existence of an isomorphism up to a ciphering between two trees, this implies attesting to at least the existence of a topological isomorphism, and thus this complexity is at least as high as for the AHU algorithmwhich is at least 𝒪(#𝑇), see The Aho, Hopcroft & Ullman algorithm (p. 13). Therefore, #𝑇 = 𝒪(𝐶 ∼ ([𝑇])) and the claimed complexity remains.

A.4 Proofs of Section 4.4

Whether it is bags or collections, backtracking explores the possible associations between their elements (nodes or set of nodes), building permutations.

Backtracking tree Given two sets of 𝑛 ≥ 2 objects, there are 𝑛! ways to map them together, which correspond to the leaves of the backtracking search tree. The size of the tree itself is directly related to the number of operations 𝑎 𝑛 required to create all those permutations of 𝑛 elements [START_REF] Donald | Fascicle 2: Generating All Tuples and Permutations (Art of Computer Programming[END_REF] ⋆, ▲ ⋆, ▲ ⋆, ▲ ⋆, ▲ ⋆, ▲ ⋆, ▲ ⋆, ▲ ⋆, ▲ ⋆, ▲ 𝑎 3 = 9 nodes

We illustrate the backtracking tree with 𝑛 = 3 in Figure A.1.

If you have to process several bags in a row, you have to duplicate the backtracking tree of the second bag under each of the leaves of the first, then the tree of the third under each of the leaves of the second, etc. Simply with two bags, of cardinality 𝑝 and 𝑞, processed in this order, the total size of the backtracking tree would be given by 1 + 𝑎 𝑝 + 𝑝!𝑎 𝑞 .

The question naturally arises of the order in which the bags should be processed to obtain as small a tree as possible. Similar questions emerge regarding the order in which to process collections, which to focus on if there is a choice between bags and collections, etc. Note that in the sequel, we ignore recursive mappings (from parents) or bag/collection splits (from SplitChildren). In other words, this is a pessimistic scenario where the entire search tree is fixed by the order of processing of bags and collections, without any further modification.

A variadic function

We introduce here an abstract variadic function whose value corresponds to the size of the backtracking tree when evaluated with the cardinalities of bags and collections -as specified in the next paragraph.

Given The goal is twofold: connect the bags and collections to the tuples (𝑛 𝑖 , 𝛼 𝑖 ), and study the behavior of 𝑓 -where our goal is to minimize 𝑓 with regard to the order of the tuples, and therefore the order in which bags and collections are processed.

Link between 𝑓 , bags and collections Concerning bags, we already saw that if we have two bags of cardinality 𝑛 and 𝑚, treating them in this order induces a tree of size 1 + 𝑎 𝑛 + 𝑛!𝑎 𝑚 . If we now have 𝑝 bags of respective sizes 𝑛 1 , . . . , 𝑛 𝑝 , and that we process them successively in this order, the resulting tree has 1 + 𝑓 (𝑛 1 , 1), . . . , (𝑛 𝑝 , 1) nodes -i.e. a bag of cardinality 𝑛 corresponds to the tuple (𝑛, 1).

Concerning collections, we can in fact imagine two strategies to deal with them. Let 𝐶 be a collection and 𝑛 so that #𝐶(𝑛) > 0:

48: Indeed, we branch on #𝐶(𝑛) possibilities (mapping the first set of 𝐶 1 (𝑛) with each of the others from 𝐶 2 (𝑛)), and then process the tree generated by a bag of cardinality 𝑛.

▶ either we create the (#𝐶(𝑛))! possible bags by associating the sets of 𝐶(𝑛), and then process these bags one after the other; ▶ or we create a bag, we process it entirely, then another bag on the collection which now contains #𝐶(𝑛) -1 sets, we process it entirely, etc.

The first strategy amounts to processing a tuple (#𝐶(𝑛), 1) first, then #𝐶(𝑛) times a tuple (𝑛, 1). The second strategy amounts to processing the tuple (𝑛, #𝐶(𝑛)) first 48 , then the tuple (𝑛, #𝐶(𝑛) -1), etc., up to the tuple (𝑛, 1).

The second strategy is better to minimize 𝑓 , as per the following lemma. The conclusion is immediate when comparing term by term each of the two sums.

Therefore, 𝐶(𝑛) correspond to the tuples (𝑛, #𝐶(𝑛)), (𝑛, #𝐶(𝑛) -1), up to (𝑛, 1); the size of the backtracking tree generated by 𝐶(𝑛) is therefore expressed by 1 + 𝑓 (𝑛, #𝐶(𝑛)), (𝑛, #𝐶(𝑛) -1), . . . , (𝑛, 1) .

Proof of Theorem 4.3

Given 𝑝 ≥ 2 tuples (𝑛 𝑖 , 𝛼 𝑖 ), and denoting the first two (𝑚, 𝛼) and (𝑛, 𝛽), we are interested in the conditions on 𝑚, 𝑛, 𝛼, 𝛽 under which we would have Δ 𝑓 = 𝑓 (𝑚, 𝛼), (𝑛, 𝛽), . . . , (𝑛 𝑝 , 𝛼 𝑝 ) -𝑓 (𝑛, 𝛽), (𝑚, 𝛼), . . . , (𝑛 𝑝 , 𝛼 𝑝 ) ≤ 0.

If Δ 𝑓 ≤ 0, we process the tuples (𝑚, 𝛼) and (𝑛, 𝛽) in this order; on the other hand, if Δ 𝑓 ≥ 0, we must swap them to minimize 𝑓 . In other words, we want to define a strategy for when to swap the first two tuples.

Remark A.2 Note that, by virtue of the bubble sort principle [START_REF] Astrachan | Bubble sort: an archaeological algorithmic analysis[END_REF] [115]: [START_REF] Astrachan | Bubble sort: an archaeological algorithmic analysis[END_REF], 'Bubble sort: an archaeological algorithmic analysis'

, it is enough to know when to swap the first two arguments to minimize globally 𝑓 . Indeed, we can then recursively permute the subsequent ▶ if there are only collections left, say 𝐶(𝑛) and 𝐶 ′ (𝑚) -with #𝐶(𝑛) ≥ 2 and #𝐶 ′ (𝑚) ≥ 2, Table A.1 shows that the size of the tree is minimized by starting with max(𝑛, 𝑚) -and min(#𝐶(𝑛), #𝐶 ′ (𝑚)) if 𝑛 = 𝑚. It suffices to show that the right-hand term is non-negative, i.e. that 𝑠 𝑛,𝑘 (𝛽𝑛! -1) ≥ 𝑏 𝑛 . If we show that this is true for 𝑘 = 1, since 𝑠 𝑛,𝑘 is increasing in 𝑘, the inequality will hold for any 𝑘 ≥ 1. Since 𝑠 𝑛,1 = 1/𝑛!, the case 𝑘 = 1 is equivalent to To show this result, we proceed by disjunction of cases on 𝑛.

Remaining proofs Preliminaries

Lemma A.9 Equation A.5 holds for 𝑛 = 2, and 𝑘, 𝛼 ≥ 1.

Proof. We rewrite Equation A.5 as

1 𝑠 2,𝑘 1 - 2! 𝛼(2 + 𝑘)! > 2! -1 𝑏 2 = 1.
If the inequality holds for 𝛼 = 1, it will hold for any value of 𝛼. Let 𝛼 = 1.

Multiplying each side of the inequality by 𝑠 2,𝑘 , we obtain

𝑘+1 𝑖=2 1 𝑖! < 1 - 2 (𝑘 + 2)! ⇐⇒ 𝑘+2 𝑖=2 1 𝑖! < 1 - 1 (𝑘 + 2)! .
The left-hand term on the right is increasing in 𝑘 and tends to 𝑒 -2 ≈ 0.71; whereas the right-hand term is also increasing and equals 1- .

Note that the left-hand term is a (strictly) decreasing function of 𝑘; therefore the inequality holds if we can prove that it holds when 𝑘 → ∞.

In light of lim 𝑘→∞ 𝑠 𝑛,𝑘 = 𝑟 𝑛 , and with 𝑏 𝑛 = (𝑒 -1) -𝑟 𝑛 > 0, this amounts to prove that

(𝑛! -1) 1 + 1 𝑛 𝑟 𝑛 𝑒 -1 -𝑟 𝑛 < 1. (A.6)
We end the disjunction of cases with the following lemmas. 49: Indeed, 𝑟 𝑛 is a decreasing function of 𝑛, and we can show that 𝑛!𝑟 𝑛 is too, at the expense of a tedious but direct calculation.

Proof. With 𝑛! -1 < 𝑛!, we bound the left-hand term of Equation A.6 by 1 + 1 𝑛 𝑛!𝑟 𝑛 𝑒 -1 -𝑟 𝑛 Note that each of the terms composing this product is a decreasing function 49 of 𝑛, so the product is decreasing as well. It turns out that starting from 𝑛 = 4, this term is smaller than 1 and so it is for 𝑛 ≥ 4. Indeed, we have 𝑟 4 = 𝑒 -8/3 and the product is evaluated as ≈ 0.92 < 1.

Proof of Proposition 4.4

Using the definition of 𝑓 given by Equation A.2, we have the following. Reconnecting with the bags and collections:

▶ A bag 𝐵 ∈ B contributes a tuple (#𝐵, 1) and thefore to #𝐵! in the product;

▶ A collection 𝐶 ∈ C and an integer 𝑛 ∈ N so that #𝐶(𝑛) > 0 contributes the tuples (𝑛, #𝐶(𝑛)), (𝑛, #𝐶(𝑛) -1), . . . , (𝑛, 1) so a total combined of #𝐶(𝑛)!𝑛! #𝐶(𝑛) .

We retrieve exactly 𝑁(B, C) as in Equation 4.2. Bounding the sum by 2 leads to 2(𝑒 -1)𝑁(B, C).

Note that this result is true whether or not we optimize the order of tuples to minimize 𝑓 . The bound is rather high since a lot of information is lost by using 𝑛! ≥ 2.

By sorting the tuples, one can imagine the gain on the bound in light of Lemma A. 13 -showing what can be gained (or lost) if we optimize (or not) the order of the tuples.

A.5 Proof of Proposition 7.3

This proof is reproduced from [START_REF] Azaïs | The weight function in the subtree kernel is decisive[END_REF] [39]: Azaïs et al. (2020), 'The weight function in the subtree kernel is decisive'

and is mainly based on the following technical lemma, whose statement requires the following notation. If 𝑢 is a vertex of a tree 𝑇, 𝔉(𝑢) denotes the family of 𝑢, i.e., the set composed of the ascendants of 𝑢, 𝑢, and the descendants of 𝑢 in 𝑇. We recall that 𝒟(𝑢) stands for the latter. 𝑤 𝜃 N 𝜃 (𝑇 𝑢 𝑖 ) N 𝜃 (𝑇 𝑣 𝑖 ).

If 𝜃 ∈ 𝒮(𝜏 ℋ (𝑢) )∩𝒮(𝜏 ℋ (𝑣) ), then N 𝜃 (𝑇 𝑧 𝑖 ) = N 𝜃 (𝜏 ℋ (𝑧) ), 𝑧 ∈ {𝑢, 𝑣}, because, for any ℎ > 0, 𝜏 ℎ is not a subtree of 𝑇 0 or 𝑇 1 by assumption. Thus, but the rest of the proof is similar. Finally, the formula for 𝐾(𝑇 𝑢 1 , 𝑇 𝑣 2 ) is a direct consequence of the third assumption on 𝑇 1 , 𝑇 2 and the sequence (𝜏 ℎ ).

By virtue of the previous lemma, one can derive the following result on the quantity Δ 𝑖 𝑥 defined by Equation 7.5. ). The conclusion comes from the fact that the probability of drawing a vertex 𝑥 of height greater than ℎ is 𝐺 𝜌 (ℎ).

Lemma

Index of frequent notations

1 :Figure 1 :

 11 Figure 1: Arabidopsis Thaliana, courtesy of Sana Dieudonné.

Figure 2 :

 2 Figure 2: Phenotyping station, ©ROMI.

[ 2 ]

 2 : Besnard et al. (2014), 'Cytokinin signalling inhibitory fields provide robustness to phyllotaxis' [3]: Guédon et al. (2013), 'Pattern identification and characterization reveal permutations of organs as a key genetically controlled property of post-meristematic phyllotaxis' even though phenotyping is currently done by hand.

[ 4 ]

 4 : Chaudhury et al. (2020), 'Skeletonization of plant point cloud data using stochastic optimization framework' and the segmentation [5] [5]: Mirande et al. (2020), 'High-precision 3D segmentation of plants combining spectral clustering and quotient graph techniques: a multi-level approach' have already been published. A diagram of the pipeline can be found in Figure 3.

Figure 3 :

 3 Figure 3: Reconstruction pipeline for the ROMI Scanner. The plant and histogram icon are ©Delapouite, https://game-icons.net.

Figure 4 :

 4 Figure 4: A virtual Arabidopsis Thaliana obtained with the LPy software; courtesy of Christophe Godin.

[ 8 ]

 8 : Prusinkiewicz et al. (2012), The algorithmic beauty of plants . We use the LPy software [9] [9]: Boudon et al. (2012), 'L-Py: an L-system simulation framework for modeling plant architecture development based on a dynamic language'

Figure 1 . 1 : 3

 113 Figure 1.1: A tree.

( a )Figure 1 . 2 :Figure 1 . 3 :

 a1213 Figure 1.2: Three examples of data that can be modeled by trees.

[ 25 ]

 25 : McKay et al. (2014), 'Practical graph isomorphism, II' .

[ 26 ]

 26 : Ingels et al. (2021), 'Isomorphic Unordered Labeled Trees up to Substitution Ciphering' .

[ 40 ]

 40 : Cayley (1875), On the Analytical Forms Called Trees: With Application to the Theory of Chemical Combinations

.

Figure 1 . 4 :

 14 Figure 1.4: An example of a tree (left) and its DAG compression (right).

[ 26 ]

 26 : Ingels et al. (2021), 'Isomorphic Unordered Labeled Trees up to Substitution Ciphering'

[ 39 ]

 39 : Azaïs et al. (2020), 'The weight function in the subtree kernel is decisive' . Finally, Chapter 9 summarizes the different contributions of my thesis and opens a discussion on the research directions they induce.

Figure 1 . 5 :

 15 Figure 1.5: The treex logo, drawn by yours truly.

[ 46 ]

 46 : Azaïs et al. (2019), 'Treex: a Python package for manipulating rooted trees' .Excluding documentation and unit tests, my contribution represents almost 2,000 lines of code. One can thus find a module dedicated to the computation of labeled tree isomorphisms; another for the enumeration of trees, forests and subforests; and also a module for the computation of the subtree kernel.

  A cycle (in red) (e) A directed cycle (in red) (f) A multigraph

Figure 2 . 1 :

 21 Figure 2.1: A non-exhaustive bestiary of graphs.

Figure 2 . 2 :

 22 Figure 2.2: A rooted tree. The root is displayed in red, and the leaves in blue.

Figure 2 . 3 :

 23 Figure 2.3: Encoding of a tree with Knuth tuples.

  , 'The continuum random tree III' [51]: Azaïs et al. (2019), 'Inference for conditioned Galton-Watson trees from their Harris path' .

Figure 2 . 4 :

 24 Figure 2.4: Two isomorphic graphs. An isomorphism is provided via the color of the vertices: two vertices with the same color are in bijection.

Figure 2 . 5 :

 25 Figure 2.5: Two trees, isomorphic as unordered trees, but not isomorphic as ordered trees.

[ 51 ]

 51 : Azaïs et al. (2019), 'Inference for conditioned Galton-Watson trees from their Harris path' ; or RANRUT algorithm [54, 55] [54]: Nijenhuis et al. (2014), Combinatorial algorithms: for computers and calculators [55]: Alonso et al. (1994), 'Random Unlabelled Rooted Trees Revisited'

Figure 2 . 6 :

 26 Figure 2.6: An (unordered) tree where nodes with identical equivalence class have been colored identically.

  We denote by [𝑣] the class of equivalence of a node 𝑣 ∈ 𝑇, i.e. the set of all nodes 𝑢 ∈ 𝑇 such that 𝑇[𝑣] ≃ 𝑇[𝑢]. An example is provided in Figure 2.6.

[ 43 ]

 43 : Hart et al. (1991), 'Efficient antialiased rendering of 3-D linear fractals' . One can also use DAG reduction of trees to simplify queries on XML documents [44, 45] [45]: Frick et al. (2003), 'Query evaluation on compressed trees' [44]: Buneman et al. (2003), 'Path queries on compressed XML' .

2

 2

Figure 2 . 7 :

 27 Figure 2.7:An unordered tree (left) and its DAG compression (right). Note that since the order of the arcs does not matter (𝑇 being unordered), the arc → has only been drawn once, and its multiplicity written aside.

Figure 2 . 8 :

 28 Figure 2.8: From left to right: a tree 𝑇, its quotient graph 𝑄(𝑇), the unordered version of Q(𝑇) and the ordered version of Q(𝑇). Nodes are colored according to their class of equivalence.

[ 61 ]

 61 : Godin et al. (2009), 'Quantifying the degree of self-nestedness of trees: application to the structural analysis of plants' . Let 𝑇 be a unlabeled tree. Let 𝑄(𝑇) = 𝑇/ ≃ be the quotient graph of 𝑇 by ≃. Nodes of 𝑄(𝑇) are equivalence classes of nodes of 𝑇; an arc 𝑎 → 𝑏 exists in 𝑄(𝑇) if and only if there exist 𝑢, 𝑣 ∈ 𝑇 such that [𝑢] = 𝑎, [𝑣] = 𝑏, and 𝑣 ∈ 𝒞(𝑢). Such a graph 𝑄(𝑇) is known to be a DAG [61, Proposition 1].

Figure 2 . 9 :Construction

 29 Figure 2.9: From left to right: a tree 𝑇, its unordered DAG compression ℜ(𝑇) and its reconstruction 𝜏.

1 5 for 𝑣 ∈ 𝑇 ℎ do 6 𝐶

 156 Let 𝑄 be the empty graph2 𝑖 ← 0 3 Let 𝑓 : ∅ ↦ → 0 4 for ℎ from 0 to ℋ (𝑇) do 𝑣 ← [[𝑢] : 𝑢 ∈ 𝒞(𝑣)]

Figure 2 . 10 :

 210 Figure 2.10: An illustration step by step of Algorithm 4 with (a) two trees 𝑇 1 and 𝑇 2 , seen either as (b) unordered or (c) ordered trees. One can observe their DAG compression (left of the dashed line) and the execution of the algorithm (right of the dashed line). At each step 1, 2 and 3, we examine vertices at height (0,1,2) and merge those which have same children. At step 4, we can not find any vertex to merge and we stop. Note that in (c) at step 3, we find two pairs of vertices to be merged: we are not restricted to one pair per height. Merged vertices are colored in red. The artificial root is colored in black.

Figure 3 . 1 :

 31 Figure 3.1: Pigpen cipher, ©Wikipedia Commons. For instance, the letter V is replaced by ∧, U by <, and so on.

[ 64 ]

 64 : Mayzner et al. (1965), 'Tables of single-letter and digram frequency counts for various word-length and letter-position combinations.'

[ 69 ]

 69 : Grohe et al. (2021), 'Deep Weisfeiler Leman'

[ 25 ]

 25 : McKay et al. (2014), 'Practical graph isomorphism, II' .

Figure 3 . 4 :

 34 Figure 3.4: An unordered tree 𝑇 (left) and its DAG compression ℜ(𝑇) (right).The method for computing 𝑛 ≃ (𝑇) is highlighted in both cases: for 𝑇, nodes susceptible to be swapped are boxed together; for ℜ(𝑇), multiplicity of arcs and presence are indicated. Eitherway, 𝑛 ≃ (𝑇) = (2!) 3 = 8.

Figure 3 . 6 :

 36 Figure 3.6:A labeled tree 𝑇 (left), where the labels are the (𝑥, 𝑦) coordinates of each node; and the DAG compression ℜ ∼ (𝑇) of 𝑇 (right), taking into account the labels. Nodes are colored according to their equivalence class (with respect to ∼). Although not shown on the DAG, note that each node in the DAG carries a label, which are here the coordinates of the node in 𝑇 chosen to represent its equivalence class. Since the transformations between leaves have not been made explicit, the arcs leading to them do not carry any informationand are not complete with respect to the DAG construction.

Algorithm 6 :do 3 for 𝑞 ∈ 𝐷 ℎ do 4 𝔓 5 Let 𝑠 : ∅ ↦ → ∅ 6 𝑁 ← ∅ 7 for 8 if 9 AddRemark 3 . 7

 6345678937 CompressionWithLabels Input: 𝐷 = ℜ(𝑇), 𝑇 Output: ℜ ∼ (𝑇) 1 Construct, within one traversal of 𝑇, the mapping 𝑞 ∈ 𝐷 ↦ → 𝑇(𝑞), where 𝑇(𝑞) = {𝑢 ∈ 𝑇 : [𝑢] = 𝑞} /* Remember that [•] stands for the equivalence class with respect to ≃. */ 2 for ℎ from ℋ (𝐷) to 0 ← {∅} /* We partition in 𝔓 the nodes of 𝑇(𝑞) by equivalence class. */ 𝑢 ∈ 𝑇(𝑞) do ∃𝑃 ∈ 𝔓 : 𝑢 ∼ 𝑠(𝑃) then 𝑢 to 𝑃 𝑁 ← 𝑁 ∪ 𝒟(𝑢) /* By virtue of Equation 3.5, we store 𝒟(𝑢) to remove it later from 𝑇(𝑞 ′ ), with 𝑞 ′ ∈ 𝒟(𝑞). */ else 𝑃 ← {𝑢} Define 𝑠(𝑃) = 𝑢 Add 𝑃 to 𝔓 for 𝑞 ′ ∈ 𝒟(𝑞) do 𝑇(𝑞 ′ ) ← 𝑇(𝑞 ′ ) \ 𝑁 for 𝑃 ∈ 𝔓 do Create a new vertex 𝑝 in 𝐷 with no child 𝑝 ← 𝑠(𝑃) Define [[𝑠(𝑃)]] = 𝑝 for 𝑢 ∈ 𝑃 do There exists 𝜙 so that 𝑇[𝑠(𝑃)] 𝜙 -→ 𝑇[𝑢] Add an arc from [[𝒫(𝑢)]] to 𝑝, bearing cipher 𝑓 𝜙 /* In the ordered case, take into account the position of 𝑢 among children of 𝒫(𝑢) when adding the new arc. */ 24 Delete vertex 𝑞 from 𝐷 25 return 𝐷 Note that the pseudocode provided does not associate to each node 𝑢 ∈ 𝑇 1 its equivalence class [[𝑢]]

Figure 3 . 8 :

 38 Figure 3.8: An unordered labeled tree 𝑇 (left), and its (classical) DAG compression ℜ(𝑇) (right). Nodes with same equivalence class (with respect to ≃) are colored accordingly.

Figure 3 . 9 :

 39 Figure 3.9: State of the graph obtained from ℜ(𝑇) after each iteration of Algorithm 6 on the tree of Figure 3.8. Nodes are colored accordingly to their equivalence class with respect to ∼ for labeled nodes, and to ≃ for unlabeled ones. The cipher on the arcs are defined as 𝑓 (𝑥) = 2𝑥, 𝑔(𝑥) = 𝑥 2 and ℎ : 3 ↦ → 4.

4

 4 Analysis of the algorithm . . 49 Theoretical analysis . . . . . 50 Experimental protocol . . . . 52 The preprocessing breaks the cardinality of the search space . . 52 Computation time repartition between backtracking and preprocessing . . . . . . . . . . . . . . . . . . 54 When trees are not isomorphic up to a cipher . . . . . . . . . . . . . . 55

[ 26 ]

 26 : Ingels et al. (2021), 'Isomorphic Unordered Labeled Trees up to Substitution Ciphering'

Figure 4

 4

Figure 4 . 1 :

 41 Figure 4.1: A graph (left) and its reduction as a labeled tree (right). Colors have been added for better readability.

[ 25 ]

 25 : McKay et al. (2014), 'Practical graph isomorphism, II'

[ 72 ]

 72 : Canzar et al. (2015), 'On treeconstrained matchings and generalizations' [73]: Mastrolilli et al. (2012), 'Constrained matching problems in bipartite graphs'

Observation 4 . 2

 42 𝜙(𝑢) = 𝑣 also implies that (iv) 𝜙(𝒫(𝑢)) = 𝒫(𝑣) and (v) ∀𝑤 ∈ 𝒞(𝑢), 𝜙(𝑤) ∈ 𝒞(𝑣).

  2 and splitting a collection 𝐶 into two new collections 𝐶 ′ and 𝐶 ′′ , for each integer 𝑛, say we have #𝐶(𝑛) = 𝑝 + 𝑞, #𝐶 ′ (𝑛) = 𝑝 and #𝐶 ′′ (𝑛) = 𝑞; then we go from (𝑝 + 𝑞)!(𝑛!) 𝑝+𝑞 possibilities to 𝑝!(𝑛!) 𝑝 × 𝑞!(𝑛!) 𝑞 , reducing the space by a factor of 𝑝+𝑞 𝑞 . ▶ Finally, Deduction Rule 4.1, Deduction Rule 4.3 and Deduction Rule 4.4 do not modify the size of the search space. As an example, the bag 𝐵 of Figure 4.2 represents 4! = 24 potentials mappings, but only 3! × 1! = 6 after being split up; the collection 𝐶 of Figure 4.3 accounts for 3! × (1!) 3 × 2! × (2!) 2 = 48 potentials mappings, but only 8 after being split up.

Figure 4 .

 4 Figure 4.5 illustrates this step on the running example.

  Formally, for each 𝐵 = (𝐵 1 , 𝐵 2 ) in B, we define 𝐵 𝑖 (𝑎) = {𝑢 ∈ 𝐵 𝑖 : 𝑢 = 𝑎} and 𝒜(𝑇 𝑖 )| 𝐵 = {𝑎 ∈ 𝒜(𝑇 𝑖 ) : 𝐵 𝑖 (𝑎) ≠ ∅}. We add a new collection 𝐶 = ({𝐵 1 (𝑎) : 𝑎 ∈ 𝒜(𝑇 1 )| 𝐵 }, {𝐵 2 (𝑏) : 𝑏 ∈ 𝒜(𝑇 2 )| 𝐵 }) to C, and remove 𝐵 from B. 𝐵 𝑢

Figure 4 . 8 :

 48 Figure 4.8: State of the system after converting all bags into collections, before any deductions, as well as the current mapping of the labels 𝑓 (above, right). The size of the current space is now: 2! for 𝐶, 2! × 2! = 4 for 𝐶 ′ , 3! × (2!) 3 = 48 for 𝐶 ′′ and 2! for 𝐶 ′′′ ; all combined gives 768.

Figure 4 .

 4 Figure 4.8 illustrates the state of the system after converting all bags into collections, but before applying any Deduction Rules. Applying Deduction Rule 4.2 provokes the following changes on the running example:

Figure 4 . 9 :

 49 Figure 4.9:The mapping on nodes and remaining bag (above), the remaining collections (below, left) and the mapping on labels (below, right) at the end of the preprocessing phase. The collection 𝐶(5) has been split into two new collections 𝐶 * and 𝐶 * * , after the mapping of (𝑢 5 , 𝑣 6 ), via the SplitChildren procedure. The size of the final space is: 2! for the last bag, and 2! for each collections, for a total combined of 8. Note that this number is way below 𝑁 ≃ (𝑇 1 ) = 576, indicating that the preprocessing phase succeeded in reducing the size of the search space.

4

 4

19 return 21 B

 1921 Backtracking(B, C, 𝜙, 𝑓 , 𝜎) catch , C, 𝜙, 𝑓 , 𝜎 ← RestoreState(𝑆) return ⊥ else return ⊤ If we resume the example of Figure 4.9, NextCandidates(B, C) would return 𝜆 = B and 𝐿 = {(𝑢 9 , 𝑣 7 ), (𝑢 9 , 𝑣 8 )}. After mapping 𝜙(𝑢 9 ) = 𝑣 7 , we would deduce 𝜙(𝑢 10 ) = 𝑣 8 , and start the recursion, this time on collections.

  Assuming 𝑇 1 ≃ 𝑇 2 , and denoting by 𝑛 = #𝑇 1 = #𝑇 2 and 𝑑 = deg(𝑇 1 ) = deg(𝑇 2 ), we have the following result. Proposition 4.2 The SplitChildren procedure, detailed in Algorithm 8 and Algorithm 9, has complexity 𝒪(𝑛𝑑).

  Evolution of 𝑟(B, C) after each step of the preprocessing 50 75 100 125 150 175 200 225 250 𝑟 final (B, C) at the end of preprocessing

Figure 4 . 10 :

 410 Figure 4.10: 𝑟(B, C) at differents steps of the preprocessing, with regard to the size and proportion of labels of trees, with 𝑇 1 ∼ 𝑇 2 .

  Proportion of mapped labels

Figure 4 . 11 :

 411 Figure 4.11: Proportion of mappings at the end of preprocessing, with regard to the size and proportion of labels of trees, with 𝑇 1 ∼ 𝑇 2 .

Figure 4 . 12 :

 412 Figure 4.12: Computation time spent in the preprocessing part 𝑡 𝑝 and the backtracking part 𝑡 𝑏 , in the case where 𝑇 1 ∼ 𝑇 2 . In Figure 4.12a, the outliers are not shown for the sake of readability. On the other hand, they are present on Figure 4.12b.

23 :

 23 Note that we use here smaller trees than before, with 𝑛 ∈ {10𝑘 : 2 ≤ 𝑘 ≤ 10}, due to computation time constraints -in light of Figure4.14b.

  log 10 (𝑡 𝑏 ) ≈ 0.72 log 10 (𝑁(B, C)) 0.41 -3.09;where the values of the parameters have been estimated using least squares method. It seems that 𝑡 𝑏 tends, on average, to grow sublinearly as a function of 𝑁(B, C) -to relate with Proposition 4.4.

Figure 4 . 13 :

 413 Figure 4.13: log 10 (𝑡 𝑏 ) as a function of log 10 (𝑁(B, C)) -evaluated at the beginning of backtracking. The trend is interpolated by the green curve, whose equation is given by 𝑦 = 0.72𝑥 0.41 -3.09.

  Decision 𝑇 1 ≁ 𝑇 2 is made during preprocessing 20 Decision 𝑇 1 ≁ 𝑇 2 is made during backtracking

Figure 4 . 14 :

 414 Figure 4.14: Logratio log 10 (𝑡 ⊥ /𝑡 ⊤ ) with regard to the size and proportion of labels of trees.

Definition 5 . 1

 51 𝑓 : S \ ∅ → S is a reduction rule if and only if ▶ ∀𝑠 ∈ S \ ∅, 𝑓 (𝑠) ⊆ 𝑠 and ∄𝑢 ∈ S \ {𝑠, 𝑓 (𝑠)}, ( 𝑓 (𝑠) ⊆ 𝑢) ∧ (𝑢 ⊆ 𝑠); ▶ ∀𝑠 ∈ S \ ∅, ∃𝑘 ∈ N * , 𝑓 𝑘 (𝑠) = ∅.

Remark 5 . 1 Figure 5 . 1 :

 5151 Figure 5.1: An illustration of the reverse search method on permutations. (a) depicts the relations between permutations with 𝑛 = 3; (b) shows the enumeration tree.

[ 81 ]

 81 : Di Battista et al. (1988), 'Algorithms for plane representations of acyclic digraphs' [82]: Freese (2004), 'Automated lattice drawing', i.e. DAGs where an arc 𝑥 → 𝑦 reflects 𝑦 ⊂ 𝑥 -see Figure5.1a for 𝑛 = 3.

[ 84 ]

 84 : Deshpande et al. (2005), 'Mining Chemical Compounds'

.

Figure 5 . 2 :

 52 Figure 5.2: A tree 𝑇 (left) and its 3 successors 𝑇 1 , 𝑇 2 and 𝑇 3 obtained via the expansion rule for ordered trees. The rightmost paths are showed in red; and the new nodes in red as well.

Figure 5 . 3 : 27 :Figure 5 . 4 :

 532754 Figure 5.3: Two different representations of the same unordered tree. There are as many as possible permutations of ( , , ), i.e. 6. 27: Not to be mistaken with the number of isomorphisms which involves the permutations of sibling nodes with the same equivalence class; see On the number of tree isomorphisms (p. 25).

[ 85 ]

 85 : Parque et al. (2021), 'An Efficient Scheme for the Generation of Ordered Trees in Constant Amortized Time', which does not use a reverse search approach.

[ 30 ]

 30 : Nakano et al. (2003), 'Efficient generation of rooted trees'

[ 27 ]

 27 : Asai et al. (2003), 'Discovering frequent substructures in large unordered trees'

Figure 5 . 5 :

 55 Figure 5.5: An unordered irredundant forest 𝐹 (left) and its DAG compression (right).Nodes are colored according to their class of equivalence. The roots of the DAG (indicated by red arrows) correspond exactly to the roots of the trees in 𝐹. For the sake of clarity, arcs of multiplicity greater than one are drawn only once and their multiplicity is written next to the arc.

[ 30 ]

 30 : Nakano et al. (2003), 'Efficient generation of rooted trees' [27]: Asai et al. (2003), 'Discovering frequent substructures in large unordered trees'

Figure 5 . 6 :

 56 Figure 5.6: The DAG on the top admits five topological orderings, which are shown in the table.

Figure 5 . 7 :

 57 Figure 5.7: A FDAG 𝐷 (top) and its canonical ordering 𝜓 (bottom).

Figure 6 . 1 :

 61 Figure 6.1: Branching rule applied to the FDAG of Figure 5.7. As 𝒞 𝜓 (𝑣 5 ) = 211, the only letters 𝑎 we can pick from A < = {0, 1, 2, 3}, satisfying 𝑎 ≤ lex. 1, are 0 and 1. The only two possibles outcomes of are the words (a) 2111 and (b) 2110.

Figure 6 . 2 :

 62 Figure 6.2: Elongation rule applied to the FDAG of Figure 5.7. As A = = {4, 5}, there are only two choices leading to (a) 𝒞 𝜓 (𝑣 6 ) = 4 and (b) 𝒞 𝜓 (𝑣 6 ) = 5. The alphabets become A < = {0, . . . , 5} and A = = {6}.

Figure 6 . 3 :

 63 Figure 6.3: We apply to the FDAG of Figure 5.7. Here, A < = {0, 1, 2, 3} and 𝑤 = 211. As seen in A detour through formal languages (p. 66), the minimal words of Λ 𝑤 < are 3, 22, 2111 and 2110. Therefore, there are 4 ways to add a new vertex 𝑣 6 via the widening rule, that are such that (a) 𝒞 𝜓 (𝑣 6 ) = 3, (b) 𝒞 𝜓 (𝑣 6 ) = 22, (c) 𝒞 𝜓 (𝑣 6 ) = 2111 or (d) 𝒞 𝜓 (𝑣 6 ) = 2110. Finally, we update A = to be equal to {4, 5, 6}.

Figure 6 . 4 :

 64 Figure 6.4: The path (in bold) in the FDAGs enumeration tree leading to the FDAG of Figure 5.7. The unexplored branches are only displayed by their root, which are shown partially transparent. The order of insertion of the vertices of each FDAG is always the same, and follows the color code (in the order of insertion):, , , , ,and . With respect to the canonical ordering, they are numbered 0 to 6 in the same order.

[ 88 ]Proposition 6 . 6 ( 2 𝑘 𝛽 + 𝒪 1 𝑘with 𝛽 = 6 √ 2 𝜋 2

 886621622 : Hwang et al. (2019), 'Asymptotics and statistics on Fishburn matrices and their generalizations' for a review. Notably, the asymptotic expansion of the number of row-Fishburn matrices has been conjectured first by Jelínek [89] [89]: Jelínek (2012), 'Counting general and self-dual interval orders' and then proved by Bringmann et al. [90] [90]: Bringmann et al. (2014), 'Asymptotics for the number of row-Fishburn matrices' . Jelínek, Bringmann et al.) As 𝑘 → ∞, #𝐸 𝑘 = 𝑘! 12 𝜋 𝑒 𝜋 2 /24 = 1.29706861206 . . . .

Figure 6 . 5 :

 65 Figure 6.5: Numbers of successors of 1,000 random FDAGs in the enumeration tree, according to their number of vertices. Orange lines have equations 𝑦 = 𝑛 + 1 and 𝑦 = 2𝑛 -1.

Figure 6 . 6 :

 66 Figure 6.6: Total computation time (in blue) and amortized time (in red) for the explicit construction of the successors of the 1,000 random FDAGs of Figure 6.5, according to their number of vertices. The computations have been made on a Mac-Book Pro (2014) with an Intel Core i7 2.8 GHz processor and 16 GB of RAM.

Definition 6 . 6 (

 66 𝐸) Choose any index 𝑗 ′ ≥ 𝑗. Increase 𝜋(𝑗 ′ ) by one and set 𝑗 ← 𝑗 ′ .

3 2 2 Figure 6 . 7 :

 3267 Figure 6.7: A self-nested tree 𝑇 (left) and its DAG reduction ℜ(𝑇) (right). Nodes are colored according to their class of equivalence.

[ 93 ]

 93 : Azaïs et al. (2019), 'Approximation of trees by self-nested trees'

[ 93 ]

 93 : Azaïs et al. (2019), 'Approximation of trees by self-nested trees'

Figure 6 . 8 :

 68 Figure 6.8: Construction of a forest of subtrees from a FDAG. (a) A FDAG 𝐷. The set 𝑉 is circled in red. (b) The FDAG Δ (c) The forest 𝑓 compressed by Δ. (d) The forest 𝐹 compressed by 𝐷. One can spot that 𝑡 1 ∈ 𝒮(𝑇 1 ), 𝑡 2 ∈ 𝒮(𝑇 2 ) so 𝑓 is a forest of subtrees of 𝐹, and Δ a subFDAG of 𝐷.

5 ∅Figure 6 . 9 :

 569 Figure 6.9: Enumeration tree of the subFDAGs of the FDAG of Figure 5.7, using both Algorithm 12 and Algorithm 15. The indices of the vertices correspond to the canonical ordering defined in Figure 5.7. In each vertex, the upper part corresponds to the current subFDAG Δ whereas the lower part stands for the set 𝑆(Δ). Numbers in red indicate what changes for an heir compared to its parent.

Figure 6 .

 6 9 provides an example by enumerating all subFDAGs of the FDAG of Figure 5.7.

Figure 6 . 10 :

 610 Figure 6.10: Quotient 𝑄(𝐷) according to the number of vertices of 𝐷. Here 1 000 random FDAGs are displayed.

0 1 2 (Figure 7

 27 Figure 7.1: Suppose we want to build a classifier to separate the red and blue data (on the left). However, imagine the algorithm we have only allows to build linear classifiers: there is no hope to succeed. On the other hand, via a well-chosen feature map 𝜑, one can send the data into a space in which they are linearly separable -see the green line (on the right).

[ 33 ]

 33 : Cristianini et al. (2000), An introduction to support vector machines and other kernel-based learning methods [97]: Schölkopf et al. (2001), Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond [98]: Shawe-Taylor et al. (2004), Kernel methods for pattern analysis [99]: Hastie et al. (2009), The elements of statistical learning: data mining, inference, and prediction

Figure 7 . 3 :

 73 Figure 7.3: Two trees 𝑇 0 and 𝑇 1 that fulfill conditions (𝑖) and (𝑖𝑖).

Figure 7 . 4 :

 74 Figure 7.4: Two trees 𝑇 0 and 𝑇 1 that fulfill conditions (𝑖), (𝑖𝑖) and (𝑖𝑖𝑖).

  Balcan et al. (2008), 'A theory of learning with similarity functions' have introduced a theory that describes the effectiveness of a given kernel in terms of similarity-based properties. A similarity function over 𝒳 is a pairwise function 𝐾 : 𝒳 2 → [-1, 1] [103, Definition 1]. It is said (𝜖, 𝛾)-strongly good [103, Definition 4] if, with probability at most 1 -𝜖,

[ 102 ]

 102 : Aiolli et al. (2006), 'Fast on-line kernel learning for trees' [35]: Collins et al. (2001), 'Convolution kernels for natural language' [36]: Da San Martino (2009), 'Kernel methods for tree structured data' [100]: Kimura et al. (2011), 'A subpath kernel for rooted unordered trees' [37]: Vishwanathan et al. (2004), 'Fast kernels for string and tree matching'

  from its topology . . . . . . . . . . . . . . . . . . 108 Markup documents data sets 111 Biological data sets . . . . . . 113 LOGML . . . . . . . . . . . . . 114 8.3 Interest of the DAG approach115 Learning the weight function115 Computation time . . . . . . 117

[ 35 ]

 35 : Collins et al. (2001), 'Convolution kernels for natural language'

[ 97 ]

 97 : Schölkopf et al. (2001), Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond .

Figure 8 . 1 :

 81 Figure 8.1: The discriminance weight is defined by 𝜔 𝑡 = 𝑓 (1 -𝛿 𝑡 ) where 𝑓 : (-∞, 1] → [0, 1] is increasing with 𝑓 (0) = 0 and 𝑓 (1) = 1. This figure presents some usual choices for 𝑓 .

[ 104 ]

 104 : Ebert et al. (2003), Texturing & modeling: a procedural approach

  To quantify the quality of a prediction, we use four standard metrics: accuracy, precision, recall and F-score. For a class 𝑘, one can have true positives 𝑇𝑃 𝑘 , false positives 𝐹𝑃 𝑘 , true negatives 𝑇𝑁 𝑘 and false negatives 𝐹𝑁 𝑘 . In a binary classification problem, those metrics are defined as, Accuracy(𝑘) = 𝑇𝑃 𝑘 + 𝑇𝑁 𝑘 𝑇𝑃 𝑘 + 𝐹𝑃 𝑘 + 𝐹𝑁 𝑘 + 𝑇𝑁 𝑘 , Precision(𝑘) = 𝑇𝑃 𝑘 𝑇𝑃 𝑘 + 𝐹𝑃 𝑘 , Recall(𝑘) = 𝑇𝑃 𝑘 𝑇𝑃 𝑘 + 𝐹𝑁 𝑘 , F-score(𝑘) = 2 Precision(𝑘) × Recall(𝑘) Precision(𝑘) + Recall(𝑘)

Figure 8 . 2 :

 82 Figure 8.2:Underlying ordered tree structure (right) present in a HTML document (left). Each level in the tree is colored in the same way as the corresponding tags in the document. Natural order from top to bottom in the HTML document corresponds to left-to-right order in the tree.

▶

  a data set to predict 𝒳 pred made of 120 trees; ▶ a small train data set 𝒳 small train made of 40 trees; ▶ a medium train data set 𝒳 medium train made of 120 trees; ▶ and a large train data set 𝒳 large train made of 200 trees.

Figure 8 . 3 :Figure 8 . 4 :

 8384 Figure 8.3: Description of a Wikipedia data set (480 trees).

Figure 8 . 5 :

 85 Figure 8.5: Visualisation of one data set 𝒳 = 𝒳 medium train ∪ 𝒳 pred of unordered trees among the 30 Wikipedia databases. Each vertex 𝑣 ∈ ℜ(𝒳 )

Figure 8 . 6 :Figure 8 . 7 :

 8687 Figure 8.6: Estimation of the distribution of the discriminance weight function ℎ ↦ → {𝑤 𝑣 : ℋ (𝑣) = ℎ, 𝑣 ∈ ℜ(𝒳 )} from one large training Wikipedia data set of unordered trees (left) and fit of its average behavior (in red) to an exponential function (in blue). All ordered and unordered data sets show a similar behavior.

Figure 8 . 8 :

 88 Figure 8.8: Classification results for INEX 2005 (top) and INEX 2006 (bottom) as ordered (left) and unordered (right) trees.

Figure 8 . 9 :

 89 Figure 8.9: Description of the videogame sellers data set (200 trees).

Figure 8 . 10 :

 810 Figure 8.10: Description of the VascuSynth data set (120 trees, left) and classification results (right).

Figure 8 . 11 :

 811 Figure 8.11: Description of the Hicks et al. data set (345 trees, left) and classification results (right).

[ 109 ]

 109 [START_REF] Faure | An algorithmic workflow for the automated processing of 3D+ time microscopy images of developing organisms and the reconstruction of their cell lineage[END_REF], 'An algorithmic workflow for the automated processing of 3D+ time microscopy images of developing organisms and the reconstruction of their cell lineage'

  23,111 unordered labeled trees are present, divided into two classes. The trees are very alike, as shown in Figure 8.13 (left), and the classification results of Figure 8.13 (right) are very similar to INEX 2005, where all weight functions behave similarly, without any advantage for the discriminance weight in terms of prediction.

Figure 8 . 12 :Figure 8 . 13 :

 812813 Figure 8.12: Description of the Faure et al. data set (300 trees, left) and classification results (right).

Figure 8 . 14 :

 814 Figure 8.14: Relative improvement 𝑅𝐼 (in percentage) of the discriminance against the best value of 𝜆 for all data sets (sorted by increasing number of trees in the training data set) and all metrics.

Figure 8 . 15 :

 815 Computation time required to compute several repetitions of the kernel on the Faure et al. data set. All those calculations have been repeated 50 times for each number of repetitions. The intercept corresponds to the DAG compression of the data set, which is independent on the number of repetitions. The blue curve is a linear fitting of all the measurement points.

[ 111 ]

 111 : Browne et al. (2012), 'A survey of Monte Carlo tree search methods' .

[ 25 ]

 25 : McKay et al. (2014), 'Practical graph isomorphism, II'

Figure 4 . 1 :

 41 Figure 4.1: A graph (left) and its reduction as a labeled tree (right). Colors have been added for better readability.

Figure 9 . 1 :

 91 Figure 9.1: Two topologically isomorphic unordered trees 𝑇 1 and 𝑇 2 and the only two possible tree isomorphisms between them (left and center); as well as the two induced bijections on labels (right), where the dotted lines interpolates the points.

Figure 9 . 2 :Figure 9 . 3 :

 9293 Figure 9.2: All possible non-isomorphic (up to a cipher) labeled trees of size at most 3. The color of nodes is their label.

∀

  (𝑢, 𝑣) ∈ 𝐷 2 , ℋ (𝑢) > ℋ (𝑣) =⇒ 𝜓(𝑢) > 𝜓(𝑣); (Equation 5.5) ∀(𝑢, 𝑣) ∈ 𝐷 2 , (ℋ (𝑢) = ℋ (𝑣)) ∧ (𝒞 𝜓 (𝑢) > lex. 𝒞 𝜓 (𝑣)) =⇒ 𝜓(𝑢) > 𝜓(𝑣). (Equation 5.6)

[ 25 ]

 25 : McKay et al. (2014), 'Practical graph isomorphism, II' .

Figure 9 . 4 :

 94 Figure 9.4: Suppose we have four classes, such that typical trees in class 1 all have ( , ) subtrees; those in class 2 have ( , ) subtrees; those in class 3 have ( , ) subtrees and those in class 4 have ( , ) subtrees. None of these four types of subtrees discriminates either by its presence, or by its absence, any of the 4 classes. On the other hand, each of the pairs of subtrees (i.e. a two element forest) discriminates by its presence the class where it appears.

[ 35 ]

 35 : Collins et al. (2001), 'Convolution kernels for natural language'

[ 113 ]

 113 : Aho et al. (1973), 'Some doubly exponential sequences'

( 1 +Remark 9 . 2

 192 𝛽(𝑢)),(9.6) with 𝛼(•) = 0 and 𝛽(•) = 1. If we resume the example of a full tree 𝑇 of height ℎ and degree 𝑑, we obtain 𝛼 ℎ = 𝑑 (𝛼 ℎ-1 + 𝛽 ℎ-1 ) ,𝛽 ℎ = (1 + 𝛽 ℎ-1 ) 𝑑 ,with 𝛼 0 = 0 and 𝛽 0 = 1. By induction on ℎ one can easily show that𝛼 ℎ = ℎ 𝑖=0 𝑑 𝑖+1 𝛽 ℎ-𝑖 .With[START_REF] Alfred | Some doubly exponential sequences[END_REF] [113]: Aho et al.(1973), 'Some doubly exponential sequences' again, 𝛽 ℎ = 𝛾 𝑑 ℎ , where 𝛾 > 1 is a constant. Equation9.5 and Equation9.6 can be directly computed on the DAG of 𝑇 since these numbers depend only on the equivalence class of the node 𝑣 ∈ 𝑇. Doing the calculation on the DAG reduces the number of recursive calls and allows to compute the quantity only once for each equivalence class.

1 .

 1 The global complexity 𝐶(Δ) of the algorithm is then𝐶(Δ) = 𝒪(#Δ) + ℋ (Δ) ℎ=0 𝒪(𝑁 𝑛 𝑔 ★ (𝑑)) + 𝒪(𝑁 𝑛) + ℎ ′ >ℎ 𝒪(𝑁 𝑑𝑛).Remark thatℋ (𝐷) ℎ=0 𝒪(𝑁 𝑛) = 𝒪(𝑁 𝑚) = 𝒪(#Δ), this leads to 𝐶(Δ) = 𝒪(#Δ𝑔 ★ (deg(𝐹))) + 𝒪 𝑁 𝑑𝑛 ℋ (𝐷) ℎ=0 ℎ ′ >ℎThe right-hand inner sum is in 𝒪(𝐻 2 ). As𝒪(𝑁 𝑑𝑛𝐻 2 ) = 𝒪(#Δ𝐻𝑑) = 𝒪(#Δ ℋ (Δ) deg(𝐹)),this leads to our statement.

[ 26 ]

 26 : Ingels et al. (2021), 'Isomorphic Unordered Labeled Trees up to Substitution Ciphering' while the last two are new material.

Lemma A. 2

 2 𝑅 𝜓•𝜙 = 𝑅 𝜓 • 𝑅 𝜙 .Proof. Let 𝑥 ∈ 𝒜(𝑇 1 ) and 𝑧 ∈ 𝒜(𝑇 3 ). It suffices to show𝑥 𝑅 𝜓•𝜙 𝑧 ⇐⇒ ∃𝑦 ∈ 𝒜(𝑇 2 ), (𝑥 𝑅 𝜙 𝑦) ∧ (𝑦 𝑅 𝜓 𝑧).( =⇒ ) There exists 𝑢 ∈ 𝑇 1 so that 𝑥 = 𝑢 and 𝑧 = (𝜓 • 𝜙)(𝑢). Let 𝑣 = 𝜙(𝑢) and 𝑦 = 𝑣; then 𝑢 𝑅 𝜙 𝑣, so 𝑥 𝑅 𝜙 𝑦; similarly 𝑣 𝑅 𝜓 𝜓(𝑣) leads to 𝑦 𝑅 𝜓 𝑧.( ⇐= ) There exists 𝑢 ∈ 𝑇 1 so that 𝑢 = 𝑥 and 𝑦 = 𝜙(𝑢). Let 𝑣 = 𝜙(𝑢). As 𝑦 𝑅 𝜓 𝜓(𝑣), then 𝜓(𝑣) = 𝑧 and it follows that 𝑥 𝑅 𝜓•𝜙 𝑧.Lemma A.3 𝑅 -1 𝜙 = 𝑅 𝜙 -1 .Proof. Let 𝑥 ∈ 𝒜(𝑇 1 ) and 𝑦 ∈ 𝒜(𝑇 2 ). It suffices to show 𝑥 𝑅 𝜙 𝑦 ⇐⇒ 𝑦 𝑅 𝜙 -1 𝑥.

𝑇 1 [

 1 𝑢]. We aim to prove that 𝑇 1 [𝑢] 𝜓 -→ 𝑇 2 [𝜙(𝑢)].

Lemma A. 4 3 Let 𝑇 1 𝜙-→ 1 𝑢 𝜙 - 1 𝑢Proposition 3 . 2 A. 3 6

 431113236 𝑥 𝑅 𝜓 𝑦 =⇒ 𝑥 𝑅 𝜙 𝑦. Proof. Let 𝑥 𝑅 𝜓 𝑦. Then, there exists 𝑤 ∈ 𝑇 1 [𝑢], such that 𝑥 = 𝑤 and 𝑦 = 𝜓(𝑤). As 𝜓 = 𝜙 on 𝑇 1 [𝑢], this implies 𝑦 = 𝜙(𝑤) and therefore 𝑥 𝑅 𝜙 𝑦. Proof of Proposition 3.𝑇 2 , and 𝑢, 𝑣 ∈ 𝑇 1 such that 𝑇 1 [𝑢] 𝜓 -→ 𝑇 1 [𝑣]. Let 𝜙 𝑢 (respectively, 𝜙 𝑣 ) be the restriction of 𝜙 to the nodes of 𝑇 1 [𝑢] (respectively, 𝑇 1 [𝑣]). The proof follows directly from the following commutative diagram:𝑇 1 [𝑢] 𝑇 1 [𝑣] 𝑇 2 [𝜙(𝑢)] 𝑇 2 [𝜙(𝑣)] 𝜓 Assumption Proposition 3.2 𝜙 𝑣 𝜙 𝑣 •𝜓•𝜙 -Proof of Theorem 3.Assume 0 ≤ ℎ ≤ ℋ (𝐷) and 𝑞 ∈ 𝐷 ℎ are fixed, where 𝐷 = ℜ(𝑇).

▶

  From lines 18 to 23, we create the new vertices in the DAG. Let us suppose 𝑃 ∈ 𝔓 and 𝑢 ∈ 𝑃 fixed. We assume that 𝑓 𝜙 was obtained, and stored, when checking 𝑇[𝑢] ∼ 𝑇[𝑠(𝑃)]. Copying it on the new arc costs # 𝒜(𝑇[𝑠(𝑃)])) -that we bound by # 𝒜(𝑇). Combining all this and summing over 𝑃 ∈ 𝔓 and 𝑢 ∈ 𝑃, and also noticing that 𝑃∈𝔓 𝑢∈𝑃 1 = #𝑇(𝑞), the overall complexity of this step is therefore 𝒪 #𝑇(𝑞)# 𝒜(𝑇) . 47: OEIS Foundation Inc. (2022), The On-Line Encyclopedia of Integer Sequences, https://oeis.org/A038156 Summing over ℎ and 𝑞 ∈ 𝐷 ℎ , the overall complexity of the algorithm is of the order of 0 ℎ=ℋ (𝐷) 𝑞∈𝐷 ℎ #𝑇(𝑞) 2 𝐶 ∼ (𝑞) + #𝑇(𝑞)#𝐴(𝑇) + 2#𝑇 . We break this sum into pieces. Note that 0 ℎ=ℋ (𝐷) 𝑞∈𝐷 ℎ #𝑇(𝑞) = #𝑇 and that 0 ℎ=ℋ (𝐷) 𝑞∈𝐷 ℎ 1 = #𝐷. ▶ Assuming that 𝑇 ′ ∈ 𝒮(𝑇) =⇒ 𝐶 ∼ ([𝑇 ′ ]) = 𝒪(𝐶 ∼ ([𝑇])), and since 𝑛 𝑛 2 ≤ ( 𝑛 𝑛) 2 for positive 𝑛's, 0 ℎ=ℋ (𝐷) 𝑞∈𝐷 ℎ #𝑇(𝑞) 2 𝐶 ∼ (𝑞) = 𝒪(𝐶 ∼ ([𝑇])#𝑇 2 ). ▶ In addition, 0 ℎ=ℋ (𝐷) 𝑞∈𝐷 ℎ (#𝑇(𝑞)# 𝒜(𝑇) + 2#𝑇) = (# 𝒜(𝑇) + 2#𝐷)#𝑇.

Finally

  , since 𝒪(1) is negligible compared to 𝒪(𝐶 ∼ ([𝑇])), and since # 𝒜(𝑇) ≤ #𝑇 and #𝐷 ≤ #𝑇, the final complexity of Algorithm 6 is 𝒪(#𝑇 2 𝐶 ∼ ([𝑇])).

[ 75 ]

 75 : Knuth (2005), The Art of Computer Programming, Volume 4, Fascicle 2: Generating All Tuples and Permutations (Art of Computer Programming)-see also OEIS sequence A03815647 :𝑎 𝑛 = 𝑛!

Figure A. 1 :

 1 Figure A.1: Backtracking tree for mapping two sets of 𝑛 = 3 objects. The mappings made at each step are indicated on the arrows. Note that the last mappings are not shown, but would be decided, within the context of bags and collections, respectively by Deduction Rule 4.1 and Deduction Rule 4.4; and therefore they can be excluded from the backtracking tree.

Lemma A. 5 1 𝑘=0( 1 𝑘=0(

 511 For any 𝑛, 𝛼 ≥ 2, 𝑓 (𝑛, 𝛼), (𝑛, 𝛼 -1), . . . , (𝑛, 1) < 𝑓 (𝛼, 1), (𝑛, 1), . . . , (𝑛, 1) 𝛼 Proof. First, we compute each of the two terms involved. ▶ A proof by induction on 𝛼 without difficulty allows to show that 𝑓 (𝑛, 𝛼), (𝑛, 𝛼 -1), . . . , (𝑛, 1) = 𝑎 𝑛 𝛼-1 𝑘=0 𝛼! (𝛼 -1 -𝑘)! (𝑛!) 𝑘 . ▶ Again, an easy calculation by induction on 𝛼 allows to show that 𝑓 (𝑛, 1), . . . , (𝑛, 1) 𝛼 = 𝑎 𝑛 𝛼-𝑛!) 𝑘 ; and thus the right-hand term equals 𝑎 𝛼 + 𝛼!𝑎 𝑛 𝛼-𝑛!) 𝑘 .

1 𝑖! , so that 𝑒 - 1 =. (A. 4 )

 114 Equation A.1, we define 𝑏 𝑛 = that 𝑎 𝑛 = 𝑛!𝑏 𝑛 . 𝑏 𝑛 converges to 𝑒 -1 ≈ 1.718 so 𝑛! ≤ 𝑎 𝑛 ≤ (𝑒 -1)𝑛!. We denote by 𝑟 𝑛 the remainder of the series (𝑏 𝑛 ), i.e. 𝑟 𝑛 = ∞ 𝑖=𝑛 𝑏 𝑛 + 𝑟 𝑛 . Finally, given 𝑘 ≥ 0, we define 𝑠 𝑛,𝑘 = 𝑏 𝑛+𝑘 -𝑏 𝑛 = Equation A.3, with the notations we have just introduced, we rewrite Δ 𝑓 as Δ 𝑓 = 𝛼𝛽𝑏 𝑛 𝑛!𝑚! 1 -Since we suppose moreover that 𝑚 = 𝑛 + 𝑘, we rewrite 𝑚 = 𝑛 + 𝑘, with 𝑘 ≥ 0, and with 𝑏 𝑛+𝑘 = 𝑏 𝑛 + 𝑠 𝑛,𝑘 , after simplifications, Δ 𝑓 = -𝛼𝛽𝑏 𝑛 𝑛!(𝑛 + 𝑘)! 1 𝛼(𝑛 + 𝑘)! + 𝑠 𝑛,𝑘 (𝛽𝑛! -1) -𝑏 𝑛 𝑏 𝑛 𝛽𝑛! Proof of Lemma A.7 With Equation A.4, Δ 𝑓 < 0 is equivalent to 1 𝛼(𝑛 + 𝑘)! + 𝑠 𝑛,𝑘 (𝛽𝑛! -1) -𝑏 𝑛 𝑏 𝑛 𝛽𝑛! > 0.

𝛽 - 1

 1 𝑛!≥ 𝑏 𝑛 ⇐⇒ 𝛽 ≥ 𝑏 𝑛 + 1𝑛! = 𝑏 𝑛+1 which holds since 𝛽 ≥ 2 ≥ 𝑒 -1 ≥ 𝑏 𝑛+1 . Proof of Lemma A.8 With Equation A.4, Δ 𝑓 > 0 is equivalent to 1 𝛼(𝑛 + 𝑘)! + 𝑠 𝑛,𝑘 (𝑛! -1) -𝑏 𝑛 𝑏 𝑛 𝑛! < 0;which, in turn, after some elementary manipulations, can be rewritten as 1𝑠 𝑛,𝑘 1 -𝑛! 𝛼(𝑛 + 𝑘)! > 𝑛! -1 𝑏 𝑛 . (A.5)

Lemma A. 10 ( 3 ! - 1 ) 1 + 1 3 𝑟 3 𝑒 - 1 -

 1031331 Equation A.6 holds for 𝑛 = 3. Proof. With 𝑛 = 3, 𝑟 3 = 𝑒 -5/2 and 𝑟 3 ≈ 0.97 < 1. Lemma A.11 Equation A.6 holds for 𝑛 ≥ 4.

Lemma A. 12

 12 𝑓 (𝑛 1 , 𝛼 1 ), . . . , (𝑛 𝑝 , 𝛼 𝑝 ) ≤ (𝑒 -1) By induction on 𝑝. 𝑓 ((𝑛, 𝛼)) = 𝛼𝑎 𝑛 ≤ (𝑒 -1)𝛼𝑛!. Let 𝑝 ≥ 2 be fixed. We have𝑓 (𝑛 1 , 𝛼 1 ), . . . , (𝑛 𝑝 , 𝛼 𝑝 ) = 𝛼 1 𝑎 𝑛 1 + 𝑛 1 ! 𝑓 (𝑛 2 , 𝛼 2 ), . . . , (𝑛 𝑝 , 𝛼 𝑝 ) ≤ (𝑒 -1)𝛼 1 𝑛 1 ! 1 +and since 𝛼 𝑖 ≥ 1, 𝑛 𝑖 ≥ 2, we have 𝑝 𝑖=2 𝛼 𝑖 𝑛 𝑖 ! ≥ 2 𝑝-1 .

Lemma A. 13 |Δ

 13 𝑓 | ∼ 𝑘→∞ (𝑒 -1)𝛼 |1 -𝛽𝑐 𝑛 | (𝑛 + 𝑘)!, where 𝑐 𝑛 ∈ (0, 1) depends only on 𝑛 and Δ 𝑓 is defined in Equation A.3Proof. We have|Δ 𝑓 | = 𝛼𝛽𝑛!(𝑛 + 𝑘)! 𝑏 𝑛 1 -1 𝛼(𝑛 + 𝑘)! -𝑏 𝑛+𝑘 1 -1 𝛽𝑛! ∼ 𝑘→∞ 𝛼𝛽𝑛!(𝑛 + 𝑘)! 𝑏 𝑛 -(𝑒 -1) 1 -1 𝛽𝑛! .Since 𝑏 𝑛 = (𝑒 -1) -𝑟 𝑛 , the term between | • | can be simplified to𝑒 -1 𝛽𝑛! -𝑟 𝑛 = 𝑒 -1 𝛽𝑛! (1 -𝛽𝑐 𝑛 ) ,where𝑐 𝑛 = 𝑛!𝑟 𝑛 𝑒 -1 ∈ (0,1). Indeed, since 𝑟 1 = 𝑒 1 and 𝑛!𝑟 𝑛 is strictly decreasing in 𝑛, 𝑛!𝑟 𝑛 ∈ (0, 𝑒 -1) Finally, |Δ 𝑓 | ∼ 𝑘→∞ (𝑒 -1)𝛼 |1 -𝛽𝑐 𝑛 | (𝑛 + 𝑘)!.

Lemma A. 14

 14 Let 𝑢, 𝑣 ∈ 𝑇 𝑖 , 𝑖 ∈ {1, 2}. One has 𝐾(𝑇 𝑢 𝑖 , 𝑇 𝑣 𝑖 ) = 𝐾(𝑇 𝑖 , 𝑇 𝑖 ) -𝑥∈ℬ 𝑢,𝑣 𝜔 𝑇 𝑖 [𝑥] + 𝐾(𝜏 ℋ (𝑢) , 𝜏 ℋ (𝑣) ), where ℬ 𝑢,𝑣 = 𝒟(𝑢) ∪ {𝑢} if 𝑢 = 𝑣, 𝔉(𝑢) ∪ 𝔉(𝑣) otherwise. (A.7)Let 𝑢 ∈ 𝑇 1 and 𝑣 ∈ 𝑇 2 . Then, 𝐾(𝑇 𝑢 1 , 𝑇 𝑣 2 ) = 𝐾(𝜏 ℋ (𝑢) , 𝜏 ℋ (𝑣) ).Proof. We begin with the case 𝑢 ≠ 𝑣. The result relies on the following decomposition, which is valid under the assumptions made on 𝑇 𝑖 and the sequence (𝜏 ℎ ),𝒮(𝑇 𝑢 𝑖 )∩𝒮(𝑇 𝑣 𝑖 ) = 𝒮(𝑇 𝑖 )\{𝑇 𝑖 [𝑧] : 𝑧 ∈ 𝔉(𝑢)∪𝔉(𝑣)} ∪ 𝒮(𝜏 ℋ (𝑢) )∩𝒮(𝜏 ℋ (𝑣)) . Together with Equation 7.4, 𝐾(𝑇 𝑢 𝑖 , 𝑇 𝑣 𝑖 ) = 𝜃∈𝒮(𝑇 𝑖 )\{𝑇 𝑖 [𝑧] : 𝑧∈𝔉(𝑢)∪𝔉(𝑣)} 𝑤 𝜃 N 𝜃 (𝑇 𝑢 𝑖 ) N 𝜃 (𝑇 𝑣 𝑖 ) + 𝜃∈𝒮(𝜏 ℋ (𝑢) )∩𝒮(𝜏 ℋ (𝑣) )

  𝜃∈𝒮(𝜏 ℋ (𝑢) )∩𝒮(𝜏 ℋ (𝑣) ) 𝑤 𝜃 N 𝜃 (𝑇 𝑢 𝑖 ) N 𝜃 (𝑇 𝑣 𝑖 ) = 𝜃∈𝒮(𝜏 ℋ (𝑢) )∩𝒮(𝜏 ℋ (𝑣) ) 𝑤 𝜃 N 𝜃 (𝜏 ℋ (𝑢) ) N 𝜃 (𝜏 ℋ (𝑣) ) = 𝐾(𝜏 ℋ (𝑢) , 𝜏 ℋ (𝑣) ), (A.8) in light of Equation 7.4 again. Furthermore, if 𝜃 ∈ 𝒮(𝑇 𝑖 ) \ {𝑇 𝑖 [𝑧] : 𝑧 ∈ 𝔉(𝑢) ∪ 𝔉(𝑣)}, then N 𝜃 (𝑇 𝑧 𝑖 ) = N 𝜃 (𝑇 𝑖 ), 𝑧 ∈ {𝑢, 𝑣}, and 𝜃∈𝒮(𝑇 𝑖 )\{𝑇 𝑖 [𝑧] : 𝑧∈𝔉(𝑢)∪𝔉(𝑣)} 𝑤 𝜃 N 𝜃 (𝑇 𝑢 𝑖 ) N 𝜃 (𝑇 𝑣 𝑖 ) = 𝜃∈𝒮(𝑇 𝑖 )\{𝑇 𝑖 [𝑧] : 𝑧∈𝔉(𝑢)∪𝔉(𝑣)} 𝑤 𝜃 N 𝜃 (𝑇 𝑖 ) N 𝜃 (𝑇 𝑖 ) = 𝜃∈𝒮(𝑇 𝑖 ) 𝑤 𝜃 N 𝜃 (𝑇 𝑖 ) N 𝜃 (𝑇 𝑖 ) -𝜃∈{𝑇 𝑖 [𝑢] : 𝑢∈𝔉(𝑣)∪𝔉(𝑤)} 𝑤 𝜃 N 𝜃 (𝑇 𝑖 ) N 𝜃 (𝑇 𝑖 ) = 𝐾(𝑇 𝑖 , 𝑇 𝑖 ) -𝜃∈{𝑇 𝑖 [𝑧] : 𝑧∈𝔉(𝑢)∪𝔉(𝑣)} 𝑤 𝜃 , (A.9) since N 𝜃 (𝑇 𝑖 ) = 1 because of the first assumption on 𝑇 𝑖 . Equation A.8 and Equation A.9 state the first result. When 𝑢 = 𝑣, the decomposition is slightly different, 𝒮(𝑇 𝑢 𝑖 ) = 𝒮(𝑇 𝑖 ) \ {𝑇 𝑖 [𝑧] : 𝑧 ∈ {𝑢} ∪ 𝒟(𝑢)} ∪ 𝒮(𝜏 ℋ (𝑢) ),

  of vertices of graph 𝐺 #𝑆 Number of elements of set 𝑆 𝒪( 𝑓 (𝑛)) Algorithm worst case time complexity is bounded by 𝑓 (𝑛), up to a multiplicative constant -where 𝑛 is the size of the input ⊥, ⊤ Respectively, logical FALSE and logical TRUE id Identity function 𝜙 Isomorphism between two graphs {𝑥 : 𝑃(𝑥)} Set of elements 𝑥 that satisfy property 𝑃(𝑥) 1 𝑃(𝑥) 1 if 𝑃(𝑥) = ⊤, 0 otherwise Isom(𝐺 1 , 𝐺 2 ) Set of all isomorphisms between graphs 𝐺 1 and 𝐺 2 ∧, ∨ Respectively, logical AND and logical OR 𝐸/ 𝑅 Quotient set of set 𝐸 by the equivalence relation 𝑅 𝐺 1 ≃ 𝐺 2 𝐺 1 and 𝐺 2 are isomorphic Nodes (trees & DAGs) [𝑣] Class of equivalence of node 𝑣 for the tree isomorphism equivalence relation 𝒞(𝑣) Children of node 𝑣 depth(𝑣) Depth of node 𝑣 𝒟(𝑣) Descendants of node 𝑣 -i.e., children of 𝑣, their children, and so on o(𝑣) Origin of node 𝑣 (in a DAG 𝐷 compressing a forest); the set of trees in the forest in which ℜ -1 (𝐷[𝑣]) appears as a subtree deg(𝑣) Degree of node 𝑣 𝑣 Label of node 𝑣 𝒫(𝑣) Parent(s) of node 𝑣 𝜋 𝑖 (𝑣) Number of times the subtree ℜ -1 (𝐷[𝑣]) appears in the tree 𝑇 𝑖 , where 𝐷 is the DAG compression of the forest containing 𝑇 𝑖 ℋ (𝑣) Height of node 𝑣 𝑇[𝑣] Subtree of 𝑇 rooted in node 𝑣 ∈ 𝑇 Trees 𝒜(𝑇) Set of labels of tree 𝑇 -also called alphabet ℒ(𝑇) Leaves of tree 𝑇 ℜ(𝑇) DAG compression of tree 𝑇, ℜ -1 stands for the inverse operator 𝒮(𝑇) Set of subtrees of tree 𝑇 ℛ(𝑇), ℛ(𝐷) Root of tree 𝑇; set of roots of DAG 𝐷 𝒯 Set of trees 𝑇 ℎ Set of nodes of 𝑇 with height ℎ

  Advanced Architecture of Catalonia (Iaac / FabLab Barcelona / Noumena),

▶ Sony Computer Science Laboratories Paris, ▶ Inria, ▶ Centre national de la recherche scientifique (CNRS / ENS Lyon), ▶ Humboldt-Universität zu Berlin, ▶ Pépinières Chatelain & Chatelain Maraîchage, ▶ France Europe Innovation.

Table 1 . 1 :

 11 Number 𝑎(𝑛) of (unlabeled, unordered, rooted) trees with 𝑛 nodes for some values of 𝑛 -sequence A000081 in The On-Line Encyclopedia of Integer Sequences (2022), https://oeis.org/ A000081.

	𝑛	𝑎(𝑛)
	1	1
	10	719
	20	12,826,228
	30 354,426,847,597

DAG compression of trees . 14 Overview

	Concerning trees 2
	2.1 Formal definition . . . . . . . . 9
	Graph vocabulary . . . . . . . . 9
	Rooted trees . . . . . . . . . . 10
	Encoding of trees . . . . . . . . 11
	Random trees . . . . . . . . . 12
	2.2 Tree isomorphisms . . . . . . 12
	Definitions . . . . . . . . . . . 12
	The Aho, Hopcroft & Ullman al-
	gorithm . . . . . . . . . . . . . . . 13
	2.3

. . . . . . . . . . . . 14 Formal definition . . . . . . . 15 Construction . . . . . . . . . .

16 2.4 DAG compression of forests . 17 Definition

. . . . . . . . . . . . . 17 DAG recompression . . . . . . 17 Connection between a forest and its compressed form . . . . . . .

[START_REF] Kubale | Graph colorings[END_REF]

  As for Algorithm 1, Algorithm 3 can take into account labeled trees (imposing label equality); once more, add the label 𝑣 as the first element of the list 𝐶 𝑣 constructed in Line 6 -but after the eventual sorting step.

	7	if 𝑇 is unordered then
	8	Sort 𝐶 𝑣

9 if 𝑓 (𝐶 𝑣 ) is defined then 10 [𝑣] ← 𝑓 (𝐶 𝑣 ) 11 else 12 𝑖 ← 𝑖 + 1 13 Define 𝑓 (𝐶 𝑣 ) = 𝑖 14 [𝑣] ← 𝑖 15 Create a new vertex 𝑖 in 𝑄 with children 𝐶 𝑣 16 return 𝑄 Remark 2.2

Algorithm 4: DagRecompression Input: Δ Result: ℜ

  . . , 𝑇 𝑛 } be the forest to be compressed, and let 𝐹 𝐷 = {𝐷 1 , . . . , 𝐷 𝑛 } be the associated DAG forest, with ℜ(𝑇 𝑖 ) = 𝐷 𝑖 . We define the degree of the forest as deg(𝐹) = max 𝑖 deg(𝐷 𝑖 ). Computing ℜ(𝑇 𝐹 ) from 𝐹 𝐷 is in two steps: (i) a construct a super DAG Δ by placing each 𝐷 𝑖 as a subDAG of an artificial root -with complexity 𝒪(deg(𝐹) 𝑖 #𝐷 𝑖 ), (𝑇 𝐹 )1 Construct, within one traversal of Δ, the mapping ℎ ↦ → Δ ℎ where Δ ℎ is the set of vertices of Δ at height ℎ

	2 for ℎ from 0 to ℋ (Δ) -1 do
			/* The only node of height ℋ (Δ) is the artificial root, which is therefore not
			considered. */
		3	Let 𝜎(ℎ) ← 𝑓 -1 ({𝑆}) : 𝑆 ∈ Im 𝑓 , # 𝑓 -1 ({𝑆}) ≥ 2 be the set of
			vertices to be merged at height ℎ, where 𝑓 : 𝑣 ∈ Δ ℎ ↦ → 𝒞(𝑣)
			/* It should be noticed that Im 𝑓 depends on whether we consider ordered or
			unordered trees. Indeed, in the ordered case, Im 𝑓 is the set of all lists of
			children; otherwise, Im 𝑓 is the set of all multisets of children. */
		4	if 𝜎(ℎ) = ∅ then
		5	Exit the for loop
		6	else
		7	for 𝑀 in 𝜎(ℎ) do
		8	Choose one element 𝑣 𝑀 in 𝑀 to remain in Δ
		9	Denote by 𝛿 𝑀 the other elements of 𝑀
	10	for 𝑣 in Δ such that ℋ (𝑣) > ℎ do
	11	for 𝑢 in 𝒞(𝑣) such that ∃ 𝑀 ∈ 𝜎(ℎ), 𝛿 𝑀 ∋ 𝑢 do
	12	Delete 𝑢 from 𝒞(𝑣)
	and (ii) recompress Δ using Algorithm 4. An illustration step by step of
	the algorithm is provided in Figure 2.10.
	Proposition 2.6 Algorithm 4 correctly computes ℜ(𝑇 𝐹 ).
	Proof. Starting from the leaves, we examine all vertices of same height
	in Δ. Those with same children 12	are merged into a single vertex. The
	algorithm stops when at some height ℎ, we can not find any vertices to be merged. Vertices that are merged in the algorithm represent isomorphic	12: The ordered or unordered nature of considered trees is significant at this point to determine whether the children are
			identical or not.

13

Add 𝑣 𝑀 in 𝒞(𝑢) 14 for 𝑀 ∈ 𝜎(ℎ)

do 15 Delete 𝛿 𝑀 from Δ 16 return Δ

3.1 Motivation . . . . . . . . . . . 23 A tale of ciphers . . . . . . . . 23 Connection with the graph iso- morphism problem . . . . . . . . 25 3.2 Formal definition . . . . . . . 25 On the number of tree isomor- phisms . . . . . . . . . . . . . . . . 25 Tree ciphering isomorphism 26 3.3 A new kind of DAG compres- sion . . . . . . . . . . . . . . . . . . 28 Intuition . . . . . . . . . . . . . 28 Definition . . . . . . . . . . . . 29 Construction . . . . . . . . . . 32

	You know me, I think there ought to be
	a big old tree right there. And let's give
	him a friend. Everybody needs a friend.
	Bob Ross
	This chapter focuses on the case of labeled trees, and in particular on
	how to define an isomorphism that takes them into account, in a way
	that is less trivial than simply imposing the equality of labels.
	Section 3.1 motivates this question from the point of view of a cipher
	problem, while making the link with graph isomorphism as defined in
	Chapter 2.
	A more formal description can be found in Section 3.2, which defines in
	particular the tree ciphering isomorphism problem. The practical resolution
	of this problem will be discussed in upcoming Chapter 4. On the other
	hand, provided with this new isomorphism, we define in Section 3.3 a
	new type of DAG compression, that takes into account the labels.
	Part of this chapter is reproduced from [26]	[26]: Ingels et al. (2021), 'Isomorphic Un-
		ordered Labeled Trees up to Substitution
		Ciphering'

  Two topologically isomorphic unordered labeled trees 𝑇 1 and 𝑇 2

					𝑇 1		𝑇 2		𝑇 1		𝑇 2
	𝑇 1		𝑇 2		𝐴		𝛼		𝐴		𝛼
	𝐴		𝛼		𝐵	𝐵	𝛽	𝛽	𝐵	𝐵	𝛽	𝛽
	𝐵	𝐵	𝛽	𝛽	𝐴	𝐶	𝛼	𝛾	𝐴	𝐶	𝛼	𝛾
	𝐴	𝐶	𝛼	𝛾	Induced cipher		Induced cipher
					𝐴	𝐵	𝐶		𝐴	𝐵	𝐶
					𝛼	𝛽	𝛾		𝛼	𝛽	𝛾
	Figure 3.3:

  1 , 𝑇 2 ). 𝜙 naturally induces a binary relation 𝑅 𝜙 over sets 𝒜(𝑇 1 ) Such a relation 𝑅 𝜙 is said to be a bijection if and only if for any 𝑥 ∈ 𝒜(𝑇 1 ), there exists a unique 𝑦 ∈ 𝒜(𝑇 2 ) so that 𝑥 𝑅 𝜙 𝑦, and conversely if for any 𝑦 ∈ 𝒜(𝑇 2 ), there exists a unique 𝑥 ∈ 𝒜(𝑇 1 ) so that 𝑥 𝑅 𝜙 𝑦. This is not the case of the relation induced by the example in Figure3.5, since 𝐶 and 𝐷 are both in relation to 𝛾, and also 𝐵 is in relation to both 𝛼 and 𝛽. 𝑅 𝜙 is a bijection, we define the function 𝑓 𝜙 : 𝒜(𝑇 1 ) → 𝒜(𝑇 2 ) by 𝑓 𝜙 (𝑥) = 𝑦 ⇐⇒ 𝑥 𝑅 𝜙 𝑦. This bijective function 𝑓 𝜙 is called a cipher13 and verifies∀𝑢 ∈ 𝑇 1 , 𝑓 𝜙 (𝑢) = 𝜙(𝑢).Let us denote by Cipher(𝑇 1 , 𝑇 2 ) the set of tree cipherings between 𝑇 1 and 𝑇 2 . If Cipher(𝑇 1 , 𝑇 2 ) is not empty, then we write 𝑇 1 ∼ 𝑇 2 and say that 𝑇 1 and 𝑇 2 are isomorphic up to a cipher, since the following result applies.

									13: Following the analogy from A tale of
									ciphers (p. 23).
						(3.4)
	Definition 3.1 𝜙 ∈ Isom(𝑇 1 , 𝑇 2 ) is said to be a tree ciphering if and only if
	𝑅 𝜙 is a bijection; in which case we denote 𝑇 1	𝜙 -→ 𝑇 2 .
	Theorem 3.1 ∼ is an equivalence relation over the set of labeled trees.
		and 𝒜(𝑇 2 ), defined as
		∀𝑥 ∈ 𝒜(𝑇 1 ), ∀𝑦 ∈ 𝒜(𝑇 2 ),
					𝑥 𝑅 𝜙 𝑦 ⇐⇒ ∃𝑢 ∈ 𝑇 1 , (𝑥 = 𝑢) ∧ (𝑦 = 𝜙(𝑢)). (3.3)
		Figure 3.5 illustrates this induced binary relation on an example.
										𝒜(𝑇 1 )	𝒜(𝑇 2 )
			𝑇 1					𝑇 2		𝐴
			𝐴					𝛼		𝛼
										𝐵
	Figure 3.5: Two topologically isomorphic unordered labeled trees (left) and the in-	𝐷	𝐶	𝐵		𝛾		𝛼	𝛾	𝐶	𝛽
	duced binary relation (right). The tree iso-									𝛾
	morphism 𝜙 is displayed through node colors.		𝐴 𝐶	𝐶	𝐵	𝛾	𝛼	𝛾	𝛽	𝐷

Whenever

  Starting from the root, 𝑠( ) = 𝑢 1 . For 𝑠( ), we can choose between 𝑢 3 and 𝑢 4 as they are both children of 𝑢 1 . Let's say 𝑠( ) = 𝑢 4 . In this case, 𝑢 5 and 𝑢 6 can no longer be chosen as representative of class , for which we can choose between 𝑢 2 , 𝑢 7 and 𝑢 8 -let's say 𝑠( ) = 𝑢 2 . 𝑞) the multiplicity of 𝑏 in 𝑆(𝑞). One arc 𝑞 → 𝑏 already exists in 𝑄(𝑇), so we add 𝑛(𝑏, 𝑞) -1 news arcs 𝑞 → 𝑏 to match the multiplicity. If 𝑇 is ordered, the arcs 𝑞 → 𝑏 must respect the order of apparition of children of 𝑠(𝑞) in 𝑇.

	Lemma 3.4 There exists a section 𝑠 of 𝑄(𝑇) that verifies
	∀𝑞 ∈ 𝑄(𝑇), ∃𝑏 ∈ 𝒫(𝑞) : 𝑠(𝑞) ∈ 𝒞(𝑠(𝑏)).	(3.5)
	Proof. Such a section can be constructed in a top-down approach. As the
	root 𝑟 = ℛ(𝑇) is unique, 𝑠([[𝑟]]) = 𝑟. Then, for any child of [[𝑟]] in 𝑄(𝑇),
	we know that there exists a corresponding child in 𝒞(𝑟). We can then
	construct 𝑠 recursively by choosing among such candidates.
	To illustrates the previous proof, let us consider the example of Figure
	3.7. In the sequel, 𝑠 is assumed to verify Equation 3.5.
	Similarly as in Section 2.3, we build a new DAG Q(𝑇) from 𝑄(𝑇). First we
	add to each vertex 𝑞 ∈ 𝑄(𝑇) the label 𝑠(𝑞). Then, we add arcs exactly as
	for ≃. We consider the multiset 𝑆(𝑞) = {[[𝑣]] : 𝑣 ∈ 𝒞(𝑠(𝑞))}, and denote
	𝑛(𝑏, Let 𝑢 ∈ 𝒞(𝑠(𝑞)), with [[𝑢]] = 𝑏. There exists 𝜙 ∈ Cipher(𝑇[𝑠(𝑏)], 𝑇[𝑢]),
	by definition, so that 𝑇[𝑠(𝑏)]
	[[𝑣]] the class of
	equivalence of 𝑣 for the ∼ equivalence relation, i.e. the set of all nodes
	𝑣 ∈ 𝑇 such that 𝑇[𝑢] ∼ 𝑇[𝑣]. As in Section 2.3, we define 𝑄(𝑇) = 𝑇/ ∼
	the quotient graph of 𝑇 by ∼, which is a DAG in virtue of Proposition
	2.4. As for ≃, we define a section 𝑠 as an injective function 𝑠 : 𝑄(𝑇) → 𝑇
	so that [[𝑠(𝑞)]] = 𝑞. However, we want to find one that respects the tree
	structure of 𝑇.

𝜙 -→ 𝑇[𝑢]

  The tree cipherings between observed nodes are displayed in red. We denote by 𝑓 = 𝑓 𝜙 , 𝑔 = 𝑓 𝜓 and ℎ = 𝑓 𝜅 the ciphers associated to each tree ciphering.

			𝑇			𝑄(𝑇)		Q(𝑇)
			𝑢 1					𝑢 1
	id	𝑢 2	𝑢 3	𝜙	𝑢 4	id	id 𝑔	𝑢 4	𝑓 ℎ	id	Figure 3.7: From left to right: a tree 𝑇, its quotient graph 𝑄(𝑇) and the unordered graph Q(𝑇). Nodes are colored following
		𝑢 5	𝑢 6	𝑢 7		𝑢 8		𝑢 2			their class of equivalence (with arbitrary labels, and with respect to ∼).
		𝜓
			𝜅

14: All leaves are isomorphic since 𝑢 ↦ → 𝑣 is necessarily a bijection.

  ). Nodes with same equivalence class (with respect to ≃) are colored accordingly.

							𝑢 0
						0
			𝑢 1							𝑢 2
			1						2
	𝑢 3			𝑢 4		𝑢 5	𝑢 6			𝑢 7		𝑢 8
	2		4		3		4		8		6
	3	4	9	16	3	4	6	8	18	32	6	8
	𝑢 9	𝑢 10	𝑢 11	𝑢 12	𝑢 13	𝑢 14	𝑢 15	𝑢 16	𝑢 17	𝑢 18	𝑢 19	𝑢 20

do 3

  be introduced later in Section 4.3, so that a node can not belong simultaneously in two different bags. We denote the set of all bags by B and by 𝜎 : 𝑇 1 ∪ 𝑇 2 → B ∪{∅} the function that associate each node to the bag it belongs to -if any.As stated earlier in Key idea of the algorihm (p. 40), whenever #𝐵 = 1, the two corresponding nodes from 𝑇 1 and 𝑇 2 must be mapped together. 𝑢 ∈ 𝑇 1 , 𝑣 ∈ 𝑇 2 , 𝜙, 𝑓 , 𝜎 1 if ExtBij( 𝑓 , 𝑢, 𝑣) and ExtBij(𝜙, 𝑢, 𝑣) then The procedure MapNodes is presented in Algorithm 7. If MapNodes returns ⊥, then we can conclude that 𝑇 1 ≁ 𝑇 2 . For instance, this can happen if we map two nodes whose topology is identical, but whose labels contradict those already mapped. As stated in Observation 4.2, once we have mapped 𝑢 and 𝑣, if their parents are not already mapped, Let 𝐶 𝑢 = 𝑤∈𝑆 𝑢 𝒞(𝑤) and 𝐶 𝑣 = 𝑤∈𝑆 𝑣 𝒞(𝑤)

	𝑢 𝐵 𝑢 return ⊤ 𝐵 1 \ 𝐵 𝑢 𝜙 𝐵 1 return MapNodes(𝒫(𝑢), 𝑣 𝐵 𝑣 𝐵 7 8 else 9 11 else 12 return ⊥	𝐵 2

and #𝐵 1 = #𝐵 2 -this number being simply denoted by #𝐵. The initialization of bags 18: If the equivalence is not true, then we can conclude that 𝑇 1 ≁ 𝑇 2 . 2 \ 𝐵 𝑣 Figure 4.2: Illustration of the SplitChildren procedure. The bag formed of 𝐵 1 and 𝐵 2 (above) is split into two bags after the mapping of 𝑢 and 𝑣, one composed of the children of 𝑢 and 𝑣, and the other with the remaining nodes (below). Note that the latter bag is eligible for Deduction Rule 4.1. Recursively, the bags of their descendants are also split. will Deduction Rule 4.1 As long as there exist bags 𝐵 ∈ B with 𝐵 = ({𝑢}, {𝑣}), call MapNodes(𝑢, 𝑣, 𝜙, 𝑓 , 𝜎) -then remove 𝐵 from B. Algorithm 7: MapNodes Input: 2 Remove 𝑢 from 𝜎(𝑢) 3 Remove 𝑣 from 𝜎(𝑣) 4 Set 𝜎(𝑢) = 𝜎(𝑣) = ∅ 5 SplitChildren({𝑢}, {𝑣}) 6 if 𝜙(𝒫(𝑢)) = 𝒫(𝑣) then 10

𝒫(𝑣), 𝜙, 𝑓 , 𝜎) they must be; and also, the respective children of 𝑢 and 𝑣 should be separated from other nodes -and recursively their children, and so onvia the SplitChildren procedure, presented in Algorithm 8. Note that, in line 4, an equivalent condition would be 𝐵 𝑣 ≠ ∅ 18 . Since the procedure performs its recursion on the children, it eventually reaches the leaves and stops. Note that if no changes are made to a bag (because there are no children or nodes other than children -see line 4), no recursive call is made on that bag. The procedure is illustrated in Figure 4.2. Algorithm 8: SplitChildren Input: 𝑆 𝑢 , 𝑆 𝑣 1 2 for 𝐵 ∈ B

  1

	𝐶	𝐴	𝐴	𝐵	𝐴
	𝑢 2	𝑢 3	𝑢 4	𝑢 5	𝑢 6
	𝐴	𝐵	𝐶
	𝑢 7	𝑢 8	𝑢 9

𝐶 𝑢

10 𝐶 𝑢 11 𝐷 𝑢 12 𝐸 𝑢 13 𝐶 𝑢 14 𝐷 𝑢 15 𝐸 𝑢 16 𝑇 1 𝛽 𝑣 1 𝛾 𝑣 2 𝛼 𝑣 3 𝛼 𝑣 4 𝛼 𝑣 5 𝛽 𝑣 6 𝛾 𝑣 7 𝛾 𝑣 8 𝛽 𝑣 9 𝛼 𝑣 10 𝛿 𝑣 11 𝛾 𝑣 12 𝜂 𝑣 13 𝜂 𝑣 14 𝛿 𝑣 15 𝛾 𝑣 16 𝑇 2

Figure 4.4: Two topologically isomorphic labeled trees 𝑇 1 (left) and 𝑇 2 (right). The color on nodes indicates the class of equivalence under ≃. The nodes have been numbered from 𝑢 1 to 𝑢 16 in 𝑇 1 (resp. from 𝑣 1 to 𝑣 16 in 𝑇 2 ) in breadth-first search order. The size of Isom(𝑇 1 , 𝑇 2 ) is equal to 𝑁 ≃ (𝑇 1 ) = (2!) 4 (3!) 2 = 576. The gray boxes indicate the only starting bag and its components; the size of the starting search space is (#𝑇 1 )! = 16! ≈ 2.09 × 10 13 .

  After partitioning by depth. Since 𝑢 1 and 𝑣 1 are the only nodes with depth zero, via Deduction Rule 4.1, we map 𝜙(𝑢 1 ) = 𝑣 1 Equivalence class We now refer to point (𝑖𝑖) of Observation 4.1, and we subdivide the bags according the equivalence class of the nodes they contain. Formally, for each bag 𝐵 = (𝐵 1 , 𝐵 2 ) in B, we define 𝐵 𝑖 (𝑐) = {𝑢 ∈ 𝐵 𝑖 : [𝑢] = 𝑐}. We add a new bag (𝐵 1 (𝑐), 𝐵 2 (𝑐)) to B for each such 𝑐, and remove 𝐵 from B. After partitioning by equivalence class. Since 𝑢 2 and 𝑣 2 are the only nodes with class and depth 1, via Deduction Rule 4.1, we map 𝜙(𝑢 2 ) = 𝑣 2 and 𝑓 (𝐶) = 𝛾. Also, since 𝑢 2 and 𝑣 2 have no children and their parents are mapped together, there is nothing more to do. The size of the current space is now (2!) 2 × 10! = 14, 515, 200.

	1 𝑢 11 𝐶 𝑇 1 𝑢 4 𝐶 𝑢 10 𝐵 𝑢 1 𝐵 𝐶 𝑢 11 𝐷 𝑢 12 𝑇 1 𝐴 𝐶 𝑢 9 𝐶 𝐴 𝑢 10 Figure 4.5: Once all bags have been partitioned, apply again Deduction Rule 4.1. 𝐶 𝑢 2 𝐴 𝑢 3 𝐵 𝑢 5 𝐴 𝑢 6 𝐴 𝑢 7 𝐵 𝑢 8 𝐷 𝑢 12 𝐸 𝑢 13 𝐶 𝑢 14 𝐷 𝑢 15 𝐸 𝑢 16 𝛽 𝑣 1 𝛾 𝑣 2 𝛼 𝑣 3 𝛼 𝑣 4 𝛼 𝑣 5 𝛽 𝑣 6 𝛾 𝑣 7 𝛾 𝑣 8 𝛽 𝑣 9 𝛼 𝑣 10 𝛿 𝑣 11 𝛾 𝑣 12 𝜂 𝑣 13 𝜂 𝑣 14 𝛿 𝑣 15 𝛾 𝑣 16 𝑇 2 Figure 4.6 presents the result of this step on the running example. 𝐶 𝐴 𝐴 𝐴 𝑢 7 𝐵 𝑢 8 𝐶 𝑢 9 𝐸 𝑢 13 𝐶 𝑢 14 𝐷 𝑢 15 𝐸 𝑢 16 𝛽 𝑣 1 𝛾 𝛼 𝛼 𝛼 𝛽 𝑢 2 𝑢 3 𝑢 4 𝑢 5 𝑢 6 𝑣 2 𝑣 3 𝑣 4 𝑣 5 𝑣 6

and 𝑓 (𝐵) = 𝛽. The children of 𝑢 1 and 𝑣 1 should be set aside from the other nodes according to the SplitChildren procedure, but they are already alone in their bag. The size of the current space is now 5! × 10! = 435, 456, 000. 𝛾 𝑣 7 𝛾 𝑣 8 𝛽 𝑣 9 𝛼 𝑣 10 𝛿 𝑣 11 𝛾 𝑣 12 𝜂 𝑣 13 𝜂 𝑣 14 𝛿 𝑣 15 𝛾 𝑣 16 𝑇 2 Figure 4.6:

  1 After partitioning by parents. The only modification happens when looking for nodes with depth 2; no further deduction is made. The size of the current space is now (2!) 2 × 4! × 6! = 69, 120.

				𝑇 1									𝛽 𝑇 2	𝑣 1
	𝐶	𝐴	𝐴			𝐵			𝐴	𝛾	𝛼		𝛼				𝛼			𝛽
	𝑢 2	𝑢 3		𝑢 4			𝑢 5			𝑢 6	𝑣 2	𝑣 3		𝑣 4				𝑣 5			𝑣 6
	𝐴	𝐵	𝐶	𝐶	𝐶	𝐷	𝐸	𝐶	𝐷	𝐸	𝛾	𝛾	𝛽	𝛼		𝛿	𝛾	𝜂	𝜂	𝛿	𝛾
	𝑢 7	𝑢 8	𝑢 9	𝑢 10	𝑢 11	𝑢 12	𝑢 13	𝑢 14	𝑢 15	𝑢 16	𝑣 7	𝑣 8	𝑣 9	𝑣 10	𝑣 11	𝑣 12	𝑣 13	𝑣 14	𝑣 15	𝑣 16
	Figure 4.7:

  [START_REF] Guédon | Pattern identification and characterization reveal permutations of organs as a key genetically controlled property of post-meristematic phyllotaxis[END_REF]

	𝐶				𝐶 ′									𝑓
			𝑛 = 2					𝑛 = 1				𝑛 = 2			𝐴	𝛼
	𝐶 1			𝐴	𝑢 4	𝐶 ′ 1	𝐴	𝑢 7	𝐵	𝑢 8	𝐶	𝑢 9	𝐶	𝑢 10	𝐵 𝐶	𝛽 𝛾
	𝐶 2	𝛼	𝑣 3	𝛼	𝑣 4	𝐶 ′ 2	𝛽	𝑣 9	𝛼	𝑣 10	𝛾	𝑣 7	𝛾	𝑣 8	𝐷 𝐸	𝛿 𝜂
		𝐶		𝐶	𝐷	𝐷		𝐸		𝐸
			𝑢 11		𝑢 14	𝑢 12	𝑢 15		𝑢 13	𝑢 16

𝛿 𝑣 11 𝛿 𝑣 15 𝛾 𝑣 12 𝛾 𝑣 16 𝜂 𝑣 13 𝜂 𝑣 14

24 :

 24 Recall, however, that in 𝑇 ′ 2 , all the labels are different, except for one which is present in double. The proportion 𝑝 shown in the figure is that of 𝑇 1 before modification.With couples (𝑇 1 , 𝑇 2 ) and (𝑇 1 , 𝑇 ′2 ) constructed as in Experimental protocol (p. 52)23 , we compared the time 𝑡 ⊤ to decide 𝑇 1 ∼ 𝑇 2 with the time 𝑡 ⊥ to decide 𝑇 1 ≁ 𝑇 ′ 2 . We actually plot, in Figure4.14, log 10 𝑡 ⊥ 𝑡 ⊤ , so that 𝑡 ⊥ is greater than 𝑡 ⊤ if and only if this number is positive.

  28: With 𝑎1• • • 𝑎 𝑘 > lex. 𝑏 1 • • • 𝑏 𝑘 if and only if either 𝑎 1 > 𝑏 1 or 𝑎 1 = 𝑏 1 and 𝑎

2

• • • 𝑎 𝑘 > lex. 𝑏 2 • • • 𝑏 𝑘 . See also A detour through formal languages (p. 66).

  Definition 5.2 A set {𝑇 1 , . . . , 𝑇 𝑛 } of trees is an irredundant forest if and only if ∀𝑖 ≠ 𝑗, 𝑇 𝑖 ∉ 𝒮(𝑇 𝑗 ).

  then 𝑤 1 < lex. 𝑤 2 if and only if ∃𝑘 ∈ [[0, 𝑝]], 𝑎 𝑖 = 𝑏 𝑖 ∀𝑖 < 𝑘 and 𝑎 𝑘 < 𝑏 𝑘 . Otherwise, let 𝑚 = min(𝑝, 𝑞); 𝑤 1 < lex. 𝑤 2 if and only if either

  Any word 𝑤 ∈ Λ 𝑤 is said to be minimal if and only if 𝑤 ∈ Λ 𝑤 but 𝑆𝐶(𝑤) ∉ Λ 𝑤 . 𝑤 as 22 > lex. 211 but 𝑆𝐶(22) = 2 < lex. 211. 𝑤 and 𝑤 share a common prefix 𝑎 0 • • • 𝑎 𝑚 -i.e. 𝑤 = 𝑎 0 • • • 𝑎 𝑚 𝑏 𝑚+1 • • • 𝑏 𝑞 , and the word 𝑎 0 • • • 𝑎 𝑚 𝑏 𝑚+1 is minimal by applying successive suffix-cut operations;

	As an example, if A = {0, 1, 2, 3}, then 𝑤 = 211 ∈ Λ, whereas 121 ∉ Λ.
	In addition, Λ 𝑤 contains words such as 31, 22, 21110, etc. 22 is a minimal
	word of Λ

5.

[START_REF] Chaudhury | Skeletonization of plant point cloud data using stochastic optimization framework[END_REF]

Let 𝑤 ∈ Λ. The language of decreasing words bounded by 𝑤 is defined as

Λ 𝑤 = {𝑤 ∈ Λ : 𝑤 > lex. 𝑤} .

Our focus is now on the construction of the minimal words of

Λ 𝑤 . Let 𝑤 = 𝑎 0 • • • 𝑎 𝑝 and 𝑤 = 𝑏 0 • • • 𝑏 𝑞 ∈ Λ 𝑤 .

Taking into account that 𝑤 > lex. 𝑤 and that they both are decreasing words, there are only two possibles cases ▶

Table 5 .

 5

			.6)
	𝒞 𝜓 1 ( ) 11 10	✓
	𝒞 𝜓 2 ( ) 00 10	✗
	𝒞 𝜓 3 ( ) 00 10	✓
	𝒞 𝜓 4 ( ) 11 10	✗
	1: Application of Equation 5.6 to
	the remaining topological orderings of
	Figure 5.6 that satisfy Equation 5.5. As
	𝒞 𝜓 ( ) = 𝒞 𝜓 ( ), we only need to con-
	sider vertices	and	. As 𝜓 𝑖 ( ) >
	𝜓 𝑖 ( ) ⇐⇒ 𝑖 ∈ {1, 2}, the only orderings
	that are kept are 𝜓 1 and 𝜓 3 .

  (𝑖) ⇐⇒ (𝑖𝑖) follows from the above discussion. (𝑖𝑖𝑖) =⇒ (𝑖) follows from the definition of ℜ. Indeed, if there were two distinct vertices (𝑢, 𝑣) ∈ 𝐷 2 with the same multiset of children, they would have been compressed as a unique vertex in the reduction. We now prove that (𝑖) =⇒ (𝑖𝑖𝑖).In the first place, if 𝐷 fulfills Equation 5.7, then 𝐷 must admit a unique leaf, denoted by ℒ(𝐷). Indeed, if there were two leaves 𝑙 1 and 𝑙 2 , we would have ℋ (𝑙 1 ) = ℋ (𝑙 2 ) = 0 but also 𝒞(𝑙 1 ) = 𝒞(𝑙 2 ) = ∅, which would violate Equation5.7. Let 𝑟 1 , . . . , 𝑟 𝑘 be the vertices in 𝐷 that have no parent. We define 𝐷 1 , . . . , 𝐷 𝑘 as the subDAG rooted respectively in 𝑟 1 , . . . , 𝑟 𝑘 . Then, we define 𝑇 𝑖 = ℜ -1 (𝐷 𝑖 ) and 𝐹 = {𝑇 1 , . . . , 𝑇 𝑘 }. The 𝑇 𝑖 's are well defined as all vertices in 𝐷 (consequently in 𝐷

	.7)
	Upcoming Theorem 5.4 establishes that a DAG compresses an irredundant
	forest if and only if the topological order constrained by Equation 5.5 and
	Equation 5.6 is unique. In other words, an unambiguous characterization
	of FDAGs is exhibited.
	Theorem 5.4 The following statements are equivalent:

(i) 𝐷 fulfills Equation 5.7, (ii) there exists a unique topological ordering 𝜓 of 𝐷 that satisfies both Equation

5

.5 and Equation

5

.6, (iii) there exists a unique irredundant forest 𝐹 ∈ ℱ -cf. Equation

5

.3such that 𝐷 = ℜ(𝐹),

where ℜ is the DAG reduction operation defined in Section 2.3.

Proof. 𝑖 ) have a different multiset of children, and therefore compress distinct subtrees -i.e. 𝐹 fulfills Equation

5

.3, therefore 𝐹 ∈ ℱ . Moreover, 𝐷 = ℜ(𝐹).

Variations on the enumeration tree . . . . . . . . . . . . . . . . . . . 81 Extension to forests with repeti- tions . . . . . . . . . . . . . . . . . . 81 Enumeration of self-nested trees . . . . . . . . . . . . . . . . . 83 Constraining the enumeration84 6.4 Enumeration of forests of sub- trees

		Enumeration of forests 6
			6.1 Exhaustive enumeration of FDAGs . . . . . . . . . . . . . . . . 72 Expansion rules . . . . . . . . 72 Analysis of the rules . . . . . 74 Enumeration tree . . . . . . . 76 6.2 Growth of the tree . . . . . . 77 Asymptotic growth . . . . . . 78 Branching factor . . . . . . . . 78 Polynomial delay . . . . . . . . 81 6.3 I'm always astonished by a forest. It makes me realise that the fantasy of nature is much larger than my own fantasy. I still have things to learn.
	2	𝑣
		𝜓(𝑣) 0 1 2	3	4	5
	2 3	𝒞 𝜓 (𝑣)	0 00 000 1 211

Figure 5.7: A FDAG 𝐷 (left) and its canonical ordering 𝜓 (right). Vertices that are at the same height are enclosed in the table between the dashed lines. . . . . . . . . . . . . . . . . . 85 Forests of subtrees . . . . . . 85 Frequent subFDAG mining problem . . . . . . . . . . . . . . . . . . 87

  [START_REF] Guédon | Pattern identification and characterization reveal permutations of organs as a key genetically controlled property of post-meristematic phyllotaxis[END_REF]. Conditional expressions applied to 𝐷 are used to determine which modification should be applied to construct 𝐷 ′ . The gray symbol (in the algorithm) next to these modifications indicates which expansion rule allows to retrieve 𝐷 from 𝐷 ′ . 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ); 𝑤 = 𝒞 𝜓 (𝑣 𝑛 ); 𝑤 ′ = 𝒞 𝜓 (𝑣 𝑛-1 )

	Algorithm 14: Antecedent
	Input: any FDAG
	via the rule	-otherwise 𝑣 𝑛 would not be alone at its height.
	Concerning	and	, let us look at the number of children of
	𝑣 𝑛 .

if 𝑣 𝑛 is the only vertex of height ℋ (𝑣 𝑛 ) then if #𝑤 = 1 then Delete vertex 𝑣 𝑛 else 𝑤 ← 𝑆𝐶(𝑤) else if 𝑤 is a minimal word of Λ 𝑤 ′ < then Delete vertex 𝑣 𝑛 else 𝑤 ← 𝑆𝐶(𝑤) /* 𝑆𝐶(•) is the suffix-cut operator defined in Equation 5.4. */ Proposition 6.3 Algorithm 14 applied to any FDAG constructs the unique antecedent of this FDAG.

Proof. Let 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ) be a FDAG. Let 𝑤 = 𝒞 𝜓 (𝑣 𝑛 ) and 𝑤 ′ = 𝒞 𝜓 (𝑣 𝑛-1 ). Two cases can occur: either (i) 𝑣 𝑛 is the only vertex at height ℋ (𝑣 𝑛 ), or (ii) it is not.

(i) It is clear in this case that 𝐷 can not be obtained from

Table 6 . 1 :

 61 Number of FDAGs accessible from 𝐷 0 in 𝑘 steps in the enumeration tree. These numbers were obtained numerically via our implementation with Python library treex.

	29: OEIS Foundation Inc. (2022), The On-
	Line Encyclopedia of Integer Sequences,
	http://oeis.org/A158691.

  The notation ℜ -1 (𝐷[𝑣]) stands for the tree compressed by 𝐷[𝑣]. The proof is in two steps. (i) Remove from 𝐷 the vertices that do not belong to 𝑉; as there are no arcs that leave 𝑉 by hypothesis, end up with a FDAG. Let us call Δ this FDAG.

(ii) Let 𝜌 be a root of Δ. By construction, 𝜌 is also a vertex in 𝐷. Among all roots of 𝐷, there exists a root 𝑟 such that 𝜌 ∈ 𝒟(𝑟). Therefore, 𝐷[𝜌] is a subDAG of 𝐷[𝑟], and then

  appear simultaneously in different 𝑇 𝑖 's. In other words, if we denote ℱ 𝑖 the set of all forests of subtrees appearing in the forest formed by {𝑇 𝑖 }, we are interested in the study of ∩ 𝑖∈𝐼 𝜎 ℱ 𝑖 where 𝐼 𝜎 ⊆ [[1, 𝑛]], such that #𝐼 𝜎 ≥ 𝜎 • 𝑛.

1. The problem we consider is the following: given a dataset of trees 𝒳 = {𝑇 1 , . . . , 𝑇 𝑛 }, account for forests of subtrees that

  Definition 7.1 A symmetric function 𝐾 : 𝒳 × 𝒳 → R is said to be a (positive semi-definite) kernel on 𝒳 if, given 𝑛 ∈ N and 𝑐 1 , . . . , 𝑐 𝑛 ∈ R, for any 𝑥 1 , . . . , 𝑥 𝑛 ∈ 𝒳.Equivalently, 𝐾 is a kernel if, for any 𝑥 1 , . . . , 𝑥 𝑛 ∈ 𝒳, the Gram matrix[START_REF] Roger | Matrix analysis[END_REF]

	𝑛	𝑛
		𝑐 𝑖 𝑐 𝑗 𝐾(𝑥 𝑖 , 𝑥 𝑗 ) ≥ 0	(7.1)
	𝑖=1	𝑗=1

[START_REF] Roger | Matrix analysis[END_REF]

: Horn et al. (

2012

), Matrix analysis expressed as 𝐾(𝑥 𝑖 , 𝑥 𝑗 ) 1≤𝑖,𝑗≤𝑛 is positive semi-definite.

  𝑖 𝐾(𝑇 𝑖 , 𝑇 𝑖 ) 2 min 𝑖 𝐶 2 Proof. The proof is based on the demonstration of [103, Theorem 1]. However, in our setting, the kernel 𝐾 is bounded by max 𝑖 𝐾(𝑇 𝑖 , 𝑇 𝑖 ) and not by 1. Consequently, by Hoeffding bounds, the sufficient size of the training data set if of order

		𝑖,ℎ	exp(2𝜌) 𝐻 2 log	2 𝛿
	2 log	2 𝛿	max 𝑖 𝐾(𝑇 𝑖 , 𝑇 𝑖 ) 2 𝛾 2	,	(

Corollary 7.

[START_REF] Chaudhury | Skeletonization of plant point cloud data using stochastic optimization framework[END_REF]

For any 0 ≤ ℎ ≤ 𝐻, a well-balanced training data set of size 2 max is sufficient so that, with probability at least 1 -𝛿, the aforementioned classification Algorithm 17 produces a classifier with error at most 1 -𝐺 𝜌 (ℎ) + 𝛿.

  Proposition 8.1 For any 𝑇 𝑖 , 𝑇 𝑗 ∈ 𝒳 train ∪ 𝒳 pred , we have 𝐾(𝑇 𝑖 , 𝑇 𝑗 ) =

	𝑣∈ℳ(𝑖,𝑗)

  They are XML documents, that we have been considering as ordered and unordered in our experiments. INEX 2005 is made of 9,630 documents arranged in 11 classes, whereas INEX 2006 has 18 classes for 12,107 documents. For INEX 2005, classes can be split into two groups of trees with similar characteristics, as shown in Figure 8.7 (left). However, 38: https://store.steampowered.com and https://www.gog.com inside each group, all trees are alike. In the case of INEX 2006, no special group seems to emerge from topological characteristics of the data, as pointed out in Figure 8.7 (right).

	2005 and 2006 These data sets originate from the INEX compe-
	tition [105]	[105]: Denoyer et al. (2007), 'Report on
		the XML mining track at INEX 2005 and
		INEX 2006: categorization and clustering
		of XML documents'

.

  In Section 7.2, we have shown on a 2-classes stochastic model that the efficiency of the subtree kernel is improved by imposing that the weight of leaves is null. As explained in Remark 7.2, we conjecture that the weight of any subtree present in two different classes should be 0. The main interest of the DAG approach developed in Kernel computation on DAGs (p. 103) is that it allows to learn the weight function from the data, as developed in Section 36 with the discriminance weight function. Our method has been implemented and tested on eight real data sets with very different characteristics that are summed up in Table8.1.

Table 8 . 1 :

 81 Summary of the 8 data sets.

	data set	Wikipedia Videogames	INEX 2005	INEX 2006	VascuSynth	Hicks et al.	Faure et al.	LOGML
	ord. / unord.	both	ord.	both	both	unord.	ord.	unord.	unord.
	labeled	✗	✓	✓	✓	✓	✗		✗	✓
	# of trees	160 -320	200	9,630 12,107	120	345		300	23,111
	# of classes	4	2	11	18	3	3		3	2
			metric, we have calculated
					𝑅𝐼 =	Metric discr -max(Metric 𝜆 ) max(Metric 𝜆 )	,
			from the average values of the different metrics. The results are presented
			in Figure

  If two trees do not have the same number of nodes, nor the same height or degree, it is immediate to determine that they are not isomorphic. This criterion offers a simple way to decide without having to deploy the full artillery of the AHU algorithm.In the same way, one can detect that two trees are not isomorphic up to a cipher simply if they do not have the same number of labels. To be more precise, and inspired by coloring refinement algorithms such as Weisfeiler-Leman[START_REF] Weisfeiler | The reduction of a graph to canonical form and the algebra which appears therein[END_REF][START_REF] Grohe | Color refinement and its applications[END_REF]

[68]: Weisfeiler et al. (1968), 'The reduction of a graph to canonical form and the algebra which appears therein' [110]: Grohe et al. (2017), 'Color refinement and its applications'

42 :

 42 Note that determining Proj F ( 𝑓 𝜙 ) is in itself an optimization problem. See below.

  1 , 𝑇 2 ), we have an associated candidate 𝑓 𝜙 . Suppose that G is an inner product space, and denote by ∥ • ∥ the (discrete) norm induced by the inner product. Let us denote by Proj F ( 𝑓 𝜙 ) the projection of 𝑓 𝜙 on F42 . Then, to 𝑓 𝜙 , we can associate ∥ 𝑓 𝜙 -Proj F ( 𝑓 𝜙 )∥. The goal is then to find 𝜙 that minimizes this quantity -that is, find 𝑓 𝜙 that is the most regular with respect to the functions of F. : Summing over 𝑢 ∈ 𝑇 1 , instead of 𝛼 ∈ 𝒜(𝑇 1 ), amounts to weighting each element 𝒜(𝑇 1 ) by its number of occurrences in 𝑇 1 . If # 𝒜(𝑇 1 ) = #𝑇 1 , the two sums are equivalent.

	least squares, finding f is equivalent to minimizing	𝑎𝑢 + 𝑏 -𝜙(𝑢)	2
						𝑢∈𝑇 1
	with respect to 𝑎, 𝑏 ∈ R 43 . In the end, we obtain the following optimization
	problem:
	min 𝜙∈Cipher(𝑇 1 ,𝑇 2 )	𝑎,𝑏∈R min	𝑢∈𝑇 1	𝑎𝑢 + 𝑏 -𝜙(𝑢)	2	.
	More generally, if we suppose that 𝒜(𝑇 2 ) is embedded in a metric space
	whose metric is denoted by 𝑑, the problem is equivalently expressed as
	min 𝜙∈Cipher(𝑇 1 ,𝑇 2 )	min 𝑓 ∈F	𝑢∈𝑇 1	𝑑 𝑓 (𝑢), 𝜙(𝑢) .	(9.1)
							Figure 3.6: A labeled tree, where the labels
							are the (𝑥, 𝑦) coordinates of each node.
							Some symmetries of the tree are high-
							lighted.

For the sake of example, suppose F = {𝑥 ↦ → 𝑎𝑥 + 𝑏 : 𝑎, 𝑏 ∈ R}. Let f = Proj F ( 𝑓 𝜙 ). To calculate f , we use the pairs 𝑢, 𝜙(𝑢) provided by 𝑓 𝜙 . By

43

Table 9 .

 9

	1: First values of the sequences
	𝑎(𝑛) and 𝑏(𝑛) counting the number of
	non-isomorphic trees of size 𝑛, respec-
	tively for tree isomorphism and tree iso-
	morphism up to a cipher. Recall that
	𝑎(𝑛) is sequence A000081 in The On-Line
	Encyclopedia of Integer Sequences (2022),

https://oeis.org/A000081.

Table 9 .

 9 1 gives the first values of 𝑎(𝑛) and 𝑏(𝑛). The values for 𝑛 = 1, 2, 3 come from Figure9.2, 𝑛 = 4 was obtained by manual counting (not reproduced here) and for 𝑛 ≥ 5 the work remains to be done -but with little hope of easily obtaining further values manually. The On-Line Encyclopedia of Integer Sequences references 20 sequences starting with 1, 2, 9, 48, none of which seem trivially related to the problem, so this is a genuine open question.

Table 9 . 2 :

 92 Comparison between the number 𝑔(𝑛) of unlabeled connected graphs with 𝑛 vertices with the number 𝑎(𝑛) of trees with 𝑛 vertices for some values of 𝑛. 𝑔(𝑛) is sequence A001349 and 𝑎(𝑛) is sequence A000081 in The On-Line Encyclopedia of Integer Sequences (2022),

	𝑛	𝑎(𝑛)	𝑔(𝑛)
	1	1	1
	5	9	21
	10	719	11,716,571
	15 87,811 31,397,381,142,761,241,960
	https://oeis.org/A001349 and https:
	//oeis.org/A000081.

  Therefore, given two DAGs 𝐷 1 and 𝐷 2 , canonically ordered, we can establish, in linear time, whether 𝐷 1 ≃ 𝐷 2 (i.e. 𝐷 1 and 𝐷 2 are isomorphic graphs) simply by checking that each vertex in order has the same ordered list of children and parents. Yet, DAG isomorphism is graph isomorphism complete[START_REF] Viktor N Zemlyachenko | Graph isomorphism problem[END_REF]

	[66]: Zemlyachenko et al. (1985), 'Graph
	isomorphism problem'

  a finite sequence of integer tuples (𝑛 𝑖 , 𝛼 𝑖 ), 𝑖 ∈ [[1, 𝑝]] with 𝑛 𝑖 ≥ 2 and 𝛼 𝑖 ≥ 1, we define the following variadic function𝑓 (𝑛 1 , 𝛼 1 ), . . . , (𝑛 𝑝 , 𝛼 𝑝 ) = 𝛼 1 𝑎 𝑛 1 if 𝑝 = 1; 𝛼 1 𝑎 𝑛 1 + 𝑛 1 ! 𝑓 (𝑛 2 , 𝛼 2 ), . . . , (𝑛 𝑝 , 𝛼 𝑝 )

	otherwise.	(A.2)

  A.15 Let 𝑥 ∈ 𝑇 𝑖 , 𝑖 ∈ {1, 2}. One has Δ 𝑖 𝑥 = 𝐾(𝑇 𝑖 , 𝑇 𝑖 ) -E 𝑢 𝑧∈ℬ 𝑥,𝑢 𝑤 𝑇 𝑖[𝑧] .Proof. In light of Lemma A.14, one hasΔ 𝑖 𝑥 = 𝐾(𝑇 𝑖 , 𝑇 𝑖 )-E 𝑢 𝑧∈ℬ 𝑥,𝑢 𝑤 𝑇 𝑖 [𝑧] +E 𝑢 𝐾(𝜏 ℋ (𝑥) , 𝜏 ℋ (𝑢) ) -E 𝑣 𝐾(𝜏 ℋ (𝑥) , 𝜏 ℋ (𝑣) ).By assumption on the stochastic model of random trees, ℋ (𝑢) and ℋ (𝑣) have the same distribution; thusE 𝑢 [𝐾(𝜏 ℋ (𝑥) , 𝜏 ℋ (𝑢) )] = E 𝑣 [𝐾(𝜏 ℋ (𝑥) , 𝜏 ℋ (𝑣) )],which states the expected result.The next decomposition is useful to prove the result of interest. If 𝑐 𝑖 ℎ denotes the number of subtrees of height ℎ appearing in 𝑇 𝑖 , ℎ ≥ 0, then the probability of picking a particular vertex 𝑢 is 𝑃 𝜌 (ℋ (𝑢))/𝑐 𝑖 ℋ (𝑢) and thusE 𝑢 𝑧∈ℬ 𝑥,𝑢 𝑤 𝑇 𝑖 [𝑧] = 𝑃 𝜌 (ℋ (𝑥))In addition, for 𝑢 ∈ 𝑇 𝑖 \ {𝑥},𝜔 𝑇 𝑖 [𝑧] = 𝐾(𝑇 𝑖 [𝑥], 𝑇 𝑖 [𝑥]), 𝑧∈ℬ 𝑥,𝑢 𝜔 𝑇 𝑖 [𝑧] = 𝐾(𝑇 𝑖 , 𝑇 𝑖 ) -𝑇 𝑖 , 𝑇 𝑖 ) -𝐾(𝑇 𝑖 [𝑥], 𝑇 𝑖 [𝑥]) + 𝜔 𝑇 𝑖 [𝑧] .The left-hand term (and the right-hand term when 𝑤 𝑇 𝑖 > 0) is null if and only if 𝑥 = ℛ(𝑇 𝑖 ), which shows the first result. In addition,

				𝑐 𝑖 ℋ (𝑥)	𝑧∈{𝑥}∪𝒟(𝑥)	𝑤 𝑇 𝑖 [𝑧] +	𝑢∈𝑇 𝑖 \{𝑥}	𝑃 𝜌 (ℋ (𝑢)) ℋ (𝑢) 𝑐 𝑖	𝑧∈ℬ 𝑥,𝑢	𝑤 𝑇 𝑖 [𝑧] .
								(A.10)
			𝑧∈{𝑥}∪𝒟(𝑥)
							𝜔 𝑇 𝑖 [𝑧] .	(A.11)
						𝑧∉𝔉(𝑥)∪𝔉(𝑢)
			Equation A.10 and Equation A.11 together with Lemma A.15 show that
	Δ 𝑖 𝑥 =	𝑃 𝜌 (ℋ (𝑥)) 𝑐 𝑖 ℋ (𝑥)	(𝐾(𝑢∈𝑇 𝑖 \{𝑥}	𝑃 𝜌 (ℋ (𝑢)) 𝑐 𝑖 ℋ (𝑢)	𝑧∉𝔉(𝑥)∪𝔉(𝑢)
			Δ 𝑖 𝑥 ≥	𝑃 𝜌 (ℋ (𝑥)) 𝑐 𝑖 ℋ (𝑥)

(𝐾(𝑇 𝑖 , 𝑇 𝑖 ) -𝐾(𝑇 𝑖 [𝑥], 𝑇 𝑖 [𝑥]) , which states the expected Equation

7

.6 with 𝑃 𝜌 (0) ≤ 𝑃 𝜌 (ℋ (𝑥)) (true if 𝜌 > 𝐻/2) and 𝑐 𝑖 ℋ (𝑥) ≤ # ℒ(𝑇 𝑖

34:The definition naturally extends to labeled trees if we impose equality of labels in the isomorphism.

⋆ ⋆ ⋆ ▲ ▲ ▲ ⋆ ⋆ ▲ ▲ ⋆ ⋆ ▲ ▲ ⋆ ⋆ ▲ ▲ ⋆ ▲ ⋆ ▲ ⋆ ▲ ⋆ ▲ ⋆ ▲ ⋆ ▲

Remerciements Bibliography

Here are the references in citation order.

By virtue of the stars and bars theorem [START_REF] Feller | An introduction to probability theory and its applications[END_REF] [94]: [START_REF] Feller | An introduction to probability theory and its applications[END_REF], An introduction to probability theory and its applications, vol 2 , for a fixed 𝑘, there are 𝑘+𝑛-1 𝑘 choices for variables 𝑥 𝑖 , and 𝑑-𝑘+𝑚 𝑑-𝑘 for variables 𝑦 𝑗 . Summing upon all values for 𝑘 proves the claim. Remark 6. 1 In the constrained enumeration proposed in [START_REF] Nakano | Efficient generation of rooted trees[END_REF] [30]: [START_REF] Nakano | Efficient generation of rooted trees[END_REF], 'Efficient generation of rooted trees' , all the trees with 𝑛 vertices are the leaves of the enumeration tree. To get all trees with 𝑛 + 1 vertices, it suffices to add to the enumeration all children of these leaves, i.e. trees obtained by adding a single vertex to them. This property -moving from one parameter value to the next by enumerating just one step further -does not hold anymore as soon as our set of constraints involve the maximum outdegree 𝑑, both for trees and FDAGs. For instance, from a FDAG of height 𝐻, one can obtain FDAG of height 𝐻 + 1 by using once and repeating up to 𝑑 -1 times.

Enumeration of forests of subtrees

Once the reverse search scheme has been set up to enumerate a certain type of structure, it is natural to move to a finer scale by using the same scheme to enumerate substructures. However, the notion of "substructure" is not obvious to derive from the main structure, as several choices are possible -e.g. for trees one can think of subtrees [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] [37]: Vishwanathan et al. ( 2004), 'Fast kernels for string and tree matching'

, subset trees [START_REF] Collins | Convolution kernels for natural language[END_REF] [35]: [START_REF] Collins | Convolution kernels for natural language[END_REF], 'Convolution kernels for natural language' , etc. From a practical point of view, the enumeration of substructures permits to solve the frequent pattern mining problem.

Forests of subtrees

In this section we define forests of subtrees, which will be our substructures. Compressed as FDAGs, these objects will be called subFDAGs. We then address the problem of enumerating all subFDAGs appearing in an FDAG 𝐷 -similar as the one of enumerating all subtrees of a tree.

Finally, with 𝑤 𝑡 = 𝜆 ℋ (𝑡) , the kernel becomes 𝐾(𝑇 1 , 𝑇 2 ) = 30

Let 𝑥, 𝑧 ∈ 𝒳, 𝑓 : 𝒳 → ℛ, 𝜑 : 𝒳 → 𝒴, 𝐾 3 a kernel on 𝒴 and 𝐵 a positive semi-definite symmetric matrix. Those are also kernels on 𝒳:

Tree kernels

To use kernel-based algorithms with tree data, one needs to design kernel functions adapted to trees. Convolution kernels, introduced by Haussler [START_REF] Haussler | Convolution kernels on discrete structures[END_REF] [34]: Haussler (1999), Convolution kernels on discrete structures , measure the similarity between two complex combinatorial objects based on the similarity of their substructures. Based on this strategy, many authors have developed convolution kernels for trees, among them the subset tree kernel [START_REF] Collins | Convolution kernels for natural language[END_REF] , the subtree kernel [START_REF] Svn Vishwanathan | Fast kernels for string and tree matching[END_REF] [37]: Vishwanathan et al. ( 2004), 'Fast kernels for string and tree matching' and the subpath kernel [START_REF] Kimura | A subpath kernel for rooted unordered trees[END_REF] [100]: [START_REF] Kimura | A subpath kernel for rooted unordered trees[END_REF], 'A subpath kernel for rooted unordered trees' .

A recent state-of-the-art on kernels for trees can be found in the thesis of Da San Martino [START_REF] Da | Kernel methods for tree structured data[END_REF] [36]: Da San Martino (2009), 'Kernel methods for tree structured data' , as well as original contributions on related topics. Let us also mention [START_REF] Shin | A Generalization of Haussler's Convolution Kernel-Mapping Kernel and Its Application to Tree Kernels[END_REF] Perspectives 9

Henry David Thoreau

In this chapter, we review what has been presented in this thesis, and provide a number of perspectives for further research.

In Section 9.1, we consider isomorphisms of labeled trees, as treated in The Tree Ciphering Isomorphism Problem. In particular, (i) we propose ways to further refine the algorithm proposed in Chapter 4; (ii) we consider whether the algorithm is suitable to address the graph isomorphism problem; and finally (iii) we introduce an optimization problem where the goal is to find a tree ciphering that optimizes a given criterion, rather than simply the first one found.

In the context of the search for frequent patterns, Section 9.2 establishes two perspectives based on the enumeration of DAGs compressing irredundant forests as developed in Enumeration Trees: from Trees to Forests: the extension to labeled DAGs, and the enumeration of (general) DAGs.

In The Subtree Kernel Revisited, we focused on convolution kernels and in particular on the subtree kernel. In Section 9.3, we introduce a new kernel based on the enumeration of forests of subtrees presented in Chapter 6; followed by a discussion of the extent to which the lessons learned from the subtree kernel would be adaptable to other kernels.

Tree isomorphisms

In Chapter 3 and Chapter 4, we focused on isomorphisms of labeled trees -where two trees are isomorphic up to a cipher if and only if they are identical up to label rewriting.

In the same way that DAG compression is derived -in Section 2.3from the usual tree isomorphism, we were able to define, from this new definition, a DAG compression of labeled trees. This compression is lossless, and we have provided Algorithm 3 which allows to build that DAG from a tree.

The algorithm to build the DAG compression of an unlabeled tree is based on AHU algorithm [START_REF] Alfred V Aho | The design and analysis of computer algorithms[END_REF] [22]: Aho et al. (1974), 'The design and analysis of computer algorithms' , that determines whether two trees are isomorphic -which is linear. Our new labeled compression algorithm is also based on an algorithm that determines whether two labeled trees are isomorphic up to a cipher. However, the latter is not linear. Indeed, determining whether two trees are isomorphic up to a cipher is as hard as determining whether two graphs are isomorphic, a problem whose complexity is assumed to be intermediate between P and NP [START_REF] Schöning | Graph isomorphism is in the low hierarchy[END_REF] [67]: [START_REF] Schöning | Graph isomorphism is in the low hierarchy[END_REF]

Katrina Mayer

A.1 Proof of Proposition 2.7

This proof is reproduced from [START_REF] Azaïs | The weight function in the subtree kernel is decisive[END_REF] [39]: Azaïs et al. (2020), 'The weight function in the subtree kernel is decisive' . We denote by 𝐷 ℎ the set of vertices at height ℎ in any DAG 𝐷, and denote by ★ ∈ {ordered, unordered} the type of trees considered.

From the forest (𝐷 1 , . . . , 𝐷 𝑁 ), we construct the DAG Δ such that (i) 𝐷 𝑖 is a subDAG of Δ for all 𝑖, (ii) ℋ (Δ) = max 𝑖 ℋ (𝐷 𝑖 ), (iii) all vertices in Δ have degree max 𝑖 deg(𝐷 𝑖 ), and (iv) at each height except 0 and ℋ (𝐷),

If Δ is placed 𝑁 times under an artificial root, and then recompressed by the algorithm, indeed the output contains the recompression of the original forest. Therefore, this case is the worst possible for the algorithm, and we claim that it achieves the proposed complexity.

Let 𝐷 be now a DAG with the following properties: #𝐷 = 𝑚, ℋ (𝐷) = 𝐻, at each height ℎ ∉ {0, 𝐻}, #𝐷 ℎ = 𝑛 (so that 𝑛(𝐻 -2) + 2 = 𝑚), and all vertices have degree 𝑑. Δ is the super-DAG obtained after placing 𝑁 copies of 𝐷 under an artificial root. We then have #Δ = 1 + 𝑁 𝑚 so that 𝒪(#Δ) = 𝒪(𝑁 𝑚) = 𝒪(𝑁 𝐻𝑛) and deg(𝐹) = deg(𝐷) = 𝑑.

At the beginning of the algorithm, constructing the mapping ℎ ↦ → Δ ℎ in one exploration of Δ has complexity 𝒪(#Δ). We will now examine the complexity of the further steps, with respect to 𝑛, 𝑚, 𝑑, 𝐻 and 𝑁. We introduce the following lemma: Lemma A. 1 Constructing 𝜎(ℎ) has complexity:

Proof. When sorting lists of size 𝐿, merge sort is known to have 𝒪(𝐿 log 𝐿) complexity in the worst case [START_REF] Steven | Sorting and searching[END_REF] [60]: Skiena (2012), 'Sorting and searching'

. Accordingly, we introduce

At height ℎ, we construct 𝜎(ℎ) = { 𝑓 -1 (𝑆) : 𝑆 ∈ Im( 𝑓 ), # 𝑓 -1 (𝑆) ≥ 2} where 𝑓 : 𝑣 ∈ Δ ℎ ↦ → 𝒞(𝑣). Finding the preimage of 𝑓 requires first to construct 𝑓 , by copying the children of each vertex in Δ ℎ (in the unordered elements, and obtain a permutation that minimizes globally 𝑓 in 𝒪(𝑝 2 ) swaps at most. Bubble sort has a bad complexity -compared to merge sort in 𝒪(𝑝 log 𝑝) [START_REF] Steven | Sorting and searching[END_REF] [60]: Skiena (2012), 'Sorting and searching'

, but it is only used here as a theoretical argument. The goal is to find a condition on the tuples to optimize 𝑓 .

After some elementary manipulations using the definition of 𝑓 in Equation A.2, Δ 𝑓 can be rewritten as

In the following we assume 𝑚 ≥ 𝑛 and we examine the implications on 𝛼, 𝛽.

Case of a tie

If 𝑚 = 𝑛, then the tuple with min(𝛼, 𝛽) must be placed first to minimize 𝑓 , by virtue of the following lemma.

Lemma A. 6 With 𝑚 = 𝑛 ≥ 2, and 𝛼, 𝛽 ≥ 1, we have

Case of 𝛽 ≥ 2 When 𝑚 > 𝑛, if 𝛽 ≥ 2, then the tuple (𝑚, 𝛼) must be processed first to minimize 𝑓 , no matter the value of 𝛼.

Proof. The proof is deferred to Remaining proofs (p. 141).

Case of 𝛽 = 1 If 𝑚 > 𝑛 and 𝛽 = 1, the tuple (𝑛, 1) must be processed before (𝑚, 𝛼) to minimize 𝑓 .

Lemma A.8 With 𝑚 > 𝑛 ≥ 2, 𝛼 ≥ 1 and 𝛽 = 1, we have Δ 𝑓 > 0.

Proof. The proof is also deferred to Remaining proofs (p. 141). It must be October, the trees are falling away and showing their true colors.

Summary The consequences of

Charmaine J Forde

This (short) chapter is dedicated to the proof of Theorem 6.5, reproduced from [START_REF] Ingels | Enumeration of Irredundant Forests[END_REF] [32]: Ingels et al. ( 2022), 'Enumeration of Irredundant Forests' , which is in two steps. First, we recall the natural bijection between FDAGs and their adjacency matrices; the latter are then put into bijection with the row-Fishburn matrices.

B.1 Equivalence between FDAGs and reduced adjacency matrices

Let 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ) be a FDAG constructed in 𝑘 steps from 𝐷 0 in the enumeration tree defined in Section 6.1. The adjacency matrix of 𝐷 is defined as 𝐴 = (𝐴 𝑖,𝑗 ) 𝑖,𝑗∈[[𝑛,0]] 2 where, if 𝑚 is the multiplicity of 𝑣 𝑗 in 𝒞(𝑣 𝑖 ), then 𝐴 𝑖,𝑗 = 𝑚 -possibly 0 if 𝑣 𝑗 ∉ 𝒞(𝑣 𝑖 ). By construction of 𝐷, as 𝑣 𝑛 is the last inserted vertex, it has no parents, so 𝐴 𝑛,• is a column of zeros; and as 𝑣 0 is a leaf, it has no children, so 𝐴 •,0 is a row of zeros. We define the reduced adjacency matrix 𝑀 as the matrix 𝐴 deprived of this column and this row. Therefore, 𝑀 = (𝐴 𝑖,𝑗 ) 𝑖∈[[𝑛,1]],𝑗∈[[𝑛-1,0]] . Naturally, one can reconstruct the adjacency matrix (and thus 𝐷) from the reduced matrix by adding a row and a column of zeros.

As a vertex can not be a parent to any vertex introduced after it, we have 𝐴 𝑖,𝑗 = 0 for all 𝑖 ≤ 𝑗 -so that 𝑀 is an upper-triangular matrix. In addition, as all vertices except 𝑣 0 have at least one child, there is at least one nonzero entry in each row of 𝑀. Therefore, 𝑀 is a row-Fishburn matrix. However, we have no guarantee that this matrix verifies size(𝑀) = 𝑘.

B.2 Reduced adjacency matrix to incremental adjacency matrix

Let 𝐷 = (𝑣 0 , . . . , 𝑣 𝑛 ) be a FDAG, and 𝑀 its reduced adjacency matrix. Let 𝑀 𝑖 be the row of 𝑀 corresponding to 𝒞 𝜓 (𝑣 𝑖 ). The incremental adjacency matrix M is defined as:

where the ⊖ operation is defined as follows: given two rows 𝑎 0 • • • 𝑎 𝑛 and 𝑏 0 • • • 𝑏 𝑛 , then denoting 𝑗 = min{𝑖 : 𝑎 𝑖 ≠ 𝑏 𝑖 }, and 𝑐 = 𝑎 𝑗 -𝑏 𝑗 ,

We claim that this new matrix M is a row-Fishburn matrix of size 𝑘, if 𝐷 ∈ 𝐸 𝑘 . Actually, since 𝑀 was already a row-Fishburn matrix, we just have to check that the size is correct. Let us consider 𝑣 𝑖 and 𝑣 𝑖+1 . The vertex 𝑣 𝑖+1 has been constructed from 𝑣 𝑖 by using either or , and potentially several after that -let us say 𝑝 ≥ 0 times. Therefore, if the claim is correct, the sum over M𝑖+1 should be exactly 𝑝 + 1. Consider the operation by which 𝑣 𝑖+1 was added in the first place:

) is reduced to a single element 𝑎, such that 𝑎 > lex. 𝒞 𝜓 (𝑣 𝑖 ). Therefore, the index 𝑗 of the first non-zero coefficient of 𝑀 𝑖+1 is ahead of the one of 𝑀 𝑖 so that the coefficient 𝑐 of ⊖ is equal to the 𝑗-th coefficient of 𝑀 𝑖+1 minus zero. Since the rule adds children to respect decreasing words, the 𝑝 extra coefficients are added to the right of the 𝑗-th coefficient (including it) and therefore they are kept unchanged by the ⊖ operation. Eventually, the sum over 𝑀 𝑖+1 is 𝑝 + 1 and so is the sum over M𝑖+1 . 𝒞 𝜓 (𝑣 𝑖+1 ) is built from 𝒞 𝜓 (𝑣 𝑖 ) with Algorithm 13, and therefore they (i) share a common prefix, possibly empty and (ii) then differ by a single letter. The index of that letter in 𝑀 𝑖+1 corresponds to the index 𝑗 defined in ⊖. Therefore, the coefficient 𝑐 is -before any -equal to one. The argument of letters being added to the right of 𝑗 still holds and therefore the sum over M𝑖+1 is also 𝑝 + 1.

To conclude the proof, we have to exhibit the inverse function of the mapping we just defined. This will prove that this mapping is indeed a bijection, and then the theorem holds.

B.3 Incremental adjacency matrix to reduced adjacency matrix

Let 𝑀 and M be constructed as before. From M, we can define a matrix 𝑀 ′ as:

where the ⊕ operation is defined as follows: given two words 𝑎 0 • • • 𝑎 𝑛 and 𝑏 0 • • • 𝑏 𝑛 , then denoting 𝑗 = min{𝑖 : 𝑏 𝑖 ≠ 0}, and 𝑐 = 𝑎 𝑗 + 𝑏 𝑗 ,

By construction, ⊕ is the inverse operation of ⊖, so that we have the following lemma: Lemma B. 1 The following properties hold:

The FDAG of Figure 5

Remark B.1

It should be noted that (general) Fishburn matrices, with at least one non-zero entry on each row and column, are in bijection with FDAGs compressing forests made of a unique tree. Indeed, via the bijection above, as such FDAG has a unique root, it must be the last inserted vertex, and therefore, each column admits at least one non-zero entry (otherwise it would be another root).

Remark B.2

It is possible to enumerate row-Fishburn matrices by using the previous bijection and the FDAGs enumeration tree together. Nevertheless, things are a little simpler in this case and the equivalent of the operations and can be merged, giving two rules for matrix expansion: