reduction from 3-SAT to Subset Sum problemNAE SAT reduction to weighted MAX CUTHow to reduce from subset-sum problem?Constructing a promise problem equivalent to XSAT from subset sumQuestion on SAT reductionReduction of SUBSET-SUM to SET-PARTITIONSubset-sum variation, multiple sumsCNF-SAT reduction problem variantSubset sum NP-CompletnessKarp reduction from PARTITION to SUBSET SUMHow can I reduce Subset Sum to Almost Subset Sum?

Is Diceware more secure than a long passphrase?

My admission is revoked after accepting the admission offer

Is there a word for the censored part of a video?

What does a straight horizontal line above a few notes, after a changed tempo mean?

Negative Resistance

Unknown code in script

Does a large simulator bay have standard public address announcements?

What was Apollo 13's "Little Jolt" after MECO?

What to do with someone that cheated their way through university and a PhD program?

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

Where was the County of Thurn und Taxis located?

A ​Note ​on ​N!

Why did Rep. Omar conclude her criticism of US troops with the phrase "NotTodaySatan"?

As an international instructor, should I openly talk about my accent?

Nails holding drywall

Should the Product Owner dictate what info the UI needs to display?

Apply a different color ramp to subset of categorized symbols in QGIS?

Do I need to watch Ant-Man and the Wasp and Captain Marvel before watching Avengers: Endgame?

My bank got bought out, am I now going to have to start filing tax returns in a different state?

What makes accurate emulation of old systems a difficult task?

"The cow" OR "a cow" OR "cows" in this context

Is there metaphorical meaning of "aus der Haft entlassen"?

partitioning values in a sequence

Retract an already submitted recommendation letter (written for an undergrad student)



reduction from 3-SAT to Subset Sum problem


NAE SAT reduction to weighted MAX CUTHow to reduce from subset-sum problem?Constructing a promise problem equivalent to XSAT from subset sumQuestion on SAT reductionReduction of SUBSET-SUM to SET-PARTITIONSubset-sum variation, multiple sumsCNF-SAT reduction problem variantSubset sum NP-CompletnessKarp reduction from PARTITION to SUBSET SUMHow can I reduce Subset Sum to Almost Subset Sum?













1












$begingroup$


How to reduce 3-SAT to subset sum problem?










share|cite|improve this question







New contributor




SiluPanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$
















    1












    $begingroup$


    How to reduce 3-SAT to subset sum problem?










    share|cite|improve this question







    New contributor




    SiluPanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.







    $endgroup$














      1












      1








      1





      $begingroup$


      How to reduce 3-SAT to subset sum problem?










      share|cite|improve this question







      New contributor




      SiluPanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      $endgroup$




      How to reduce 3-SAT to subset sum problem?







      complexity-theory automata reductions






      share|cite|improve this question







      New contributor




      SiluPanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|cite|improve this question







      New contributor




      SiluPanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|cite|improve this question




      share|cite|improve this question






      New contributor




      SiluPanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Apr 22 at 17:50









      SiluPandaSiluPanda

      1286




      1286




      New contributor




      SiluPanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      SiluPanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      SiluPanda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          4












          $begingroup$

          The trick to the reduction is to use numbers to encode statements about the 3CNF formula, crafting those numbers in such a way that you can later make an arithmetic proposition about the numbers that is only true if the original 3CNF formula is satisfiable. The reduction below is lifted directly from the lecture notes found at https://people.clarkson.edu/~alexis/PCMI/Notes/lectureB07.pdf .




          We reduce 3SAT to SUBSET-SUM. Consider a 3CNF formula with variables $x_1, . . . , x_n$ and clauses $c_1, . . . , c_r$. For each variable $x_i$, we will have two numbers $y_i$ and $z_i$ in the list. For each clause $c_j$, we will also have two numbers $s_j$ and $t_j$. We define all of these numbers by specifying their base 10 representations. The construction is best explained by an example and a picture.



          If the formula is $(x_1∨x_2∨overlinex_3)∧(overlinex_1∨x_2∨overlinex_3)$, then the base 10 representations of the numbers will look like this:



          beginarrayc
          & x_1 & x_2 & x_3 & c_1 & c_2 \
          hline
          y_1 & 1 & 0 & 0 & 1 & 0 \
          z_1 & 1 & 0 & 0 & 0 & 1 \
          y_2 & 0 & 1 & 0 & 1 & 1 \
          z_2 & 0 & 1 & 0 & 0 & 0 \
          y_3 & 0 & 0 & 1 & 0 & 0 \
          z_3 & 0 & 0 & 1 & 1 & 1 \
          hline
          s_1 & 0 & 0 & 0 & 1 & 0 \
          t_1 & 0 & 0 & 0 & 1 & 0 \
          s_2 & 0 & 0 & 0 & 0 & 1 \
          t_2 & 0 & 0 & 0 & 0 & 1 \
          hline
          k & 1 & 1 & 1 & 3 & 3 \
          endarray



          The number $y_i$ corresponds to the positive occurrences of $x_i$ in the formula while the number $z_i$ corresponds to its negative occurrences. It should be clear how to generalize this construction to an arbitrary 3CNF formula. And the list of numbers can clearly be constructed in polynomial time. We claim that a subset of these numbers adds to exactly $k$ if and only if the formula is satisfiable. A key point is that the sum of the numbers can be done column by column, independently, because carries will never occur.




          The $s$ value is crafted the same way for each clause; put a one in the digit position corresponding to that clause, and zeroes everywhere else. The $t$ value will be the same as the $s$ value for each clause.



          The $k$ value is always 1111... followed by 33333.... where the number of ones is the same as the number of distinct variables in the formula and the number of threes is the number of clauses in the formula. Note that the required sum $k$ has a one in each digit position corresponding to the variables. This means that any solution to the subset sum problem can include only encoded statements about either a positive instance of the variable or a negative instance in each clause, not both. Note also that sum $k$ has a three in the digit position corresponding to each clause. The $s$ and $t$ values for each clause will sum to two, but to complete the sum a third one will have to come from one of the $y$ or $z$ values. All three ones could come from the $y$ and $z$ values, but the fact that $s$ and $t$ will only sum to two for any clause guarantees that any empty clause in the 3CNF formula forces the subset sum problem to become unsatisfiable.






          share|cite|improve this answer











          $endgroup$













            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "419"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            SiluPanda is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f107376%2freduction-from-3-sat-to-subset-sum-problem%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4












            $begingroup$

            The trick to the reduction is to use numbers to encode statements about the 3CNF formula, crafting those numbers in such a way that you can later make an arithmetic proposition about the numbers that is only true if the original 3CNF formula is satisfiable. The reduction below is lifted directly from the lecture notes found at https://people.clarkson.edu/~alexis/PCMI/Notes/lectureB07.pdf .




            We reduce 3SAT to SUBSET-SUM. Consider a 3CNF formula with variables $x_1, . . . , x_n$ and clauses $c_1, . . . , c_r$. For each variable $x_i$, we will have two numbers $y_i$ and $z_i$ in the list. For each clause $c_j$, we will also have two numbers $s_j$ and $t_j$. We define all of these numbers by specifying their base 10 representations. The construction is best explained by an example and a picture.



            If the formula is $(x_1∨x_2∨overlinex_3)∧(overlinex_1∨x_2∨overlinex_3)$, then the base 10 representations of the numbers will look like this:



            beginarrayc
            & x_1 & x_2 & x_3 & c_1 & c_2 \
            hline
            y_1 & 1 & 0 & 0 & 1 & 0 \
            z_1 & 1 & 0 & 0 & 0 & 1 \
            y_2 & 0 & 1 & 0 & 1 & 1 \
            z_2 & 0 & 1 & 0 & 0 & 0 \
            y_3 & 0 & 0 & 1 & 0 & 0 \
            z_3 & 0 & 0 & 1 & 1 & 1 \
            hline
            s_1 & 0 & 0 & 0 & 1 & 0 \
            t_1 & 0 & 0 & 0 & 1 & 0 \
            s_2 & 0 & 0 & 0 & 0 & 1 \
            t_2 & 0 & 0 & 0 & 0 & 1 \
            hline
            k & 1 & 1 & 1 & 3 & 3 \
            endarray



            The number $y_i$ corresponds to the positive occurrences of $x_i$ in the formula while the number $z_i$ corresponds to its negative occurrences. It should be clear how to generalize this construction to an arbitrary 3CNF formula. And the list of numbers can clearly be constructed in polynomial time. We claim that a subset of these numbers adds to exactly $k$ if and only if the formula is satisfiable. A key point is that the sum of the numbers can be done column by column, independently, because carries will never occur.




            The $s$ value is crafted the same way for each clause; put a one in the digit position corresponding to that clause, and zeroes everywhere else. The $t$ value will be the same as the $s$ value for each clause.



            The $k$ value is always 1111... followed by 33333.... where the number of ones is the same as the number of distinct variables in the formula and the number of threes is the number of clauses in the formula. Note that the required sum $k$ has a one in each digit position corresponding to the variables. This means that any solution to the subset sum problem can include only encoded statements about either a positive instance of the variable or a negative instance in each clause, not both. Note also that sum $k$ has a three in the digit position corresponding to each clause. The $s$ and $t$ values for each clause will sum to two, but to complete the sum a third one will have to come from one of the $y$ or $z$ values. All three ones could come from the $y$ and $z$ values, but the fact that $s$ and $t$ will only sum to two for any clause guarantees that any empty clause in the 3CNF formula forces the subset sum problem to become unsatisfiable.






            share|cite|improve this answer











            $endgroup$

















              4












              $begingroup$

              The trick to the reduction is to use numbers to encode statements about the 3CNF formula, crafting those numbers in such a way that you can later make an arithmetic proposition about the numbers that is only true if the original 3CNF formula is satisfiable. The reduction below is lifted directly from the lecture notes found at https://people.clarkson.edu/~alexis/PCMI/Notes/lectureB07.pdf .




              We reduce 3SAT to SUBSET-SUM. Consider a 3CNF formula with variables $x_1, . . . , x_n$ and clauses $c_1, . . . , c_r$. For each variable $x_i$, we will have two numbers $y_i$ and $z_i$ in the list. For each clause $c_j$, we will also have two numbers $s_j$ and $t_j$. We define all of these numbers by specifying their base 10 representations. The construction is best explained by an example and a picture.



              If the formula is $(x_1∨x_2∨overlinex_3)∧(overlinex_1∨x_2∨overlinex_3)$, then the base 10 representations of the numbers will look like this:



              beginarrayc
              & x_1 & x_2 & x_3 & c_1 & c_2 \
              hline
              y_1 & 1 & 0 & 0 & 1 & 0 \
              z_1 & 1 & 0 & 0 & 0 & 1 \
              y_2 & 0 & 1 & 0 & 1 & 1 \
              z_2 & 0 & 1 & 0 & 0 & 0 \
              y_3 & 0 & 0 & 1 & 0 & 0 \
              z_3 & 0 & 0 & 1 & 1 & 1 \
              hline
              s_1 & 0 & 0 & 0 & 1 & 0 \
              t_1 & 0 & 0 & 0 & 1 & 0 \
              s_2 & 0 & 0 & 0 & 0 & 1 \
              t_2 & 0 & 0 & 0 & 0 & 1 \
              hline
              k & 1 & 1 & 1 & 3 & 3 \
              endarray



              The number $y_i$ corresponds to the positive occurrences of $x_i$ in the formula while the number $z_i$ corresponds to its negative occurrences. It should be clear how to generalize this construction to an arbitrary 3CNF formula. And the list of numbers can clearly be constructed in polynomial time. We claim that a subset of these numbers adds to exactly $k$ if and only if the formula is satisfiable. A key point is that the sum of the numbers can be done column by column, independently, because carries will never occur.




              The $s$ value is crafted the same way for each clause; put a one in the digit position corresponding to that clause, and zeroes everywhere else. The $t$ value will be the same as the $s$ value for each clause.



              The $k$ value is always 1111... followed by 33333.... where the number of ones is the same as the number of distinct variables in the formula and the number of threes is the number of clauses in the formula. Note that the required sum $k$ has a one in each digit position corresponding to the variables. This means that any solution to the subset sum problem can include only encoded statements about either a positive instance of the variable or a negative instance in each clause, not both. Note also that sum $k$ has a three in the digit position corresponding to each clause. The $s$ and $t$ values for each clause will sum to two, but to complete the sum a third one will have to come from one of the $y$ or $z$ values. All three ones could come from the $y$ and $z$ values, but the fact that $s$ and $t$ will only sum to two for any clause guarantees that any empty clause in the 3CNF formula forces the subset sum problem to become unsatisfiable.






              share|cite|improve this answer











              $endgroup$















                4












                4








                4





                $begingroup$

                The trick to the reduction is to use numbers to encode statements about the 3CNF formula, crafting those numbers in such a way that you can later make an arithmetic proposition about the numbers that is only true if the original 3CNF formula is satisfiable. The reduction below is lifted directly from the lecture notes found at https://people.clarkson.edu/~alexis/PCMI/Notes/lectureB07.pdf .




                We reduce 3SAT to SUBSET-SUM. Consider a 3CNF formula with variables $x_1, . . . , x_n$ and clauses $c_1, . . . , c_r$. For each variable $x_i$, we will have two numbers $y_i$ and $z_i$ in the list. For each clause $c_j$, we will also have two numbers $s_j$ and $t_j$. We define all of these numbers by specifying their base 10 representations. The construction is best explained by an example and a picture.



                If the formula is $(x_1∨x_2∨overlinex_3)∧(overlinex_1∨x_2∨overlinex_3)$, then the base 10 representations of the numbers will look like this:



                beginarrayc
                & x_1 & x_2 & x_3 & c_1 & c_2 \
                hline
                y_1 & 1 & 0 & 0 & 1 & 0 \
                z_1 & 1 & 0 & 0 & 0 & 1 \
                y_2 & 0 & 1 & 0 & 1 & 1 \
                z_2 & 0 & 1 & 0 & 0 & 0 \
                y_3 & 0 & 0 & 1 & 0 & 0 \
                z_3 & 0 & 0 & 1 & 1 & 1 \
                hline
                s_1 & 0 & 0 & 0 & 1 & 0 \
                t_1 & 0 & 0 & 0 & 1 & 0 \
                s_2 & 0 & 0 & 0 & 0 & 1 \
                t_2 & 0 & 0 & 0 & 0 & 1 \
                hline
                k & 1 & 1 & 1 & 3 & 3 \
                endarray



                The number $y_i$ corresponds to the positive occurrences of $x_i$ in the formula while the number $z_i$ corresponds to its negative occurrences. It should be clear how to generalize this construction to an arbitrary 3CNF formula. And the list of numbers can clearly be constructed in polynomial time. We claim that a subset of these numbers adds to exactly $k$ if and only if the formula is satisfiable. A key point is that the sum of the numbers can be done column by column, independently, because carries will never occur.




                The $s$ value is crafted the same way for each clause; put a one in the digit position corresponding to that clause, and zeroes everywhere else. The $t$ value will be the same as the $s$ value for each clause.



                The $k$ value is always 1111... followed by 33333.... where the number of ones is the same as the number of distinct variables in the formula and the number of threes is the number of clauses in the formula. Note that the required sum $k$ has a one in each digit position corresponding to the variables. This means that any solution to the subset sum problem can include only encoded statements about either a positive instance of the variable or a negative instance in each clause, not both. Note also that sum $k$ has a three in the digit position corresponding to each clause. The $s$ and $t$ values for each clause will sum to two, but to complete the sum a third one will have to come from one of the $y$ or $z$ values. All three ones could come from the $y$ and $z$ values, but the fact that $s$ and $t$ will only sum to two for any clause guarantees that any empty clause in the 3CNF formula forces the subset sum problem to become unsatisfiable.






                share|cite|improve this answer











                $endgroup$



                The trick to the reduction is to use numbers to encode statements about the 3CNF formula, crafting those numbers in such a way that you can later make an arithmetic proposition about the numbers that is only true if the original 3CNF formula is satisfiable. The reduction below is lifted directly from the lecture notes found at https://people.clarkson.edu/~alexis/PCMI/Notes/lectureB07.pdf .




                We reduce 3SAT to SUBSET-SUM. Consider a 3CNF formula with variables $x_1, . . . , x_n$ and clauses $c_1, . . . , c_r$. For each variable $x_i$, we will have two numbers $y_i$ and $z_i$ in the list. For each clause $c_j$, we will also have two numbers $s_j$ and $t_j$. We define all of these numbers by specifying their base 10 representations. The construction is best explained by an example and a picture.



                If the formula is $(x_1∨x_2∨overlinex_3)∧(overlinex_1∨x_2∨overlinex_3)$, then the base 10 representations of the numbers will look like this:



                beginarrayc
                & x_1 & x_2 & x_3 & c_1 & c_2 \
                hline
                y_1 & 1 & 0 & 0 & 1 & 0 \
                z_1 & 1 & 0 & 0 & 0 & 1 \
                y_2 & 0 & 1 & 0 & 1 & 1 \
                z_2 & 0 & 1 & 0 & 0 & 0 \
                y_3 & 0 & 0 & 1 & 0 & 0 \
                z_3 & 0 & 0 & 1 & 1 & 1 \
                hline
                s_1 & 0 & 0 & 0 & 1 & 0 \
                t_1 & 0 & 0 & 0 & 1 & 0 \
                s_2 & 0 & 0 & 0 & 0 & 1 \
                t_2 & 0 & 0 & 0 & 0 & 1 \
                hline
                k & 1 & 1 & 1 & 3 & 3 \
                endarray



                The number $y_i$ corresponds to the positive occurrences of $x_i$ in the formula while the number $z_i$ corresponds to its negative occurrences. It should be clear how to generalize this construction to an arbitrary 3CNF formula. And the list of numbers can clearly be constructed in polynomial time. We claim that a subset of these numbers adds to exactly $k$ if and only if the formula is satisfiable. A key point is that the sum of the numbers can be done column by column, independently, because carries will never occur.




                The $s$ value is crafted the same way for each clause; put a one in the digit position corresponding to that clause, and zeroes everywhere else. The $t$ value will be the same as the $s$ value for each clause.



                The $k$ value is always 1111... followed by 33333.... where the number of ones is the same as the number of distinct variables in the formula and the number of threes is the number of clauses in the formula. Note that the required sum $k$ has a one in each digit position corresponding to the variables. This means that any solution to the subset sum problem can include only encoded statements about either a positive instance of the variable or a negative instance in each clause, not both. Note also that sum $k$ has a three in the digit position corresponding to each clause. The $s$ and $t$ values for each clause will sum to two, but to complete the sum a third one will have to come from one of the $y$ or $z$ values. All three ones could come from the $y$ and $z$ values, but the fact that $s$ and $t$ will only sum to two for any clause guarantees that any empty clause in the 3CNF formula forces the subset sum problem to become unsatisfiable.







                share|cite|improve this answer














                share|cite|improve this answer



                share|cite|improve this answer








                edited yesterday

























                answered Apr 22 at 20:03









                Kyle JonesKyle Jones

                5,85711840




                5,85711840




















                    SiluPanda is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    SiluPanda is a new contributor. Be nice, and check out our Code of Conduct.












                    SiluPanda is a new contributor. Be nice, and check out our Code of Conduct.











                    SiluPanda is a new contributor. Be nice, and check out our Code of Conduct.














                    Thanks for contributing an answer to Computer Science Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f107376%2freduction-from-3-sat-to-subset-sum-problem%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form