LCA reference →

https://github.com/hamza-mughees/Lowest-Common-Ancestor-Python

Apply the idea of k nearest neighbours here

maintain a min threshold of k, say k = 1 and k = 1 * 5 in worst case, then get the k nearest such that they are multiples of k, and for each generalise it

The conditions are assume an upper and lower bound on k, i.e the multiples of k that are used

This also maintains optimal categorisation of the records

Then run the k nearest for each record in such a way that the least can be k and the max can be n * k, where n * k can be the max elements that can be in one class and then use the nearest neighbours concept to group the elements

L-diversity may or may not be achieved, can be achieved with tweaks in the code

Imagine it to be a 4 dimensional space, u are getting the values closest to each other and then making the eq classes such that the k-anonymity and l-diversity is achieved

For numeric attributes the class will be between the minimum and maximum values

For the categorical attributes, the values will be the lowest common ancestor in the tree

The chance of temporal attack can be minimized