HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Is there such a thing as an "or" case in a dependency graph?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
casesuchgraphdependencytherething

Problem

Suppose $A$ depends on $B$ or $C$, but not necessarily exclusively. Is it possible to model this in a dependency graph?

Can we just link $A$ to $B$ and $C$ via a diamond (like in UML) (though I don't see how this can be represented mathematically)? Or do we have to condense $B$ and $C$ to a single node $D$?

Solution

It's possible to represent a general boolean function as a directed acyclic graph. Wikipedia has examples of this on the binary decision diagram and propositional directed acyclic graph pages.

In the case of the PDAG, the up triangle represents AND, the down triangle OR, and the diamond represents NOT. The PDAG seems to be the closest to an AND/OR dependency graph, with the topmost element only having its requirements satisfied if the function would yield a 1.

To represent this mathematically, you could use Boolean algebra.

Context

StackExchange Computer Science Q#85310, answer score: 3

Revisions (0)

No revisions yet.