I have a sequence of variables of type x. Type x is defined as
(a: Int, b: Set[Int])
Some variables have overlapping values for b. For example, variables
p = (1, Set(1, 2, 3))
q = (5, Set (3, 4, 5))
r = (10, Set(9, 10))
The notion of dependency is that if variables have overlapping values of b
, this indicates that they are dependent (for this example, p
and q
are dependent, r
is independent). I want to make a dependency graph where the variables which are dependent has an edge and the independent variables are single nodes. How can I achieve this in Scala?