The phenomenon where an undesirable nonlinear effect gives significantly degraded system performance, and becomes the major drawback for optical communication systems is known as Four wave mixing. In order to achieve affordable BER and Q-factor, a comparison of a WDM system with equal and unequal channel spacing is performed. The result of the channel spacing can be verified using opt-sim. A channel allocation method, based on the optimal Golomb ruler, that allows the reduction of FWM effect while maintaining bandwidth efficiency, is presented. The two algorithms i.e. Exhaust algorithm and Search algorithm to construct the Golomb ruler sequences are presented here. The result of these two algorithms is compared using Matlab.