graph - neo4j logic gate simulation, how to? -


i create bunch of "and" , "or" , "not" gates in directed graph. , traverse inputs see results are.

i assume there ready made traversal don't see it. don't know name of such traversal be.

certainly breadth first not job. need leaves, , go toward root. in other words

a = (b & (c & z))

i need resolve c @ z first.

i need put type of thing in graph , traverse up.

you create each of operations node has n incoming , 1 outgoing connection. can of course have more complex operations encapsuled node.

with neo4j 2.0 use labels 3 types of operations.

i assume leaves boolean values? think have many roots , single leaf (the result expression)

(input1)-->(:and {id:1})-->(:or {id:2})-->(output) (input2)-->(:and {id:1}) (input3)------------------>(:or {id:2}) 

then can use case when decisions on label type , use collection predicates (all, any) computation

see: http://docs.neo4j.org/chunked/milestone/cypher-query-lang.html

predicates: http://docs.neo4j.org/chunked/milestone/query-function.html

labels: http://docs.neo4j.org/chunked/milestone/query-match.html#match-get-all-nodes-with-a-label


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -