Optimal data structure for the Breath First Search algorithm in graphs