Microaggregation is a well known and widely used statistical disclosure limitaton method. In the case of univariate microaggregation, there is a polynomial time algorithm that obtains optimal partitions by representing the optimal partition as a shortest path in a directed acyclic graph. Such algorithm is frequently used for obtaining optimal k-degree anonymizations of networks. Since there is a large and growing amount of information, and datasets are increasing in size and complexity, there is a need to obtain faster algorithms. Most of the times their precision is dropped for making them faster, this is not the case of our algorithm. We present a technique for obtaining optimal univariate microaggregation in such a way that the number of calculations is considerably reduced without affecting optimality. We apply this result for k-anonymization of the degree sequences of networks with a power law distribution. To show that this method increases its efficiency when increasing the size of the degree sequences, we generated discrete power law distributions for different exponents α with sizes of up to a billion vertices, and compared the reduction of the degree sequences obtained. Also we applied the method for real world networks to show its feasibility.