wild-inter.net

Tree decompositions  ·  treewidth, separators, and dynamic programming

A tree decomposition covers a graph by bags of vertices arranged in a tree. Every bag, and every intersection of two adjacent bags, is a separator: what lies on one side of it in the tree cannot touch what lies on the other side in the graph. Small bags therefore mean small separators everywhere, and that is exactly what dynamic programming needs: the table at a bag is the complete interface between the part of the graph already solved and the rest. Hover a vertex to see every bag containing it; hover a bag to see its vertices; click to keep the highlight. The buttons on each drawing zoom, move vertices or bags by dragging, and lock the view.

Arrow keys step through the three conditions.
Walk starts at Click a tree edge or a bag to jump to its separator.
Order
Algorithm Problem Detail
— / — Delay 700ms
Graph G
Tree decomposition
What just happened
Definition
Input
The graph-editor format: the number of vertices V, the number of edges E, then E lines v w (a third number on an edge line, a weight, is ignored), then optionally V lines x y with the drawing (any scale, y pointing down). Vertices are 0 … V−1; lines starting with # are ignored. Without coordinates the graph is laid out automatically.

Two optional additions after that: weights w0 … wV−1 on one line gives the vertex weights for the independent-set problem (default 1), and a block TD b followed by b lines, one bag each (its vertices; - for an empty bag), and b−1 lines s t, the tree edges between bags 0 … b−1, fixes the tree decomposition. Bag 0 is the root. Without a TD block the page computes one: an optimal decomposition from an exact treewidth computation for up to 18 vertices, otherwise one from the minimum-fill-in elimination ordering.

A decomposition is allowed to be invalid: the Definition tab then shows which of the three conditions fail. The other tabs need a valid one.