  In an $m$-edge host graph $G$, all triangles can be listed in time
$O(m^{1.5})$ [Itai, Rodeh '78], and all $k$-cycles can be listed in time
$O(m^{2-1/{\lceil k/2 \rceil}} + t)$ where $t$ is the output size [Alon,
Yuster, Zwick '97]. These classic results also hold for the colored problem
variant, where the nodes of the host graph $G$ are colored by nodes in the
pattern graph $H$, and we are only interested in subgraphs of $G$ that are
isomorphic to the pattern $H$ and respect the colors. We study the problem of
listing all $H$-subgraphs in the colored setting, for fixed pattern graphs $H$.
  As our main result, we determine all pattern graphs $H$ such that all
$H$-subgraphs can be listed in subquadratic time $O(m^{2-\varepsilon} + t)$,
where $t$ is the output size. Moreover, for each such subquadratic pattern $H$
we determine the smallest exponent $c(H)$ such that all $H$-subgraphs can be
listed in time $O(m^{c(H)} + t)$. This is a vast generalization of the classic
results on triangles and cycles.
  To prove this result, we design new listing algorithms and prove conditional
lower bounds based on standard hypotheses from fine-grained complexity theory.
In our algorithms, we use a new ingredient that we call hyper-degree splitting,
where we split tuples of nodes into high degree and low degree depending on
their number of common neighbors.
  We also show the same results for two related problems: finding an
$H$-subgraph of minimum total edge-weight in time $O(m^{c(H)})$, and
enumerating all $H$-subgraphs in $O(m^{c(H)})$ preprocessing time and constant
delay. Again we determine all pattern graphs $H$ that have complexity $c(H) <
2$, and for each such subquadratic pattern we determine the optimal complexity
$c(H)$.
