  Measurement incompatibility is the most basic resource that distinguishes
quantum from classical physics. Contextuality is the critical resource behind
the power of some models of quantum computation and is also a necessary
ingredient for many applications in quantum information. A fundamental problem
is thus identifying when incompatibility produces contextuality. Here, we show
that, given a structure of incompatibility characterized by a graph in which
nonadjacent vertices represent incompatible ideal measurements, the necessary
and sufficient condition for the existence of a quantum realization producing
contextuality is that this graph contains induced cycles of size larger than
three.
