A computer-implemented method of spectrum defragmentation in an optical network (100, 300, 400), the method comprising: selecting one of a plurality of frequency slots (320, 322, 324, 326, 328, 330, 332, 334, 336, 338) as a selected frequency slot and another of the frequency slots as an end frequency slot, the frequency slots (320, 322, 324, 326, 328, 330, 332, 334, 336, 338) each spanning a portion of an optical spectrum (200, 302) of an optical network (100, 300, 400); assigning each of a plurality of optical signals (350, 352, 354, 356) within the optical network (100, 300, 400) to one or more of the frequency slots (320, 322, 324, 326, 328, 330, 332, 334, 336, 338); constructing a frequency slot dependency map based on the assignation of the optical signals (350, 352, 354, 356) to their respective frequency slots, wherein a first optical signal of the plurality of optical signals (350, 352, 354, 356) that is assigned to a first set of the frequency slots (326, 328) is associated with a second optical signal of the plurality of optical signals (350, 352, 354, 356) that is assigned to a second set of the frequency slots (320, 322, 324) based on the second set of the frequency slots (320, 322, 324) being between the first set of the frequency slots (326, 328) 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 (320, 322, 324); and a third optical signal of the plurality of optical signals (350, 352, 354, 356) that is assigned to a third set of the frequency slots (330, 332) is associated with the first optical signal based on the first set of the frequency slots (326, 328) being between the third set of the frequency slots (330, 332) 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 (326, 328); 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 (320, 322, 324) 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 (320, 322, 324, 326, 328, 330, 332, 334, 336, 338) as a selected frequency slot and another of the frequency slots as an end frequency slot, the frequency slots (320, 322, 324, 326, 328, 330, 332, 334, 336, 338) each spanning a portion of an optical spectrum (200, 302) of an optical network (100, 300, 400); assigning each of a plurality of optical signals (350, 352, 354, 356) within the optical network (100, 300, 400) to one or more of the frequency slots (320, 322, 324, 326, 328, 330, 332, 334, 336, 338); constructing a frequency slot dependency map based on the assignation of the optical signals (350, 352, 354, 356) to their respective frequency slots, wherein a first optical signal of the plurality of optical signals (350, 352, 354, 356) that is assigned to a first set of the frequency slots (326, 328) is associated with a second optical signal of the plurality of optical signals (350, 352, 354, 356) that is assigned to a second set of the frequency slots (320, 322, 324) based on the second set of the frequency slots (320, 322, 324) being between the first set of the frequency slots (326, 328) 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 (320, 322, 324); and a third optical signal of the plurality of optical signals (350, 352, 354, 356) that is assigned to a third set of the frequency slots (330, 332) is associated with the first optical signal based on the first set of the frequency slots (326, 328) being between the third set of the frequency slots (330, 332) 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 (326, 328); 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 (320, 322, 324) based on the association of the first and second optical signals in the frequency slot dependency map.