Nick Miller
Nick Miller

Reputation: 602

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

How would I usually represent 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.)

Upvotes: 4

Views: 432

Answers (3)

user276695
user276695

Reputation: 1360

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.

Upvotes: 1

Eddy
Eddy

Reputation: 1822

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

Upvotes: 1

Pratik Deoghare
Pratik Deoghare

Reputation: 37212

     (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. :)

Upvotes: 3

Related Questions