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.
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.
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.