{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# dpss\n", "## Python and Rust Subset Sum Solver\n", "`dpss` is a python and rust library by which subset sum problem can be solved quickly.\n", "It offers not only a solver of subset sum problem, but also a function that finds combinations of integers that add up to the same values.\n", "\n", "https://github.com/europeanplaice/subset_sum" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!pip install dpss\n", "import dpss\n", "dpss.__version__" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "a = dpss.sequence_matcher(\n", " [1980, 2980, 3500, 4000, 1050],\n", " [1950, 2900, 30, 80, 3300, 200, 3980, 1050, 20], 10, 10, 10, True, True)\n", "print(dpss.sequence_matcher_formatter(a))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "dpss.find_subset([1, 2, 3, 4, 5], 6, 3)" ] } ], "metadata": { "interpreter": { "hash": "87233e2b4968e527509109d870f09729c2e86bc35e4c43b1869c1a8ef6433d05" }, "kernelspec": { "display_name": "Python 3.9.5 ('env': venv)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.5" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }