A method for allocating spectral capacity in a WDM optical network comprising a plurality of optical switching nodes connected by a plurality of optical links, characterized in that the method comprises: - providing a group of connection demands, a connection demand comprising a source node, a destination node and a capacity which needs to be transmitted between the source node to the destination node, - defining a group of candidate lightpaths within the optical network, a candidate lightpath comprising an ingress node, an egress node and a sequence of one or more optical links (TL1, TL2, TL3, TL4, TL5, TL6) that are adapted to carry an optical signal transparently from the ingress node to the egress node, - defining a highest admissible spectral efficiency for each candidate lightpath, - computing a respective spatial path for a subset of the connection demands as a function of an available spectral capacity of the optical links and under the assumption that the connection demands are fulfilled using a reference spectral efficiency, - for each candidate lightpath-, determining the connection demands of the subset of connection demands that match the candidate lightpath-, wherein a matching connection demand has a spatial path that includes the whole sequence of one or more links of the candidate lightpath-, and computing a spectral resource saving of the candidate lightpath as a function of the difference between the spectral resources that would be used for the total capacity of the matching connection demands of the candidate lightpath by using the highest admissible spectral efficiency of the candidate lightpath and the spectral resources that would be used for the total capacity of the matching connection demands of the candidate lightpath by using the reference spectral efficiency, - selecting the candidate lightpath having the highest admissible spectral resource saving as a lightpath to be established and allocating spectral resources to the selected candidate lightpath as a function of the total capacity of the matching connection demands and the highest admissible spectral efficiency of the selected candidate lightpath, - removing the selected candidate lightpath from the group of candidate lightpaths and iterating to the step of determining the matching connection demands for the remaining candidate lightpaths. - providing a group of connection demands, a connection demand comprising a source node, a destination node and a capacity which needs to be transmitted between the source node to the destination node, - defining a group of candidate lightpaths within the optical network, a candidate lightpath comprising an ingress node, an egress node and a sequence of one or more optical links (TL1, TL2, TL3, TL4, TL5, TL6) that are adapted to carry an optical signal transparently from the ingress node to the egress node, - defining a highest admissible spectral efficiency for each candidate lightpath, - computing a respective spatial path for a subset of the connection demands as a function of an available spectral capacity of the optical links and under the assumption that the connection demands are fulfilled using a reference spectral efficiency, - for each candidate lightpath-, determining the connection demands of the subset of connection demands that match the candidate lightpath-, wherein a matching connection demand has a spatial path that includes the whole sequence of one or more links of the candidate lightpath-, and computing a spectral resource saving of the candidate lightpath as a function of the difference between the spectral resources that would be used for the total capacity of the matching connection demands of the candidate lightpath by using the highest admissible spectral efficiency of the candidate lightpath and the spectral resources that would be used for the total capacity of the matching connection demands of the candidate lightpath by using the reference spectral efficiency, - selecting the candidate lightpath having the highest admissible spectral resource saving as a lightpath to be established and allocating spectral resources to the selected candidate lightpath as a function of the total capacity of the matching connection demands and the highest admissible spectral efficiency of the selected candidate lightpath, - removing the selected candidate lightpath from the group of candidate lightpaths and iterating to the step of determining the matching connection demands for the remaining candidate lightpaths.