1. A method for allocating spectral capacity in an optical network comprising the steps of: receiving a connection demand specifying a source node, a destination node and a capacity; routing the connection demand to define a set of links connecting the source node and the destination node; adding the connection demand to a connection demand list associated with each link in the set of links; determining a set of candidate lightpaths, where each candidate lightpath provides connectivity over one or more links belonging to the set of links; determining a set of connection demand matching lightpaths by selecting candidate lightpaths providing connectivity over an unallocated subpath, the unallocated subpath having one or more links where each link has the connection demand in the connection demand list; determining a spectral resource saving for each connection demand matching lightpath; allocating a subpath by selecting a connection demand matching lightpath based on spectral resource saving and by deleting the connection demand from the connection demand list of each link having connectivity provided by the selected connection demand matching lightpath; and if another unallocated subpath remains, repeating the steps of determining a set of connection demand matching lightpaths and allocating.