1. A method of assigning spectrum and selecting a route for a connection between a source node and a destination node within an optical network, wherein a plurality of optical links connect the source node with the destination node, said method comprising: determining a spectrum demand for the connection; for each optical link, identifying, by a Path Computation Element, one or more potential spectrum allocations for the connection, each of the one or more potential spectrum allocations having a width equal to the spectrum demand, wherein each of said potential spectrum allocations starts with either a starting frequency of an optical band assigned to the optical network or an end of a previously allocated spectrum; for each potential spectrum allocation, determining, by the Path Computation Element, a corresponding set of available optical links to obtain a residual graph that represents the residual capacity on each of the set of available optical links; generating an auxiliary graph based on the residual graphs, wherein the auxiliary graph comprises one or more layers with each layer corresponding to a respective residual graph; among all routes represented by the residual graphs, identifying one or more feasible routes that connect the source node and the destination node; and selecting a route among the one or more feasible routes based on the auxiliary graph.