The nearest colored node in a tree

Paweł Gawrychowski, Gad M. Landau, Shay Mozes, Oren Weimann

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

We start a systematic study of data structures for the nearest colored node problem on trees. Given a tree with colored nodes and weighted edges, we want to answer queries (v, c) asking for the nearest node to node v that has color c. This is a natural generalization of the well-known nearest marked ancestor problem. We give an O(n)-space O(log log n)-query solution and show that this is optimal. We also consider the dynamic case where updates can change a node's color and show that in O(n) space we can support both updates and queries in O(log n) time. We complement this by showing that O(polylog n) update time implies Ω(log n/log log n) query time. Finally, we consider the case where updates can change the edges of the tree (link-cut operations). There is a known (top-tree based) solution that requires update time that is roughly linear in the number of colors. We show that this solution is probably optimal by showing that a strictly sublinear update time implies a strictly subcubic time algorithm for the classical all pairs shortest paths problem on a general graph. We also consider versions where the tree is rooted, and the query asks for the nearest ancestor/descendant of node v that has color c, and present efficient data structures for both variants in the static and the dynamic setting.

Original languageEnglish
Title of host publication27th Annual Symposium on Combinatorial Pattern Matching, CPM 2016
EditorsRoberto Grossi, Moshe Lewenstein
PublisherSchloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
Pages25.1-25.12
ISBN (Electronic)9783959770125
DOIs
StatePublished - 1 Jun 2016
Event27th Annual Symposium on Combinatorial Pattern Matching, CPM 2016 - Tel Aviv, Israel
Duration: 27 Jun 201629 Jun 2016

Publication series

NameLeibniz International Proceedings in Informatics, LIPIcs
Volume54
ISSN (Print)1868-8969

Conference

Conference27th Annual Symposium on Combinatorial Pattern Matching, CPM 2016
Country/TerritoryIsrael
CityTel Aviv
Period27/06/1629/06/16

Bibliographical note

Funding Information:
Partially supported by the National Science Foundation Award 0904246, Israel Science Foundation grant 571/14, Grant No. 2008217 from the United States-Israel Binational Science Foundation (BSF) and DFG. Partially supported by Israel Science Foundation grant 794/13.

Publisher Copyright:
© Paweł Gawrychowski, Gad M. Landau, Shay Mozes, and Oren Weimann.

Keywords

  • Marked ancestor
  • Nearest colored descendant
  • Top-trees
  • Vertex-label distance oracles

ASJC Scopus subject areas

  • Software

Fingerprint

Dive into the research topics of 'The nearest colored node in a tree'. Together they form a unique fingerprint.

Cite this