  We show how to prepare any graph state of up to 12 qubits with: (a) the
minimum number of controlled-Z gates, and (b) the minimum preparation depth. We
assume only one-qubit and controlled-Z gates. The method exploits the fact that
any graph state belongs to an equivalence class under local Clifford
operations. We extend up to 12 qubits the classification of graph states
according to their entanglement properties, and identify each class using only
a reduced set of invariants. For any state, we provide a circuit with both
properties (a) and (b), if it does exist, or, if it does not, one circuit with
property (a) and one with property (b), including the explicit one-qubit gates
needed.
