by rickyboy » Wed Dec 10, 2014 5:54 am
Here's another attachment of code. This contains the code from the previous post with a few additions. Everything you can do with parents and ancestors ("deep parents") in the former code, you can now do with children and descendants ("deep children") also. I also added some comments showing example usages of a few of the intermediate functions (including a couple of degenerate cases, but not exhaustive).
Please try improving it for performance or adding new functionality, for instance, there is no DAG validation (e.g. checking for cycles or making sure a Node exists when it's mentioned by name in an Edge); there is no shortest path function, etc. yet.
Happy hacking!
- Attachments
-
dag-full.zip
- (1.29 KiB) Downloaded 87 times
(λx. x x) (λx. x x)