Graph test of controllability in qubit arrays: a systematic way to determine the minimum number of external controls