1

I have some sets of combinations and I want to find out the intersection function between say two of them. Then I want to represent the intersected results in ZDD.

I am thinking about using the CUDD package to do this.

An example:

All the 4-bit strings having hamming distance >= 2 with 1100 =

{ 0001, 0010, 0011,0101, 0110, 0111, 1001, 1010, 1011 }

All the 4-bit strings having hamming distance >= 2 with 0000 =

{ 0011, 0101, 0110, 1001, 1010, 0111, 1011, 1101, 1110 }

Intersected elements of the set (what I want):

{0011, 0101, 0110, 1010, 1001 }

From what I understand, I need to be able to express those sets of combinations first, with boolean functions, e.g. ( f = a b c d ) to represent their corresponding BDDs, convert them to ZDDs and then find out the intersection? Someone experienced with the CUDD package please help.

zaki
  • 27
  • 1
  • 2
  • 7

1 Answers1

2

Your reasoning is correct. You can first build BDDs corresponding to the two string sets, convert them to ZDDs, and then build the intersection (logical AND).

However, you can also first compute the intersection (logical AND) and then translate the result to a ZDD.

It is however not clear what you mean by "find out the intersection" - what do you want to do with it? Print out all the elements? Count the number of elements? Depending what what is your aim, the translation to ZDDs may be unnecessary (or the use of CUDD altogether).

DCTLib
  • 1,016
  • 8
  • 22
  • Thank you for your response. I want to print out all the **intersected elements of the set** through ZDD. Because ZDD is better at representing sparse sets of combinations this is the idea. Please explain why the translation might be unnecessary? – zaki Jan 21 '20 at 02:54
  • @zaki BDDs representing strings having a certain hamming distance to a reference string will always be small, regardless of the variable order. On the other hand, the ZDDs may be quite large. Since you only build a single intersection over the BDDs, this appears to lead to quite small BDDs, so there is no need to involve ZDDs. – DCTLib Jan 21 '20 at 07:17
  • Thanks again for your response. Actually here I showed just one small example. Depending on my work, I may have to compare with a lot of reference strings (in this example, **1100**,**0000**), in which case there will be **multiple intersections** to consider. Could you please explain (or give a link for an example) when the BDD is small but ZDD is large? I don't understand this reasoning. – zaki Jan 21 '20 at 10:15
  • Remark: The set of all the 4-bit strings having hamming distance >= 2 with 1100 and 0000, respectively, includes more elements, e.g. 1100 and 1111 for the later. Moreover, the intersection includes 0111 and some others. Question: what is the alphabet of your strings, only 0 and 1 or other letters are also allowed? – meolic Feb 04 '20 at 22:19
  • @meolic You are right. However, this is part of a bigger problem. There is another 4-bit string from which I have to find out all the 4 bit strings having **HD>=2** from; it is **1111**. If I include those then the given example would be correct. What I showed here is just a small example. – zaki Feb 05 '20 at 17:22
  • @meolic And yes; only 1 and 0 are allowed. – zaki Feb 05 '20 at 17:23
  • @DCTLib I am sorry may I ask you to please share your thoughts if there are multiple intersections involved? – zaki Feb 21 '20 at 05:34