  We study two notions of being well-structured for classes of graphs that are
inspired by classic model theory. A class of graphs $C$ is monadically stable
if it is impossible to define arbitrarily long linear orders in vertex-colored
graphs from $C$ using a fixed first-order formula. Similarly, monadic
dependence corresponds to the impossibility of defining all graphs in this way.
Examples of monadically stable graph classes are nowhere dense classes, which
provide a robust theory of sparsity. Examples of monadically dependent classes
are classes of bounded rankwidth (or equivalently, bounded cliquewidth), which
can be seen as a dense analog of classes of bounded treewidth. Thus, monadic
stability and monadic dependence extend classical structural notions for graphs
by viewing them in a wider, model-theoretical context. We explore this emerging
theory by proving the following:
  - A class of graphs $C$ is a first-order transduction of a class with bounded
treewidth if and only if $C$ has bounded rankwidth and a stable edge relation
(i.e. graphs from $C$ exclude some half-graph as a semi-induced subgraph).
  - If a class of graphs $C$ is monadically dependent and not monadically
stable, then $C$ has in fact an unstable edge relation.
  As a consequence, we show that classes with bounded rankwidth excluding some
half-graph as a semi-induced subgraph are linearly $\chi$-bounded. Our proofs
are effective and lead to polynomial time algorithms.
