The Number of Nodal Domains on Quantum Graphs as a Stability Index of Graph Partitions