  The problem of efficiently sampling from a set of (undirected, or directed)
graphs with a given degree sequence has many applications. One approach to this
problem uses a simple Markov chain, which we call the switch chain, to perform
the sampling. The switch chain is known to be rapidly mixing for regular degree
sequences, both in the undirected and directed setting.
  We prove that the switch chain for undirected graphs is rapidly mixing for
any degree sequence with minimum degree at least 1 and with maximum degree
$d_{\max}$ which satisfies $3\leq d_{\max}\leq \frac{1}{3}\, \sqrt{M}$, where
$M$ is the sum of the degrees. The mixing time bound obtained is only a factor
$n$ larger than that established in the regular case, where $n$ is the number
of vertices. Our result covers a wide range of degree sequences, including
power-law graphs with parameter $\gamma > 5/2$ and sufficiently many edges.
  For directed degree sequences such that the switch chain is irreducible, we
prove that the switch chain is rapidly mixing when all in-degrees and
out-degrees are positive and bounded above by $\frac{1}{4}\, \sqrt{m}$, where
$m$ is the number of arcs, and not all in-degrees and out-degrees equal 1. The
mixing time bound obtained in the directed case is an order of $m^2$ larger
than that established in the regular case.
