Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8634863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:49:30+00:00 2026-06-12T09:49:30+00:00

I’m trying to implement univariate polynomials using ZDDs, as suggested in a comment in

  • 0

I’m trying to implement univariate polynomials using ZDDs, as suggested in a comment in an other question.

I’ve read the paper of S. Minato(you may download it here), but I don’t understand how to implement the operations on these ZDDs.

The idea in the paper is that polynomials can be represented using x^(2^i) as variables. For example x^5 + x^3 + x can be rewritten as x^4x^1 + x^2x^1 + x^1, if you create nodes for each x^(2^i) variable and connect with the “1-edge” variables that are multiplied together and with the “0-edge” variables that are added together you can easily obtain a graph representing that polynomial. The ZDDs are graphs of this kind that enforce some condition on the graph(for more information read the article of Minato and the wikipedia’s page on BDDs)

The coefficients can be similarly represented using sums of powers of 2 (e.g. 5 = 2^2 + 2^0 etc. With every 2^i being a variable and the nodes are connected with 1- and 0-edges in the same fashion).

Now, my problem is the algorithm for addition of two ZDDs.
The algorithm seems quite simple:

If F and G (ZDDs)have no common combinations, the addition (F + G) can be
completed by just merging them. When they contain some common
combinations, we compute the following formulas: (F + G) = S + (Cx2),
where C = F ∩ G, S = (F U G) \ C . By repeating this process,
common combinations are eventually exhausted and the procedure is
completed.

The problem is: how can I find “C” and “S” efficiently?

The author provides code for the multiplication, but the code is actually trivial once you have the previous algorithms implemented. And since these algorithms are not provided also the multiplication one is “useless”.

Also the notion of “merge” ZDDs is not well explained, even though, considering the fact that the order of the variables should be consistent, there is only one way to merge the graphs together, and the rules to maintain this order are probably simple enough(I did not formalize them yet, but I’ve got a rough idea of what these are).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:49:32+00:00Added an answer on June 12, 2026 at 9:49 am

    With “merge” there Minato means union (algorithm). You can see this from the example, too:

    4 * y     = { { 2^2, y } }
    x         = { { x } }
    4 * y + x = { { 2^2, y }, { x } }
    

    The idea is that the inner sets represent products and the whole ZDD represents the sum of those products, so if you just OR (aka union or merge) in some more sets, they’re effectively added.

    The complete summation algorithm actually just does (A xor B) + 2 * (A and B) (recursively) which is equivalent to the familiar bitwise addition algorithm, but the xor was written as (A or B) without (A and B).

    That also makes it obvious why simply taking the union is OK when there are no common combinations – if A and B is empty, A xor B is the same as A or B and the “carry” is zero.

    The algorithms for OR, AND, XOR and BUTNOT are explained in detail in The Art of Computer Programming volume 4, section 7.1.4 (the answer to question 199 is relevant). The general idea for all of them is that they consider the two sub-graphs that represent all the sets with the variable v and all the sets without the variable v separately (which are both trivially found if v is the topmost variable in one or both arguments as either the low and high children or the input itself), and then combining the result.

    Union(F, G) =
      if (F = ∅) return G
      if (G = ∅) return F
      if (F = G) return F
      if (cache contains "F ∪ G" or "G ∪ F")
        return cached value
    
      if (F.v = G.v) result = MakeNode(F.v, F.lo ∪ G.lo, F.hi ∪ G.hi)
      if (F.v > G.v) result = MakeNode(G.v, F ∪ G.lo, G.hi)
      if (F.v < G.v) result = MakeNode(F.v, F.lo ∪ G, F.hi)
    
      cache result as "F ∪ G"
      return result
    
    Intersect(F, G) =
      if (F = ∅ or G = ∅) return ∅
      if (F = G) return F
      if (cache contains "F ∩ G" or "G ∩ F")
        return cached value
    
      if (F.v = G.v) result = MakeNode(F.v, F.lo ∩ G.lo, F.hi ∩ G.hi)
      if (F.v > G.v) result = F ∩ G.lo
      if (F.v < G.v) result = F.lo ∩ G
    
      cache result as "F ∩ G"
      return result
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.