Some graph problems are notoriously hard. Finding the largest independent set, the smallest vertex cover, or a proper 3-coloring are all NP-hard in general â no known algorithm avoids, in the worst case, an explosion of work as the graph grows.
But there is one shape where all of these problems are easy: a tree. On a tree you can solve them by walking from the leaves up to the root, carrying a small summary at each step. No branching, no backtracking â just a single sweep.
Treewidth is the number that measures how close a graph is to being a tree. A tree has treewidth 1. A graph with a few extra edges has treewidth 2 or 3. A dense, tangled graph has high treewidth. And the punchline is that for a huge family of hard problems, the difficulty scales not with the size of the graph but with its treewidth â keep that small and the hardness melts away.
Comments
Loading comments...