implemented general graph traversal and tested it on rete