The main objective of this paper is to propose a set of new algorithms for assigning frequency slots in the inter-stage links of the wavelength-space-wavelength switching networks used in nodes in elastic optical networks. The algorithms are based on decomposition of the set of inter-stage link frequency slots into subsets, which can be utilized for realizing conflict-free connections. Similar algorithms have previously been proposed for switching networks with two, three, or four inputs and outputs. The algorithms proposed in this paper have been adapted to work in switching networks with five inputs and outputs. These algorithms make it possible to reduce the required number of frequency slots in inter-stage links. From the comparison conducted in this work with the switching networks for three and four inputs and outputs, it follows that the new algorithms for networks with five inputs/outputs allow for a reduction in the number of frequency slots by about 20%. Additionally, the approximation of the proposed algorithms for switching networks with a larger number of inputs and outputs also leads to a reduction in the required frequency slots, compared to previously known algorithms. The proposed algorithms allow for reducing the number of frequency slots in inter-stage links, which is associated with reducing the capacity range of wavelength-selective switches and the tunability range of spectrum converters, and therefore also the costs of switching networks.