Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Mr. Tree Layout Algorithm

This project is all about developing a tree layout algorithm. We pity the fool who doesn't use Mr. Tree Layout!

This page will over time be filled with documentation written by the project team. But first, here's some general information to get you started:

Project Team
  • Sven Gundlach (sgu)
  • Sven Oliver Reimers (sor)
Project Goals

The following are our main goals for this project:

  • Develop a good, robust tree-based layout algorithm that can be published and shipped as part of our KLay library.
  • Supply good, useful documentation, both on this page (project-centric) as well as on a new page in the KIELER Wiki (user-centric).
Plug-in Namede.cau.cs.kieler.klay.tree
RepositoryKIELER Pragmatics
Branches
  • Main tree layout branch: prak/treelayout
  • Further development branches can be forked from the main tree layout branch; names should begin with prefix prak/


Page Contents

Literature

Related publications:

Architecture

Mr. Tree is structured the same as its big brother KLay Layered. It consists of layout phases, intermediate processors, and a connected components processor. The picture below describes the control flow and therefore what is done when the tree algorithm operates.

The first thing that is done is the graph import. Since the algorithm works with KIML it is necessary to import the graph that should be layouted with Mr. Tree. The important data structure (KGraph) is a comparatively complex structure. The tree algorithm does not need all parts of this data structure, so the parts that are necessary are converted into a less complex data structure, the MrTGraph data structure (TGraph), which is described through a class diagram below. As mentioned before, Mr. Tree runs on that data structure. After execution of the tree algorithm, the TGraph gets reconverted to a KGraph in a graph export phase, so that everything works fine with KIML.

The heart of Mr. Tree are the following phases. They are described in more details on this page.

The first phase is named which the comparatively unfamiliar term "treeing". "Treeing" is a word that describes a process that builds a tree out of a graph that is no tree. In other words: Mr. Tree should also operate on graphs that are no trees, but that can be converted into trees. Imagine a graph that is nearly a tree. It contains one cycle that destroys the tree property. Now the first phase should detect that cycle, destroy it by removing the edge that destroys the tree property and reinsert that edge again after the tree algorithm was able to operate on that newly build tree.

Phase 2 and 3 calculate a place for every node in the layout. In phase 2 the nodes are ordered. They ordering depends on the maximal fan-out of every node. That means that nodes with many offspring and many following levels should be placed before nodes that do not have that many offspring or following levels. This phase computes such a node ordering. Phase 3 then placed the nodes. For placing the nodes, we use the algorithm developed by Walker et al. They developed a node positioning algorithm for general trees, that calculates coordinates for each node. This coordinates depend on many factors, such as position in a tree, number of offspring/ancestors and so on. A more detailed look can be found in the paper of Walker et al. which we also referenced in the Literature Section of this page.

The last phase of Mr. Tree is a simple edge-routing that simply connects the previously placed nodes directly.

 

Features

Mr.Tree is a layout algorithm that lays out a graph in a tree layout. It contains the following features:

  • Support for connected components
  • Support for node and edge labels

Some other features that can be thought of being implemented in the future:

  • Support for graphs with cycles or other graphs that are hardly trees
  • Support for ports
  • Layout options for customizing the algorithm
  • Different kinds of tree layouts (top-down tree, left-to-right tree, radial tree...)

 

 

  • No labels