Git Product home page Git Product logo

polynomialsubsetsum's Introduction

Subset Sum Problem, Strongly Polynomial Algorithm

In this repo you'll find the fruits of an on-going effort to implement a polynomial-time algorithm to solve the subset sum problem.

Note: this repo may eventually contain multiple algorithms. This readme currently applies only to the current method being explored. Additionally, I tend to tinker with the implementation of the method to see if I can't alter it in some way to in any way enhance performance: the pseudocode given in method.pdf may not always align precisely with the current form of the algorithm.

About the current method in iquestion: The current big-O runtime is O(n^7).

RefactoredSubsetSum.java is the (somewhat) optimized implementation of the algorithm developed as the algorithm was analyzed for justification. This uses the closed forms found in method.pdf.

SubsetSum.java is the original implementation requiring use of matrices and matrix operations.

If you use the code or the algorithm, great! Some credit will be nice. If you break it, even better! Contact me to let me know how you did it. (Note: worst case at n = 200 is 200^7, which is a pretty big number.)

UPDATE: 12/14: Justification/proof added to method.pdf; tracked code for n^7 implementation using only longs (note, sets containing large (>2^62 in value) will exceed LONG_MAX during execution: each input integer of p bits needs at most 2p bits once reached in the test procedure, so values of such magnitude can exceed long bit length. Solution is to use BigInteger where this can occur); expanded discussion of complexity in method.pdf.

Questions? Comments? Suggestions? Feel free to email me ([email protected]).

polynomialsubsetsum's People

Contributors

ad-alston avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.