In this paper, we study how to, given a set of pre-routed requests in an all-optical network and a set of wavelengths available on each link, assign a subset of requests with maximal size such that no wavelength constraint on links is violated. While all previous studies on the wavelength assignment problem with the same objective assume the same set of wavelengths available on all links, our work does not make such an assumption. We first prove that this problem is NP-hard even in bus networks, and then propose some approximation algorithms for the problem with guaranteed performance ratios in networks with some special and general topologies.