开发者

What sort of graph to represent this business logic decision tree?

开发者 https://www.devze.com 2022-12-22 18:41 出处:网络
How would I usually represen开发者_Go百科t this business logic in a graph? A is true if B is true or

How would I usually represen开发者_Go百科t this business logic in a graph?

A is true if
 B is true or
 C is true

C is true if
 D is true and
 E is true and
 F is true

X is true if
 Y is true and
 C is not true 

Is it a directed acyclic graph? How do I represent the 'and'/'or' logic in the graph, in graph terminology?

(I am looking for the correct graph terminology, so I can focus my reading.)


     (D)  (E)  (F)
      |    |    |
       \   |   /
         [AND]
          |
(B)      (C)
 |       |
  \     /
   [OR]
    |
   (A)

How about a graph with some nodes representing boolean variables and others boolean operations?

This is directed acyclic graph.

NOTE: I am not sure if this is very helpful.Expecting comments. :)


What about using Karnaugh maps? To me they feel a natural form to represent your data..


Ok, so you might want to look at the Specification pattern for this.

But it sounds like you are seriously overcomplicating things... you just need a composite data type. Call it whatever you like, so long as it works.

0

精彩评论

暂无评论...
验证码 换一张
取 消