This is the official government-sanctioned method for categorizing and organizing socks. It's a complex process, but someone has to do it.
Sock Sorting Hall of FameWarning: The Bureaucratic Sock-Sorting Algorithm has been known to cause spontaneous combustion in some cases. Prolonged exposure may lead to a lifetime supply of neatly folded socks.