I am building a "self-contained" set of definitions, and would like to ensure that the definitions:
- Do not contain circular definitions (which might include other words within that cycle, not just a direct cycle)
- Are properly ordered (definitions requiring a word show up after that word has already been defined)
How can I detect cycles, and also determine the ordering of the defintions?
I would assume that dictionaries already employ some kind of tool(s) to accomplish this, but have been unable to find anything. Suggestions on how these things might be accomplished?