LuckPerms

LuckPerms

41.4k Downloads

Add support for topological sorts

Katrix opened this issue ยท 1 comments

commented

Description

I would love to have some proper topological sorts in LP, so that I can ensure that before a group is processed, all the things inheriting from it has already been processed.

Proposed Behaviour

Two new options for inheritance-traversal-algorithm. "Reversed-dfs-post" which does a DFS-post sort, and reverses the order, and "khan" which performs Khan's algorithm.

Extra Details

https://en.wikipedia.org/wiki/Topological_sorting

commented

Sounds reasonable :)

Just needs a new entry in this enum: https://github.com/LuckPerms/LuckPerms/blob/master/common/src/main/java/me/lucko/luckperms/common/graph/TraversalAlgorithm.java

and an implementation to be written that returns an iterator capable of traversing the graph in the correct way.