A statistical method is proposed to modify the routing and wavelength assignment (RWA) algorithms whose optimum object is the minimum number of wavelength required (MNWR) in wavelength division multiplexing all optical network. With this statistical method, a smaller NWR can be acquired through numerical simulation. And, it is the first time that the statistical method is proposed to compare the performance of different RWA algorithms. Two RWA algorithms can be compared by contrasting the distribution of the NWRs obtained by each RWA algorithm.