An optimal Cellular Automata algorithm for simulating wildfire spread