A computer-implemented method of spectrum defragmentation in an optical network , the method comprising: selecting one of a plurality of frequency slots as a selected frequency slot and another of the frequency slots as an end frequency slot , the frequency slots each spanning a portion of an optical spectrum of an optical network ; assigning each of a plurality of optical signals within the optical network to one or more of the frequency slots ; constructing a frequency slot dependency map based on the assignation of the optical signals to their respective frequency slots, wherein a first optical signal of the plurality of optical signals that is assigned to a first set of the frequency slots is associated with a second optical signal of the plurality of optical signals that is assigned to a second set of the frequency slots based on the second set of the frequency slots being between the first set of the frequency slots and the selected frequency slot such that the second optical signal prevents the first optical signal from occupying the second set of the frequency slots ; and a third optical signal of the plurality of optical signals that is assigned to a third set of the frequency slots is associated with the first optical signal based on the first set of the frequency slots being between the third set of the frequency slots and the selected frequency slot such that the first optical signal prevents the third optical signal from occupying the first set of the frequency slots ; identifying a release of the second optical signal ; and in response to the release of the second optical signal , reassigning the first optical signal associated with the released second optical signal to one or more of the frequency slots of the second set of the frequency slots based on the association of the first and second optical signals in the frequency slot dependency map. selecting one of a plurality of frequency slots as a selected frequency slot and another of the frequency slots as an end frequency slot , the frequency slots each spanning a portion of an optical spectrum of an optical network ; assigning each of a plurality of optical signals within the optical network to one or more of the frequency slots ; constructing a frequency slot dependency map based on the assignation of the optical signals to their respective frequency slots, wherein a first optical signal of the plurality of optical signals that is assigned to a first set of the frequency slots is associated with a second optical signal of the plurality of optical signals that is assigned to a second set of the frequency slots based on the second set of the frequency slots being between the first set of the frequency slots and the selected frequency slot such that the second optical signal prevents the first optical signal from occupying the second set of the frequency slots ; and a third optical signal of the plurality of optical signals that is assigned to a third set of the frequency slots is associated with the first optical signal based on the first set of the frequency slots being between the third set of the frequency slots and the selected frequency slot such that the first optical signal prevents the third optical signal from occupying the first set of the frequency slots ; identifying a release of the second optical signal ; and in response to the release of the second optical signal , reassigning the first optical signal associated with the released second optical signal to one or more of the frequency slots of the second set of the frequency slots based on the association of the first and second optical signals in the frequency slot dependency map. <EOS>