  Tangles of graphs have been introduced by Robertson and Seymour in the
context of their graph minor theory. Tangles may be viewed as describing
"k-connected components" of a graph (though in a twisted way). They play an
important role in graph minor theory. An interesting aspect of tangles is that
they cannot only be defined for graphs, but more generally for arbitrary
connectivity functions (that is, integer-valued submodular and symmetric set
functions).
  However, tangles are difficult to deal with algorithmically. To start with,
it is unclear how to represent them, because they are families of separations
and as such may be exponentially large. Our first contribution is a data
structure for representing and accessing all tangles of a graph up to some
fixed order.
  Using this data structure, we can prove an algorithmic version of a very
general structure theorem due to Carmesin, Diestel, Harman and Hundertmark (for
graphs) and Hundertmark (for arbitrary connectivity functions) that yields a
canonical tree decomposition whose parts correspond to the maximal tangles.
(This may be viewed as a generalisation of the decomposition of a graph into
its 3-connected components.)
