This is mostly a topological sort. If you substitute a7 for a8 it is entirely a topological sort. The question becomes whether cycles exist to refute the ordering.
System tsort will handle this. So will the Graph module. Wolf Book pp304-307 does, too.
After Compline,
Zaxo
In reply to Re: Sorting, given only comparisions
by Zaxo
in thread Sorting, given only comparisions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |