1 / 21

Constant Time Generation of Trees with Specified Diameter

Constant Time Generation of Trees with Specified Diameter. Shin-ichi Nakano Takeaki Uno Gunma University,   National Institute of Japan Informatics, Japan 21/Jun/2004 WG2004. Background. Recently, Enumeration algorithms are interesting

rendor
Download Presentation

Constant Time Generation of Trees with Specified Diameter

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Constant Time Generation of Trees with Specified Diameter Shin-ichi NakanoTakeaki Uno Gunma University,   National Institute of Japan Informatics, Japan 21/Jun/2004 WG2004

  2. Background Recently, Enumeration algorithms are interesting ・There are still many unsolved nice problems (unlike to ordinal discrete algorithms) ・Recent increase of computer power makes many enumeration problems practically solvable. ⇒ many applications have been appearing, such as, genome, data mining, clustering, so on.

  3. Problem & Result Problem:enumerate all (un-rooted) trees ofnvertices anddiameterkwithout duplications (no two isomorphic trees are allowed) Result:an algorithm with time complexity: constant for each (delay:constant) space complexity: O(n) (delay: max. time between two consecutive outputs)

  4. Existing Studies R.A.Wright,B.Richmond,A.Odlyzko and B.D.McKay 1986 time complexity: constantfor each space complexity: O(n) delay:polynomial Our advantages: ・ constant delay ・ simple algorithm ・ specified diameter ・ incremental enumeration is possible (enumerate trees atmostn vertices, s.t. a tree of m vertices is outputted after outputting its subtree of m-1 vertices ) ← motivated by data mining

  5. Recent Related Researches rooted ordered trees Nakano '99 Rooted ordered trees with labels rooted (un-ordered) trees Nakano, Uno '03 Arimura, Asai, '01, etc. Rooted (un-ordered) trees with labels terminal fixed two-connected series-parallel graphs Arimura, Asai, Nakano, Uno '03, etc Kawano, Nakano '04 (un-rooted, un-ordered) trees of specified diameter trees with labels Nakano, Uno '04 this work

  6. Difficulty ・Enumeration problems are often solved by backtracking algorithm Ex. - start from a singlevertex, - add a vertex to be a leaf one-by-one, until the tree becomes n vertices and diameter k, - backtrack, and add a leaf at another position. ⇒Naturally, there occur so many duplications

  7. Enumerate Rooted Ordered Trees ・Based on backtracking algorithms ・Add a vertex to be the rightmost leaf (Add a vertex at the right side of the rightmost path) ⇒ enumerated in constant time for each ⇒ no duplication occurs

  8. Enumerate Rooted (un-ordered) Trees ・Many duplications occur, in the same way as ordered trees  ←because, many non-isomorphic rooted ordered trees correspond to the same rooted (un-ordered) tree. ・Define the canonical form among these isomorphic ordered trees ・Enumerate only rooted ordered trees of canonical forms

  9. Depth Sequence Depth sequence (of ordered tree) : pre-order of the left-first depth-first search (visiting order of depth-first search: starting from the root, visiting children from left to right) ・ Two rooted ordered trees are isomorphic ⇔ having the same depth sequence 0,1,2,3,3,2,2,1,2,3 0,1,2,2,3,3,2,1,2,3 0,1,2,3,1,2,3,3,2,2

  10. Left Heavy Embedding ・ We obtain many ordered trees from a rooted (un-ordered) tree, by giving orders of children to each vertex Left heavy embedding:lexicographically maximizer of depth sequence among them (obtained by sorting children by lexicographic order of depth sequences of their subtrees) ・Two rooted (un-ordered) trees are isomorphic ⇔left heavy embeddings are isomorphic, in terms of ordered trees 0,1,2,3,3,2,2,1,2,3 0,1,2,2,3,3,2,1,2,3 0,1,2,3,1,2,3,3,2,2

  11. Parent of Left Heavy Embedding T parent of parent parent of T Parent of left-heavy embeddingof m vertices: removal of the rightmost leaf ⇒parent is also a left-heavy embedding of m-1 vertices 0,1,2,3,3,2,1,2,3,2,1 0,1,2,3,3,2,1,2,3,2 0,1,2,3,3,2,1,2,3

  12. Family Tree of Rooted (un-ordered) Trees Parent-child relation of left-heavy embeddings

  13. Child of Left Heavy Embedding ・Any child of left-heavy embeddingis obtained by adding a vertex to be the rightmost leaf, at the level no lower than copy depth Copy depth : deepest level s.t. left-heavy condition is not violated by adding the rightmost leaf on the level. ・ Copy depth can be updated in constant time ⇒Enumeration can be done in constant time for each T parent of parent parent of T

  14. Enumerate Un-rooted Trees ・An un-rooted tree has no root, so depth sequence is not defined   ⇒ define the root by its center(s) Center: vertex minimizing the distance to the furthest leaf ・The diameter is even ⇒ the center is unique ・We consider the case of even diameter

  15. Parent of Left Heavy Embedding Parentof a left-heavy embedding of m vertices and diameter k:   removal of the rightmost leaf, removal of the second rightmost leaf if its diameter changes ⇒Parent is a left-heavy embedding of m-1vertices and diameter k ・ Diameter changes ⇒ rightmost leaf ∈ leftmost spine (longest path) ・ Leftmost spine does not change by removing the leaf ⇒parent and child shares leftmost spine ⇒constant time for each tree of at most n vertices diameter k parent of parent T parent

  16. Family Tree of (Un-rooted)Trees diameter 4

  17. Generating Only Trees of n Vertices Active leaf: rightmost leaf s.t. not a child of rootand whose removal does not change the diameter Parentof a left-heavy embedding of n vertices and diameter k :   remove active leaf and add a leaf to the root ⇒also a left-heavy embedding of nvertices and diameter k parent of parent T parent

  18. Family Tree of Trees of n Vertices 7vertices diameter4

  19. Constant Delay Recursion structure ・Output before recursive calls in odd levels Output after recursive calls in even levels At least one iteration in consecutive three iterations

  20. Odd Diameter ・ There are always two centers Similar algorithm by considering two centers as the single root vertex (the order of children of the root has to be an exception)

  21. Conclusion ・Proposed an algorithm for enumerating un-rooted trees of n vertices and diameterk ・Time complexity is constant for each, and delay is also constant Future work: ・ Enumeration of plane trees, plane graphs, and other classes of graphs with simple ideas

More Related