Topological Sorting in PHP by Using a Random Permutation

Are you OK? I hope so! Today I’ve had the opportunity to dig deeper into the world of permutations and I’ve figured out a way to perform a topological sort (also known as topsort) in PHP without using Kahn’s algorithm nor Depth-first search – which are a couple of usual solutions to this problem — but relying on a random permutation. Leer más