Distributed tree comparison with nodes of limited memory Emanuele G. Fusco 1 Andrzej Pelc 2 1 Computer Science Department Sapienza, University of Rome, via Salaria 113 – 00198 Rome, Italy [email protected] 2 Département d’informatique Université du Québec en Outaouais, Gatineau, Québec J8X 3X7, Canada. [email protected] SIROCCO 2010 — June 7-11 2010, Nesin Mathematics Village — Şirince, TURKEY E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Outline 1 Introduction 2 The synchronous scenario 3 The asynchronous scenario E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Comparing trees 0 2 1 1 0 2 0 0 2 0 1 0 0 0 1 0 We are given a (rooted) tree E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Comparing trees 0 2 0 1 1 2 0 0 2 0 1 0 1 0 0 1 2 0 0 2 0 1 0 2 1 0 1 0 0 0 0 0 And another one to compare to E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Comparing trees 3 2 0 3 0 1 1 2 0 0 2 0 1 0 1 0 0 1 2 0 0 2 0 1 0 2 1 0 1 0 0 0 0 0 Roots are connected by an edge E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Comparing trees 3 2 0 3 0 1 1 2 0 0 2 0 1 0 1 0 0 1 2 0 0 2 0 1 0 2 1 0 1 0 0 0 0 0 And we look for differences (in a distributed setting) E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Related work Symmetry-breaking task, closely related to leader election. Anonymous networks (or networks where node labels are not unique). Tree canonization – give a tree with port labels a unique isomorphism invariant name. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Automata and memory usage Each node is a copy of a finite state automaton A. All nodes start in the same state S0 . If the trees are isomorphic, all nodes must enter a state YES. If the trees are not isomorphic, nodes in one tree must enter a state NO0 and nodes in the other tree must enter a state NO1 , thus breaking the simmetry. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Automata and memory usage Each node is a copy of a finite state automaton A. All nodes start in the same state S0 . If the trees are isomorphic, all nodes must enter a state YES. If the trees are not isomorphic, nodes in one tree must enter a state NO0 and nodes in the other tree must enter a state NO1 , thus breaking the simmetry. The number of states of the automaton A performing the comparison gives us the measure on the memory usage. An automaton with k states requires Θ log k memory bits. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Synchronous and asynchronous communication We consider both synchronous and asynchronous communication. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Synchronous and asynchronous communication We consider both synchronous and asynchronous communication. For synchronous communication we consider memory vs time tradeoff. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Synchronous and asynchronous communication We consider both synchronous and asynchronous communication. For synchronous communication we consider memory vs time tradeoff. For asynchronous communication we consider memory vs # messages tradeoffs. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 1 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 11 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 111 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 1110 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 11101 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 111010 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 1110100 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 11101000 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 111010001 0 2 0 Distributed tree comparison with nodes of limited memory A simple code for (rooted) trees The tree 0 The code 2 1 0 0 1 1 2 0 1 0 E.Fusco and A.Pelc 0 0 2 1110100011010010 0 2 0 Distributed tree comparison with nodes of limited memory Augmenting the code The code can be augmented to handle arbitrary port labelings by inserting the value of the port number leading to the parent of each node v immediately after the 1 corresponding to the first visit of v . E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Augmenting the code The code can be augmented to handle arbitrary port labelings by inserting the value of the port number leading to the parent of each node v immediately after the 1 corresponding to the first visit of v . Proposition The length of the code B(T ) of a n-node tree T is O(n). E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory The synchronous scenario In the synchronous scenario we establish trade-offs between the memory size and the time needed to accomplish the tree comparison task. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory The synchronous scenario In the synchronous scenario we establish trade-offs between the memory size and the time needed to accomplish the tree comparison task. Theorem Let x ≥ 9 dlog ne. There exists an automaton with x bits of memory that solves the tree comparison problem in the class of all trees of size at most n and of height at most h in time O(max(h, n/x)). E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Sketch of Algorithm Sync Compare 0 0 0 3 2 0 5 E.Fusco and A.Pelc 1 2 3 2 1 1 3 1 0 1 0 9 <−1, −1, 1, 10> 2 6 1 0 8 0 0 7 1 3 1 2 0 4 0 0 5 1 2 2 0 9 <−1, −1, 1, 10> 2 6 1 0 8 0 0 7 0 0 4 Distributed tree comparison with nodes of limited memory Sketch of Algorithm Sync Compare 0 1 2 0 0 3 2 1 3 1 0 1 0 9 2 6 1 0 8 <10> 3 2 1 1 1 2 0 0 0 7 1 3 2 0 8 <10> 0 <10> 0 5 <10> E.Fusco and A.Pelc 0 4 0 5 <10> <10> 0 9 2 6 1 <10> 2 0 <10> 0 7 <10> 0 4 <10> Distributed tree comparison with nodes of limited memory Sketch of Algorithm Sync Compare 0 1 2 0 5 E.Fusco and A.Pelc 0 9 0 <1|2|10100> 0 1 7 <1|1|10100> 3 2 0 1 2 2 1 0 8 0 4 3 1 0 1 6 0 0 <1|0|10100> 3 2 1 3 2 1 1 0 5 2 0 9 0 <1|2|10100> 0 7 2 6 0 1 0 8 0 4 Distributed tree comparison with nodes of limited memory Sketch of Algorithm Sync Compare 0 1 2 0 <1|1|1|0|101000> 0 <1|0|10100> 3 2 1 0 5 E.Fusco and A.Pelc 3 1 0 1 0 9 2 6 1 0 8 0 4 3 2 1 1 1 2 2 6 0 1 0 <1|1|1|0|101000> 0 0 7 2 1 <1|1|10100> 3 2 0 0 5 0 8 0 9 0 7 0 4 Distributed tree comparison with nodes of limited memory A matching lower bound Theorem If the automaton has x bits of memory, then time Ω(max(h, n/x)) is needed to solve the tree comparison problem in the class of all trees of size at most n and of height at most h, where h > 1. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory The asynchronous scenario In the asynchronous scenario we establish trade-offs between the memory size of an automaton and the number of messages needed to accomplish the tree comparison task. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory The asynchronous scenario In the asynchronous scenario we establish trade-offs between the memory size of an automaton and the number of messages needed to accomplish the tree comparison task. Algorithm idea A token travels through the tree, by mean of message exchanges, piggybacking a code segment. When the segment is long enough (depending on the memory size of the nodes), it is sent up to the root for comparison with the corresponding segment from the other tree. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Upper and lower bounds Theorem There exists an automaton with x bits of memory that solves the tree comparison problem in the class of all trees of size at most n, using O(n2 /x) messages, for 4 dlog ne ≤ x ≤ n. Theorem If the automaton has x bits of memory, then Ω(n2 /x) messages are needed to solve the tree comparison problem in the class of all trees of size at most n. E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory Thanks! Thank you for your attention! Any questions? E.Fusco and A.Pelc Distributed tree comparison with nodes of limited memory
© Copyright 2025 Paperzz