diff --git a/CMakeLists.txt b/CMakeLists.txt index 40adca2..06fd50e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -project(pgORpy VERSION 0.0.0 +project(pgORpy VERSION 0.0.1 ) set(PROJECT_VERSION_DEV "") string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER) diff --git a/NEWS.md b/NEWS.md index 02a8ffb..ed5e9c5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,33 @@ .. current +### pgORpy 0.0.1 Release Notes + +To see all issues & pull requests closed by this release see the +[Git closed milestone for 0.0.1 +](https://github.com/pgRouting/pgorpy/issues?utf8=%E2%9C%93&q=milestone%3A%22Release%200.0.1%22) +on Github. + +**Version functions** + +* por_bin_backing + + * New function + * Support for or-tools v9.10.4067 + + +* por_knapsack + + * New function + * Support for or-tools v9.10.4067 + + +* por_multiple_knapsack + + * New function + * Support for or-tools v9.10.4067 + + ### pgORpy 0.0.0 Release Notes To see all issues & pull requests closed by this release see the diff --git a/configuration.conf b/configuration.conf index 70f8032..16c71bd 100644 --- a/configuration.conf +++ b/configuration.conf @@ -12,3 +12,4 @@ pg_controls | Y | N # Dependencies must be considered when adding a line #---------------------- version | Y | Y +or_tools | Y | Y diff --git a/doc/_static/page_history.js b/doc/_static/page_history.js index 2867294..e099a6c 100644 --- a/doc/_static/page_history.js +++ b/doc/_static/page_history.js @@ -14,9 +14,10 @@ var titles = [ var newpages = [ {v: '0.0', pages: [ - 'index', 'installation', 'introduction', 'release_notes', + 'concepts', 'functions', 'index', 'installation', 'introduction', 'release_notes', 'sampledata', 'support', - 'por_full_version', 'por_version' + 'por_full_version', 'por_version', + 'por_bin_packing', 'por_knapsack', 'por_miltiple_knapsack' ] }, ]; diff --git a/doc/general/CMakeLists.txt b/doc/general/CMakeLists.txt index 5517c31..1ec1d11 100644 --- a/doc/general/CMakeLists.txt +++ b/doc/general/CMakeLists.txt @@ -1,5 +1,6 @@ SET(LOCAL_FILES + concepts.rst functions.rst index.rst introduction.rst diff --git a/doc/general/concepts.rst b/doc/general/concepts.rst new file mode 100644 index 0000000..bc246ec --- /dev/null +++ b/doc/general/concepts.rst @@ -0,0 +1,114 @@ +.. + **************************************************************************** + pgORpy Manual + Copyright(c) pgORpy Contributors + + This documentation is licensed under a Creative Commons Attribution-Share + Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/ + **************************************************************************** + +| + +Concepts +=============================================================================== + +.. contents:: + +Synopsis +------------------------------------------------------------------------------- + +OR-Tools is an open source software suite for optimization, tuned for tackling +the world's toughest problems in vehicle routing, flows, integer and linear +programming, and constraint programming. + +OR-Tools can solve + +- VR (Vehicle Routing) +- Scheduling +- Bin Packing + +Currently only Bin Packing problems can be solved with OR-Tools in pgORpy. + +Terminologies +............................................................................... + +- **weight**: For each item, a positive integer weight is associated with it. +- **cost**: For each item, a positive integer cost(value) is associated with it. +- **capacity**: Maximum storage capacity of a knapsack or a bin. + +Inner Queries +------------------------------------------------------------------------------- + +Weight Costs SQL +............................................................................... + +A ``SELECT`` statement that returns the following columns: + +.. weight_costs_start + +.. list-table:: + :width: 81 + :widths: 14 14 44 + :header-rows: 1 + + * - Column + - Type + - Description + * - ``id`` + - **ANY-INTEGER** + - Unique identifier of the item. + * - ``weight`` + - **ANY-INTEGER** + - Weight of the item. + * - ``cost`` + - **ANY-INTEGER** + - Cost of the item. + +Where: + +:ANY-INTEGER: ``SMALLINT``, ``INTEGER``, ``BIGINT`` + +.. weight_costs_end + +Weights SQL +............................................................................... + +.. weights_start + +A ``SELECT`` statement that returns the following columns: + +.. list-table:: + :width: 81 + :widths: 14 14 44 + :header-rows: 1 + + * - Column + - Type + - Description + * - ``id`` + - **ANY-INTEGER** + - Identifier of the item. + * - ``weight`` + - **ANY-INTEGER** + - Weight of the item. + +Where: + +:ANY-INTEGER: ``SMALLINT``, ``INTEGER``, ``BIGINT`` + +.. weights_end + +See Also +------------------------------------------------------------------------------- + +.. see_also_start + +* `Wikipedia: Bin Packing problems `__ +* `OR-Tools: Google OR-Tools `__ + +.. see_also_end + +.. rubric:: Indices and tables + +* :ref:`genindex` +* :ref:`search` diff --git a/doc/general/functions.rst b/doc/general/functions.rst index 1c1819f..e090f42 100644 --- a/doc/general/functions.rst +++ b/doc/general/functions.rst @@ -27,6 +27,20 @@ Utilities por_version por_full_version +OR-tools +------------------------------------------------------------------------------- + +- :doc:`por_bin_packing` +- :doc:`por_knapsack` +- :doc:`por_multiple_knapsack` + +.. toctree:: + :hidden: + + por_bin_packing + por_knapsack + por_multiple_knapsack + .. functions_end .. rubric:: Indices and tables diff --git a/doc/general/index.rst b/doc/general/index.rst index 7603d26..408dba2 100644 --- a/doc/general/index.rst +++ b/doc/general/index.rst @@ -40,6 +40,7 @@ General introduction installation support + concepts - :doc:`sampledata` that is used in the examples of this manual. @@ -65,6 +66,7 @@ General .. include:: release_notes.rst :start-after: current + :end-before: pgORpy 0.0.0 .. toctree:: :hidden: diff --git a/doc/general/introduction.rst b/doc/general/introduction.rst index 1e76f3e..82606e3 100644 --- a/doc/general/introduction.rst +++ b/doc/general/introduction.rst @@ -65,6 +65,12 @@ Individuals (in alphabetical order) - Github actions for documentation publishing and release +- Manas Sivakumar + + - por_bin_backing + - por_knapsack + - por_multiple_knapsack + - Virginia Vergara - Initial version functions @@ -92,6 +98,15 @@ Individuals past & present (in alphabetical order) - Github actions for documentation publishing and release +- `Manas Sivakumar `__ + + Support for or-tools v9.10.4067 on the following functions + + - por_bin_backing + - por_knapsack + - por_multiple_knapsack + + - `Vicky Vergara `__ - Initial version functions diff --git a/doc/general/release_notes.rst b/doc/general/release_notes.rst index 719ab5c..5c478b1 100644 --- a/doc/general/release_notes.rst +++ b/doc/general/release_notes.rst @@ -35,6 +35,34 @@ pgORpy 0.0 .. current +pgORpy 0.0.1 Release Notes +------------------------------------------------------------------------------- + +To see all issues & pull requests closed by this release see the +`Git closed milestone for 0.0.1 +`_ +on Github. + +.. rubric:: Version functions + +* por_bin_backing + + .. include:: por_bin_packing.rst + :start-after: Version 0.0.1 + :end-before: Description + +* por_knapsack + + .. include:: por_knapsack.rst + :start-after: Version 0.0.1 + :end-before: Description + +* por_multiple_knapsack + + .. include:: por_multiple_knapsack.rst + :start-after: Version 0.0.1 + :end-before: Description + pgORpy 0.0.0 Release Notes ------------------------------------------------------------------------------- diff --git a/doc/general/sampledata.rst b/doc/general/sampledata.rst index 202ebc2..96c927b 100644 --- a/doc/general/sampledata.rst +++ b/doc/general/sampledata.rst @@ -21,3 +21,8 @@ Function to activate python on a local environment .. literalinclude:: ../../tools/testers/sampledata.sql :start-after: -- activate_python_start :end-before: -- activate_python_end + +Sample data + +.. literalinclude:: ../../tools/testers/sampledata.sql + :start-after: -- activate_python_end diff --git a/doc/or_tools/CMakeLists.txt b/doc/or_tools/CMakeLists.txt new file mode 100644 index 0000000..af1cd2c --- /dev/null +++ b/doc/or_tools/CMakeLists.txt @@ -0,0 +1,13 @@ +SET(LOCAL_FILES + por_knapsack.rst + por_multiple_knapsack.rst + por_bin_packing.rst + ) + +foreach (f ${LOCAL_FILES}) + configure_file(${f} "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}") + list(APPEND LOCAL_DOC_FILES ${PGR_DOCUMENTATION_SOURCE_DIR}/${f}) +endforeach() + +set(PROJECT_DOC_FILES ${PROJECT_DOC_FILES} ${LOCAL_DOC_FILES} PARENT_SCOPE) +set(PROJECT_IMG_FILES ${PROJECT_IMG_FILES} PARENT_SCOPE) diff --git a/doc/or_tools/por_bin_packing.rst b/doc/or_tools/por_bin_packing.rst new file mode 100644 index 0000000..2179fa0 --- /dev/null +++ b/doc/or_tools/por_bin_packing.rst @@ -0,0 +1,136 @@ +.. + **************************************************************************** + pgORpy Manual + Copyright(c) pgORpy Contributors + + This documentation is licensed under a Creative Commons Attribution-Share + Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/ + **************************************************************************** + +.. index:: + single: bin_packing + +| + +``por_bin_packing`` +=============================================================================== + +.. rubric:: Availability + +.. rubric:: Version 0.0.1 + +* New function +* Support for or-tools v9.10.4067 + +Description +------------------------------------------------------------------------------- + +The bin packing problem is an optimization problem, in which +items of different sizes must be packed into a finite number of bins or containers, +each of a fixed given capacity, in a way that minimizes the number of bins used. +The problem has many applications, such as filling up containers, loading trucks with weight capacity constraints, +creating file backups in media and technology mapping in FPGA semiconductor chip design. + + +Signatures +------------------------------------------------------------------------------- + +.. rubric:: Summary + +.. admonition:: \ \ + :class: signatures + + | por_bin_packing(`Weights SQL`_, bin_capacity, [``max_rows``]) + | Returns set of (bin_number, item_id) + | OR EMPTY SET + +Parameters +------------------------------------------------------------------------------- + +.. list-table:: + :width: 81 + :widths: 14 14 44 + :header-rows: 1 + + * - Column + - Type + - Description + * - `Weights SQL`_ + - ``TEXT`` + - `Weights SQL`_ as described below + * - bin_capacity + - **ANY-INTEGER** + - Maximum Capacity of the bin. + +Optional Parameters +............................................................................... + +.. list-table:: + :width: 81 + :widths: auto + :header-rows: 1 + + * - Column + - Type + - Default + - Description + * - ``max_rows`` + - **ANY-INTEGER** + - :math:`100000` + - Maximum items(rows) to fetch from bin_packing table. + +Where: + +:ANY-INTEGER: ``SMALLINT``, ``INTEGER``, ``BIGINT`` + +Inner Queries +------------------------------------------------------------------------------- + +Weights SQL +............................................................................... + + +.. include:: concepts.rst + :start-after: weights_start + :end-before: weights_end + +Result Columns +------------------------------------------------------------------------------- + +.. list-table:: + :width: 81 + :widths: auto + :header-rows: 1 + + * - Column + - Type + - Description + * - ``bin`` + - **ANY-INTEGER** + - Integer to uniquely identify a bin. + * - ``id`` + - **ANY-INTEGER** + - Indentifier of an item in the ``bin``. + +Where: + +:ANY-INTEGER: ``SMALLINT``, ``INTEGER``, ``BIGINT`` + +Example +------------------------------------------------------------------------------- + +.. literalinclude:: bin_packing.queries + :start-after: -- example_start + :end-before: -- example_end + +See Also +------------------------------------------------------------------------------- + +.. include:: concepts.rst + :start-after: see_also_start + :end-before: see_also_end + +.. rubric:: Indices and tables + +* :ref:`genindex` +* :ref:`search` diff --git a/doc/or_tools/por_knapsack.rst b/doc/or_tools/por_knapsack.rst new file mode 100644 index 0000000..bde4586 --- /dev/null +++ b/doc/or_tools/por_knapsack.rst @@ -0,0 +1,128 @@ +.. + **************************************************************************** + pgORpy Manual + Copyright(c) pgORpy Contributors + + This documentation is licensed under a Creative Commons Attribution-Share + Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/ + **************************************************************************** + +.. index:: + single: Knapsack problems ; por_knapsack + single: knapsack + +| + +``por_knapsack`` +=============================================================================== + +.. rubric:: Availability + +.. rubric:: Version 0.0.1 + +* New function +* Support for or-tools v9.10.4067 + +Description +------------------------------------------------------------------------------- + +The knapsack problem is a problem in combinatorial optimization: +Given a set of items, each with a weight and a value, +Determine the number of each item to include in a collection +so that the total weight is less than or equal to a given limit and the total +value is as large as possible + +Signatures +------------------------------------------------------------------------------- + +.. admonition:: \ \ + :class: signatures + + | por_knapsack(`Weight Costs SQL`_, capacity, [``max_rows``]) + | RETURNS SET OF (item_id) + | OR EMPTY SET + +Parameters +------------------------------------------------------------------------------- + +.. list-table:: + :width: 81 + :widths: 14 14 44 + :header-rows: 1 + + * - Column + - Type + - Description + * - `Weight Costs SQL`_ + - ``TEXT`` + - `Weight Costs SQL`_ as described below. + * - capacity + - **ANY-INTEGER** + - Maximum Capacity of the knapsack. + +Optional Parameters +............................................................................... + +.. list-table:: + :width: 81 + :widths: auto + :header-rows: 1 + + * - Column + - Type + - Default + - Description + * - ``max_rows`` + - **ANY-INTEGER** + - :math:`100000` + - Maximum items(rows) to fetch from knapsack table. + +Where: + +:ANY-INTEGER: ``SMALLINT``, ``INTEGER``, ``BIGINT`` + +Inner Queries +------------------------------------------------------------------------------- + +Weight Costs SQL +............................................................................... + +.. include:: concepts.rst + :start-after: weight_costs_start + :end-before: weight_costs_end + +Result Columns +------------------------------------------------------------------------------- + +.. list-table:: + :width: 81 + :widths: auto + :header-rows: 1 + + * - Column + - Type + - Description + * - ``id`` + - ``INTEGER`` + - Indentifier of an item in the knapsack. + +Where: + +:ANY-INTEGER: ``SMALLINT``, ``INTEGER``, ``BIGINT`` + +Example +------------------------------------------------------------------------------- + +.. literalinclude:: knapsack.queries + :start-after: -- example_start + :end-before: -- example_end + +See Also +------------------------------------------------------------------------------- + +* `OR-Tools: Google OR-Tools `__ + +.. rubric:: Indices and tables + +* :ref:`genindex` +* :ref:`search` diff --git a/doc/or_tools/por_multiple_knapsack.rst b/doc/or_tools/por_multiple_knapsack.rst new file mode 100644 index 0000000..6a8b14e --- /dev/null +++ b/doc/or_tools/por_multiple_knapsack.rst @@ -0,0 +1,123 @@ +.. + **************************************************************************** + pgORpy Manual + Copyright(c) pgORpy Contributors + This documentation is licensed under a Creative Commons Attribution-Share + Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/ + **************************************************************************** + +.. index:: + single: Knapsack problems ; por_multiple_knapsack + single: multiple_knapsack + +| + +``por_multiple_knapsack`` +=============================================================================== + +.. rubric:: Availability + +.. rubric:: Version 0.0.1 + +* New function +* Support for or-tools v9.10.4067 + +Description +------------------------------------------------------------------------------- + +The multiple knapsack problem is a problem in combinatorial optimization: +it is a more general verison of the classic knapsack problem where instead of a +single knapsack, you will be given multiple knapsacks and your goal is maximise the total +value of packed items in all knapsacks. + +Signatures +------------------------------------------------------------------------------- + +.. admonition:: \ \ + :class: signatures + + | por_multiple_knapsack(`Weight Costs SQL`_, capacities, [,``max_rows``]) + | RETURNS SET OF (knapsack, id) + | OR EMPTY SET + +Parameters +------------------------------------------------------------------------------- + +.. list-table:: + :width: 81 + :widths: 14 14 44 + :header-rows: 1 + + * - Column + - Type + - Description + * - `Weight Costs SQL`_ + - ``TEXT`` + - `Weight Costs SQL`_ as described below + * - capacities + - ``ARRAY[`` **ANY-INTEGER** ``]`` + - An array describing the capacity of each knapsack. + +Optional Parameters +............................................................................... + +.. list-table:: + :width: 81 + :widths: auto + :header-rows: 1 + + * - Column + - Type + - Default + - Description + * - ``max_rows`` + - **ANY-INTEGER** + - :math:`100000` + - Maximum items(rows) to fetch from bin_packing table. + +Inner Queries +------------------------------------------------------------------------------- + +Weight Costs SQL +............................................................................... + +.. include:: concepts.rst + :start-after: weight_costs_start + :end-before: weight_costs_end + +Result Columns +------------------------------------------------------------------------------- + +.. list-table:: + :width: 81 + :widths: auto + :header-rows: 1 + + * - Column + - Type + - Description + * - ``knapsak`` + - ``INTEGER`` + - Indentifier of the knapsack. + * - ``id`` + - ``INTEGER`` + - Indentifier of an item in the ``knapsack``. + +Example +------------------------------------------------------------------------------- + +.. literalinclude:: multiple_knapsack.queries + :start-after: -- example_start + :end-before: -- example_end + +See Also +------------------------------------------------------------------------------- + +.. include:: concepts.rst + :start-after: see_also_start + :end-before: see_also_end + +.. rubric:: Indices and tables + +* :ref:`genindex` +* :ref:`search` diff --git a/docqueries/or_tools/CMakeLists.txt b/docqueries/or_tools/CMakeLists.txt new file mode 100644 index 0000000..8f94925 --- /dev/null +++ b/docqueries/or_tools/CMakeLists.txt @@ -0,0 +1,11 @@ +SET(LOCAL_FILES + knapsack + multiple_knapsack + bin_packing + ) + +foreach (f ${LOCAL_FILES}) + configure_file("${f}.result" "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}.queries") + list(APPEND LOCAL_DOC_FILES "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}.queries") +endforeach() +set(PROJECT_DOC_FILES ${PROJECT_DOC_FILES} ${LOCAL_DOC_FILES} PARENT_SCOPE) diff --git a/docqueries/or_tools/bin_packing.pg b/docqueries/or_tools/bin_packing.pg new file mode 100644 index 0000000..9a48fe4 --- /dev/null +++ b/docqueries/or_tools/bin_packing.pg @@ -0,0 +1,7 @@ +-- CopyRight(c) pgRouting developers +-- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/ + +/* -- example_start */ +SELECT * +FROM por_bin_packing($$SELECT id, weight FROM bin_packing$$, 100); +/* -- example_end */ diff --git a/docqueries/or_tools/bin_packing.result b/docqueries/or_tools/bin_packing.result new file mode 100644 index 0000000..9e5f028 --- /dev/null +++ b/docqueries/or_tools/bin_packing.result @@ -0,0 +1,25 @@ +BEGIN; +BEGIN +SET client_min_messages TO NOTICE; +SET +/* -- example_start */ +SELECT * +FROM por_bin_packing($$SELECT id, weight FROM bin_packing$$, 100); + bin | id +-----+---- + 1 | 1 + 1 | 2 + 1 | 3 + 2 | 4 + 2 | 5 + 2 | 6 + 3 | 7 + 3 | 8 + 4 | 9 + 4 | 10 + 4 | 11 +(11 rows) + +/* -- example_end */ +ROLLBACK; +ROLLBACK diff --git a/docqueries/or_tools/knapsack.pg b/docqueries/or_tools/knapsack.pg new file mode 100644 index 0000000..7f99e05 --- /dev/null +++ b/docqueries/or_tools/knapsack.pg @@ -0,0 +1,7 @@ +-- CopyRight(c) pgRouting developers +-- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/ + +/* -- example_start */ +SELECT * +FROM por_knapsack($$SELECT * FROM knapsack$$, 15); +/* -- example_end */ diff --git a/docqueries/or_tools/knapsack.result b/docqueries/or_tools/knapsack.result new file mode 100644 index 0000000..866a57d --- /dev/null +++ b/docqueries/or_tools/knapsack.result @@ -0,0 +1,18 @@ +BEGIN; +BEGIN +SET client_min_messages TO NOTICE; +SET +/* -- example_start */ +SELECT * +FROM por_knapsack($$SELECT * FROM knapsack$$, 15); + id +---- + 2 + 3 + 4 + 5 +(4 rows) + +/* -- example_end */ +ROLLBACK; +ROLLBACK diff --git a/docqueries/or_tools/multiple_knapsack.pg b/docqueries/or_tools/multiple_knapsack.pg new file mode 100644 index 0000000..a8569b6 --- /dev/null +++ b/docqueries/or_tools/multiple_knapsack.pg @@ -0,0 +1,7 @@ +-- CopyRight(c) pgRouting developers +-- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/ + +/* -- example_start */ +SELECT * +FROM por_multiple_knapsack($$SELECT id, weight, cost FROM multiple_knapsack$$, ARRAY[100,100,100,100,100]); +/* -- example_end */ diff --git a/docqueries/or_tools/multiple_knapsack.result b/docqueries/or_tools/multiple_knapsack.result new file mode 100644 index 0000000..7cb5713 --- /dev/null +++ b/docqueries/or_tools/multiple_knapsack.result @@ -0,0 +1,26 @@ +BEGIN; +BEGIN +SET client_min_messages TO NOTICE; +SET +/* -- example_start */ +SELECT * +FROM por_multiple_knapsack($$SELECT id, weight, cost FROM multiple_knapsack$$, ARRAY[100,100,100,100,100]); + knapsack | id +----------+---- + 1 | 2 + 1 | 9 + 1 | 11 + 2 | 4 + 2 | 5 + 2 | 10 + 3 | 8 + 3 | 13 + 4 | 3 + 4 | 6 + 5 | 14 + 5 | 15 +(12 rows) + +/* -- example_end */ +ROLLBACK; +ROLLBACK diff --git a/docqueries/or_tools/test.conf b/docqueries/or_tools/test.conf new file mode 100644 index 0000000..03bbe61 --- /dev/null +++ b/docqueries/or_tools/test.conf @@ -0,0 +1,13 @@ +#!/usr/bin/perl -w + +%main::tests = ( + 'any' => { + 'files' => [qw( + knapsack.pg + multiple_knapsack.pg + bin_packing.pg + )], + }, +); + +1; diff --git a/docqueries/version/full_version.result b/docqueries/version/full_version.result index f8e0708..65aba1c 100644 --- a/docqueries/version/full_version.result +++ b/docqueries/version/full_version.result @@ -6,7 +6,7 @@ SET SELECT * FROM por_full_version(); version | or_tools ---------+----------- - 0.0.0 | 9.10.4067 + 0.0.1 | 9.10.4067 (1 row) /* -- q2 */ diff --git a/docqueries/version/version.result b/docqueries/version/version.result index 472f9f3..23badba 100644 --- a/docqueries/version/version.result +++ b/docqueries/version/version.result @@ -6,7 +6,7 @@ SET SELECT por_version(); por_version ------------- - 0.0.0 + 0.0.1 (1 row) /* -- q2 */ diff --git a/locale/en/LC_MESSAGES/concepts.po b/locale/en/LC_MESSAGES/concepts.po new file mode 100644 index 0000000..0a99618 --- /dev/null +++ b/locale/en/LC_MESSAGES/concepts.po @@ -0,0 +1,141 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) pgORpy Contributors - Version 0.0 +# This file is distributed under the same license as the pgORpy package. +# FIRST AUTHOR , 2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: pgORpy 0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" + +msgid "Concepts" +msgstr "" + +msgid "Contents" +msgstr "" + +msgid "Synopsis" +msgstr "" + +msgid "" +"OR-Tools is an open source software suite for optimization, tuned for " +"tackling the world's toughest problems in vehicle routing, flows, integer" +" and linear programming, and constraint programming." +msgstr "" + +msgid "OR-Tools can solve" +msgstr "" + +msgid "VR (Vehicle Routing)" +msgstr "" + +msgid "Scheduling" +msgstr "" + +msgid "Bin Packing" +msgstr "" + +msgid "Currently only Bin Packing problems can be solved with OR-Tools in pgORpy." +msgstr "" + +msgid "Terminologies" +msgstr "" + +msgid "" +"**weight**: For each item, a positive integer weight is associated with " +"it." +msgstr "" + +msgid "" +"**cost**: For each item, a positive integer cost(value) is associated " +"with it." +msgstr "" + +msgid "**capacity**: Maximum storage capacity of a knapsack or a bin." +msgstr "" + +msgid "Inner Queries" +msgstr "" + +msgid "Weight Costs SQL" +msgstr "" + +msgid "A ``SELECT`` statement that returns the following columns:" +msgstr "" + +msgid "Column" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "``id``" +msgstr "" + +msgid "**ANY-INTEGER**" +msgstr "" + +msgid "Unique identifier of the item." +msgstr "" + +msgid "``weight``" +msgstr "" + +msgid "Weight of the item." +msgstr "" + +msgid "``cost``" +msgstr "" + +msgid "Cost of the item." +msgstr "" + +msgid "Where:" +msgstr "" + +msgid "ANY-INTEGER" +msgstr "" + +msgid "``SMALLINT``, ``INTEGER``, ``BIGINT``" +msgstr "" + +msgid "Weights SQL" +msgstr "" + +msgid "Identifier of the item." +msgstr "" + +msgid "See Also" +msgstr "" + +msgid "" +"`Wikipedia: Bin Packing problems " +"`__" +msgstr "" + +msgid "`OR-Tools: Google OR-Tools `__" +msgstr "" + +msgid "Indices and tables" +msgstr "" + +msgid ":ref:`genindex`" +msgstr "" + +msgid ":ref:`search`" +msgstr "" + diff --git a/locale/en/LC_MESSAGES/functions.po b/locale/en/LC_MESSAGES/functions.po index fda3d59..15e1eb0 100644 --- a/locale/en/LC_MESSAGES/functions.po +++ b/locale/en/LC_MESSAGES/functions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -31,6 +31,18 @@ msgstr "" msgid ":doc:`por_full_version`" msgstr "" +msgid "OR-tools" +msgstr "" + +msgid ":doc:`por_bin_packing`" +msgstr "" + +msgid ":doc:`por_knapsack`" +msgstr "" + +msgid ":doc:`por_multiple_knapsack`" +msgstr "" + msgid "Indices and tables" msgstr "" diff --git a/locale/en/LC_MESSAGES/index.po b/locale/en/LC_MESSAGES/index.po index c9d553b..ab6323d 100644 --- a/locale/en/LC_MESSAGES/index.po +++ b/locale/en/LC_MESSAGES/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:51-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -62,30 +62,48 @@ msgstr "" msgid ":doc:`por_full_version`" msgstr "" +msgid "OR-tools" +msgstr "" + +msgid ":doc:`por_bin_packing`" +msgstr "" + +msgid ":doc:`por_knapsack`" +msgstr "" + +msgid ":doc:`por_multiple_knapsack`" +msgstr "" + msgid ":doc:`release_notes`" msgstr "" -msgid "pgORpy 0.0.0 Release Notes" +msgid "pgORpy 0.0.1 Release Notes" msgstr "" #, python-format msgid "" "To see all issues & pull requests closed by this release see the `Git " -"closed milestone for 0.0.0 " -"`_" +"closed milestone for 0.0.1 " +"`_" " on Github." msgstr "" msgid "Version functions" msgstr "" -msgid "por_version" +msgid "por_bin_backing" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" msgstr "" -msgid "Official function" +msgid "por_knapsack" msgstr "" -msgid "por_full_version" +msgid "por_multiple_knapsack" msgstr "" msgid "Indices and tables" diff --git a/locale/en/LC_MESSAGES/installation.po b/locale/en/LC_MESSAGES/installation.po index d6687ba..2855dcf 100644 --- a/locale/en/LC_MESSAGES/installation.po +++ b/locale/en/LC_MESSAGES/installation.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" diff --git a/locale/en/LC_MESSAGES/introduction.po b/locale/en/LC_MESSAGES/introduction.po index 352a9b8..e113a97 100644 --- a/locale/en/LC_MESSAGES/introduction.po +++ b/locale/en/LC_MESSAGES/introduction.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 12:24-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -100,6 +100,18 @@ msgstr "" msgid "Github actions for documentation publishing and release" msgstr "" +msgid "Manas Sivakumar" +msgstr "" + +msgid "por_bin_backing" +msgstr "" + +msgid "por_knapsack" +msgstr "" + +msgid "por_multiple_knapsack" +msgstr "" + msgid "Virginia Vergara" msgstr "" @@ -131,6 +143,12 @@ msgstr "" msgid "`Ashish Kumar `__" msgstr "" +msgid "`Manas Sivakumar `__" +msgstr "" + +msgid "Support for or-tools v9.10.4067 on the following functions" +msgstr "" + msgid "`Vicky Vergara `__" msgstr "" diff --git a/locale/en/LC_MESSAGES/por_bin_packing.po b/locale/en/LC_MESSAGES/por_bin_packing.po new file mode 100644 index 0000000..6f42fd2 --- /dev/null +++ b/locale/en/LC_MESSAGES/por_bin_packing.po @@ -0,0 +1,174 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) pgORpy Contributors - Version 0.0 +# This file is distributed under the same license as the pgORpy package. +# FIRST AUTHOR , 2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: pgORpy 0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" + +msgid "``por_bin_packing``" +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "Version 0.0.1" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "" +"The bin packing problem is an optimization problem, in which items of " +"different sizes must be packed into a finite number of bins or " +"containers, each of a fixed given capacity, in a way that minimizes the " +"number of bins used. The problem has many applications, such as filling " +"up containers, loading trucks with weight capacity constraints, creating " +"file backups in media and technology mapping in FPGA semiconductor chip " +"design." +msgstr "" + +msgid "Signatures" +msgstr "" + +msgid "Summary" +msgstr "" + +msgid "\\ \\" +msgstr "" + +msgid "por_bin_packing(`Weights SQL`_, bin_capacity, [``max_rows``])" +msgstr "" + +msgid "Returns set of (bin_number, item_id)" +msgstr "" + +msgid "OR EMPTY SET" +msgstr "" + +msgid "Parameters" +msgstr "" + +msgid "Column" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "`Weights SQL`_" +msgstr "" + +msgid "``TEXT``" +msgstr "" + +msgid "`Weights SQL`_ as described below" +msgstr "" + +msgid "bin_capacity" +msgstr "" + +msgid "**ANY-INTEGER**" +msgstr "" + +msgid "Maximum Capacity of the bin." +msgstr "" + +msgid "Optional Parameters" +msgstr "" + +msgid "Default" +msgstr "" + +msgid "``max_rows``" +msgstr "" + +msgid ":math:`100000`" +msgstr "" + +msgid "Maximum items(rows) to fetch from bin_packing table." +msgstr "" + +msgid "Where:" +msgstr "" + +msgid "ANY-INTEGER" +msgstr "" + +msgid "``SMALLINT``, ``INTEGER``, ``BIGINT``" +msgstr "" + +msgid "Inner Queries" +msgstr "" + +msgid "Weights SQL" +msgstr "" + +msgid "A ``SELECT`` statement that returns the following columns:" +msgstr "" + +msgid "``id``" +msgstr "" + +msgid "Identifier of the item." +msgstr "" + +msgid "``weight``" +msgstr "" + +msgid "Weight of the item." +msgstr "" + +msgid "Result Columns" +msgstr "" + +msgid "``bin``" +msgstr "" + +msgid "Integer to uniquely identify a bin." +msgstr "" + +msgid "Indentifier of an item in the ``bin``." +msgstr "" + +msgid "Example" +msgstr "" + +msgid "See Also" +msgstr "" + +msgid "" +"`Wikipedia: Bin Packing problems " +"`__" +msgstr "" + +msgid "`OR-Tools: Google OR-Tools `__" +msgstr "" + +msgid "Indices and tables" +msgstr "" + +msgid ":ref:`genindex`" +msgstr "" + +msgid ":ref:`search`" +msgstr "" + diff --git a/locale/en/LC_MESSAGES/por_full_version.po b/locale/en/LC_MESSAGES/por_full_version.po index e775d28..63b69b0 100644 --- a/locale/en/LC_MESSAGES/por_full_version.po +++ b/locale/en/LC_MESSAGES/por_full_version.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" diff --git a/locale/en/LC_MESSAGES/por_knapsack.po b/locale/en/LC_MESSAGES/por_knapsack.po new file mode 100644 index 0000000..de0f89f --- /dev/null +++ b/locale/en/LC_MESSAGES/por_knapsack.po @@ -0,0 +1,164 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) pgORpy Contributors - Version 0.0 +# This file is distributed under the same license as the pgORpy package. +# FIRST AUTHOR , 2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: pgORpy 0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" + +msgid "``por_knapsack``" +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "Version 0.0.1" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "" +"The knapsack problem is a problem in combinatorial optimization: Given a " +"set of items, each with a weight and a value, Determine the number of " +"each item to include in a collection so that the total weight is less " +"than or equal to a given limit and the total value is as large as " +"possible" +msgstr "" + +msgid "Signatures" +msgstr "" + +msgid "\\ \\" +msgstr "" + +msgid "por_knapsack(`Weight Costs SQL`_, capacity, [``max_rows``])" +msgstr "" + +msgid "RETURNS SET OF (item_id)" +msgstr "" + +msgid "OR EMPTY SET" +msgstr "" + +msgid "Parameters" +msgstr "" + +msgid "Column" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "`Weight Costs SQL`_" +msgstr "" + +msgid "``TEXT``" +msgstr "" + +msgid "`Weight Costs SQL`_ as described below." +msgstr "" + +msgid "capacity" +msgstr "" + +msgid "**ANY-INTEGER**" +msgstr "" + +msgid "Maximum Capacity of the knapsack." +msgstr "" + +msgid "Optional Parameters" +msgstr "" + +msgid "Default" +msgstr "" + +msgid "``max_rows``" +msgstr "" + +msgid ":math:`100000`" +msgstr "" + +msgid "Maximum items(rows) to fetch from knapsack table." +msgstr "" + +msgid "Where:" +msgstr "" + +msgid "ANY-INTEGER" +msgstr "" + +msgid "``SMALLINT``, ``INTEGER``, ``BIGINT``" +msgstr "" + +msgid "Inner Queries" +msgstr "" + +msgid "Weight Costs SQL" +msgstr "" + +msgid "``id``" +msgstr "" + +msgid "Unique identifier of the item." +msgstr "" + +msgid "``weight``" +msgstr "" + +msgid "Weight of the item." +msgstr "" + +msgid "``cost``" +msgstr "" + +msgid "Cost of the item." +msgstr "" + +msgid "Result Columns" +msgstr "" + +msgid "``INTEGER``" +msgstr "" + +msgid "Indentifier of an item in the knapsack." +msgstr "" + +msgid "Example" +msgstr "" + +msgid "See Also" +msgstr "" + +msgid "`OR-Tools: Google OR-Tools `__" +msgstr "" + +msgid "Indices and tables" +msgstr "" + +msgid ":ref:`genindex`" +msgstr "" + +msgid ":ref:`search`" +msgstr "" + diff --git a/locale/en/LC_MESSAGES/por_multiple_knapsack.po b/locale/en/LC_MESSAGES/por_multiple_knapsack.po new file mode 100644 index 0000000..8b2de52 --- /dev/null +++ b/locale/en/LC_MESSAGES/por_multiple_knapsack.po @@ -0,0 +1,177 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) pgORpy Contributors - Version 0.0 +# This file is distributed under the same license as the pgORpy package. +# FIRST AUTHOR , 2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: pgORpy 0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" + +msgid "``por_multiple_knapsack``" +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "Version 0.0.1" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "" +"The multiple knapsack problem is a problem in combinatorial optimization:" +" it is a more general verison of the classic knapsack problem where " +"instead of a single knapsack, you will be given multiple knapsacks and " +"your goal is maximise the total value of packed items in all knapsacks." +msgstr "" + +msgid "Signatures" +msgstr "" + +msgid "\\ \\" +msgstr "" + +msgid "por_multiple_knapsack(`Weight Costs SQL`_, capacities, [,``max_rows``])" +msgstr "" + +msgid "RETURNS SET OF (knapsack, id)" +msgstr "" + +msgid "OR EMPTY SET" +msgstr "" + +msgid "Parameters" +msgstr "" + +msgid "Column" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "`Weight Costs SQL`_" +msgstr "" + +msgid "``TEXT``" +msgstr "" + +msgid "`Weight Costs SQL`_ as described below" +msgstr "" + +msgid "capacities" +msgstr "" + +msgid "``ARRAY[`` **ANY-INTEGER** ``]``" +msgstr "" + +msgid "An array describing the capacity of each knapsack." +msgstr "" + +msgid "Optional Parameters" +msgstr "" + +msgid "Default" +msgstr "" + +msgid "``max_rows``" +msgstr "" + +msgid "**ANY-INTEGER**" +msgstr "" + +msgid ":math:`100000`" +msgstr "" + +msgid "Maximum items(rows) to fetch from bin_packing table." +msgstr "" + +msgid "Inner Queries" +msgstr "" + +msgid "Weight Costs SQL" +msgstr "" + +msgid "``id``" +msgstr "" + +msgid "Unique identifier of the item." +msgstr "" + +msgid "``weight``" +msgstr "" + +msgid "Weight of the item." +msgstr "" + +msgid "``cost``" +msgstr "" + +msgid "Cost of the item." +msgstr "" + +msgid "Where:" +msgstr "" + +msgid "ANY-INTEGER" +msgstr "" + +msgid "``SMALLINT``, ``INTEGER``, ``BIGINT``" +msgstr "" + +msgid "Result Columns" +msgstr "" + +msgid "``knapsak``" +msgstr "" + +msgid "``INTEGER``" +msgstr "" + +msgid "Indentifier of the knapsack." +msgstr "" + +msgid "Indentifier of an item in the ``knapsack``." +msgstr "" + +msgid "Example" +msgstr "" + +msgid "See Also" +msgstr "" + +msgid "" +"`Wikipedia: Bin Packing problems " +"`__" +msgstr "" + +msgid "`OR-Tools: Google OR-Tools `__" +msgstr "" + +msgid "Indices and tables" +msgstr "" + +msgid ":ref:`genindex`" +msgstr "" + +msgid ":ref:`search`" +msgstr "" + diff --git a/locale/en/LC_MESSAGES/por_version.po b/locale/en/LC_MESSAGES/por_version.po index 278a1f5..7f0a0dd 100644 --- a/locale/en/LC_MESSAGES/por_version.po +++ b/locale/en/LC_MESSAGES/por_version.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" diff --git a/locale/en/LC_MESSAGES/release_notes.po b/locale/en/LC_MESSAGES/release_notes.po index 4c91bea..bef2efc 100644 --- a/locale/en/LC_MESSAGES/release_notes.po +++ b/locale/en/LC_MESSAGES/release_notes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -42,20 +42,46 @@ msgstr "" msgid "Contents" msgstr "" -msgid "pgORpy 0.0.0 Release Notes" +msgid "pgORpy 0.0.1 Release Notes" msgstr "" #, python-format msgid "" "To see all issues & pull requests closed by this release see the `Git " -"closed milestone for 0.0.0 " -"`_" +"closed milestone for 0.0.1 " +"`_" " on Github." msgstr "" msgid "Version functions" msgstr "" +msgid "por_bin_backing" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" +msgstr "" + +msgid "por_knapsack" +msgstr "" + +msgid "por_multiple_knapsack" +msgstr "" + +msgid "pgORpy 0.0.0 Release Notes" +msgstr "" + +#, python-format +msgid "" +"To see all issues & pull requests closed by this release see the `Git " +"closed milestone for 0.0.0 " +"`_" +" on Github." +msgstr "" + msgid "por_version" msgstr "" diff --git a/locale/en/LC_MESSAGES/sampledata.po b/locale/en/LC_MESSAGES/sampledata.po index 08dd49c..29a130f 100644 --- a/locale/en/LC_MESSAGES/sampledata.po +++ b/locale/en/LC_MESSAGES/sampledata.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -31,3 +31,6 @@ msgstr "" msgid "Function to activate python on a local environment" msgstr "" +msgid "Sample data" +msgstr "" + diff --git a/locale/en/LC_MESSAGES/support.po b/locale/en/LC_MESSAGES/support.po index 1ce377e..56e1088 100644 --- a/locale/en/LC_MESSAGES/support.po +++ b/locale/en/LC_MESSAGES/support.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" diff --git a/locale/pot/concepts.pot b/locale/pot/concepts.pot new file mode 100644 index 0000000..58a2605 --- /dev/null +++ b/locale/pot/concepts.pot @@ -0,0 +1,128 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) pgORpy Contributors - Version 0.0 +# This file is distributed under the same license as the pgORpy package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: pgORpy 0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "Concepts" +msgstr "" + +msgid "Contents" +msgstr "" + +msgid "Synopsis" +msgstr "" + +msgid "OR-Tools is an open source software suite for optimization, tuned for tackling the world's toughest problems in vehicle routing, flows, integer and linear programming, and constraint programming." +msgstr "" + +msgid "OR-Tools can solve" +msgstr "" + +msgid "VR (Vehicle Routing)" +msgstr "" + +msgid "Scheduling" +msgstr "" + +msgid "Bin Packing" +msgstr "" + +msgid "Currently only Bin Packing problems can be solved with OR-Tools in pgORpy." +msgstr "" + +msgid "Terminologies" +msgstr "" + +msgid "**weight**: For each item, a positive integer weight is associated with it." +msgstr "" + +msgid "**cost**: For each item, a positive integer cost(value) is associated with it." +msgstr "" + +msgid "**capacity**: Maximum storage capacity of a knapsack or a bin." +msgstr "" + +msgid "Inner Queries" +msgstr "" + +msgid "Weight Costs SQL" +msgstr "" + +msgid "A ``SELECT`` statement that returns the following columns:" +msgstr "" + +msgid "Column" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "``id``" +msgstr "" + +msgid "**ANY-INTEGER**" +msgstr "" + +msgid "Unique identifier of the item." +msgstr "" + +msgid "``weight``" +msgstr "" + +msgid "Weight of the item." +msgstr "" + +msgid "``cost``" +msgstr "" + +msgid "Cost of the item." +msgstr "" + +msgid "Where:" +msgstr "" + +msgid "ANY-INTEGER" +msgstr "" + +msgid "``SMALLINT``, ``INTEGER``, ``BIGINT``" +msgstr "" + +msgid "Weights SQL" +msgstr "" + +msgid "Identifier of the item." +msgstr "" + +msgid "See Also" +msgstr "" + +msgid "`Wikipedia: Bin Packing problems `__" +msgstr "" + +msgid "`OR-Tools: Google OR-Tools `__" +msgstr "" + +msgid "Indices and tables" +msgstr "" + +msgid ":ref:`genindex`" +msgstr "" + +msgid ":ref:`search`" +msgstr "" diff --git a/locale/pot/functions.pot b/locale/pot/functions.pot index 8fb5c14..655a73e 100644 --- a/locale/pot/functions.pot +++ b/locale/pot/functions.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -28,6 +28,18 @@ msgstr "" msgid ":doc:`por_full_version`" msgstr "" +msgid "OR-tools" +msgstr "" + +msgid ":doc:`por_bin_packing`" +msgstr "" + +msgid ":doc:`por_knapsack`" +msgstr "" + +msgid ":doc:`por_multiple_knapsack`" +msgstr "" + msgid "Indices and tables" msgstr "" diff --git a/locale/pot/index.pot b/locale/pot/index.pot index 51f2a05..9fb102a 100644 --- a/locale/pot/index.pot +++ b/locale/pot/index.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:51-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,25 +52,43 @@ msgstr "" msgid ":doc:`por_full_version`" msgstr "" +msgid "OR-tools" +msgstr "" + +msgid ":doc:`por_bin_packing`" +msgstr "" + +msgid ":doc:`por_knapsack`" +msgstr "" + +msgid ":doc:`por_multiple_knapsack`" +msgstr "" + msgid ":doc:`release_notes`" msgstr "" -msgid "pgORpy 0.0.0 Release Notes" +msgid "pgORpy 0.0.1 Release Notes" msgstr "" -msgid "To see all issues & pull requests closed by this release see the `Git closed milestone for 0.0.0 `_ on Github." +msgid "To see all issues & pull requests closed by this release see the `Git closed milestone for 0.0.1 `_ on Github." msgstr "" msgid "Version functions" msgstr "" -msgid "por_version" +msgid "por_bin_backing" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" msgstr "" -msgid "Official function" +msgid "por_knapsack" msgstr "" -msgid "por_full_version" +msgid "por_multiple_knapsack" msgstr "" msgid "Indices and tables" diff --git a/locale/pot/installation.pot b/locale/pot/installation.pot index c2b6f86..60675bb 100644 --- a/locale/pot/installation.pot +++ b/locale/pot/installation.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/pot/introduction.pot b/locale/pot/introduction.pot index e25cacf..60a8fca 100644 --- a/locale/pot/introduction.pot +++ b/locale/pot/introduction.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 12:24-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -82,6 +82,18 @@ msgstr "" msgid "Github actions for documentation publishing and release" msgstr "" +msgid "Manas Sivakumar" +msgstr "" + +msgid "por_bin_backing" +msgstr "" + +msgid "por_knapsack" +msgstr "" + +msgid "por_multiple_knapsack" +msgstr "" + msgid "Virginia Vergara" msgstr "" @@ -109,6 +121,12 @@ msgstr "" msgid "`Ashish Kumar `__" msgstr "" +msgid "`Manas Sivakumar `__" +msgstr "" + +msgid "Support for or-tools v9.10.4067 on the following functions" +msgstr "" + msgid "`Vicky Vergara `__" msgstr "" diff --git a/locale/pot/por_bin_packing.pot b/locale/pot/por_bin_packing.pot new file mode 100644 index 0000000..26113e3 --- /dev/null +++ b/locale/pot/por_bin_packing.pot @@ -0,0 +1,161 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) pgORpy Contributors - Version 0.0 +# This file is distributed under the same license as the pgORpy package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: pgORpy 0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "``por_bin_packing``" +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "Version 0.0.1" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "The bin packing problem is an optimization problem, in which items of different sizes must be packed into a finite number of bins or containers, each of a fixed given capacity, in a way that minimizes the number of bins used. The problem has many applications, such as filling up containers, loading trucks with weight capacity constraints, creating file backups in media and technology mapping in FPGA semiconductor chip design." +msgstr "" + +msgid "Signatures" +msgstr "" + +msgid "Summary" +msgstr "" + +msgid "\\ \\" +msgstr "" + +msgid "por_bin_packing(`Weights SQL`_, bin_capacity, [``max_rows``])" +msgstr "" + +msgid "Returns set of (bin_number, item_id)" +msgstr "" + +msgid "OR EMPTY SET" +msgstr "" + +msgid "Parameters" +msgstr "" + +msgid "Column" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "`Weights SQL`_" +msgstr "" + +msgid "``TEXT``" +msgstr "" + +msgid "`Weights SQL`_ as described below" +msgstr "" + +msgid "bin_capacity" +msgstr "" + +msgid "**ANY-INTEGER**" +msgstr "" + +msgid "Maximum Capacity of the bin." +msgstr "" + +msgid "Optional Parameters" +msgstr "" + +msgid "Default" +msgstr "" + +msgid "``max_rows``" +msgstr "" + +msgid ":math:`100000`" +msgstr "" + +msgid "Maximum items(rows) to fetch from bin_packing table." +msgstr "" + +msgid "Where:" +msgstr "" + +msgid "ANY-INTEGER" +msgstr "" + +msgid "``SMALLINT``, ``INTEGER``, ``BIGINT``" +msgstr "" + +msgid "Inner Queries" +msgstr "" + +msgid "Weights SQL" +msgstr "" + +msgid "A ``SELECT`` statement that returns the following columns:" +msgstr "" + +msgid "``id``" +msgstr "" + +msgid "Identifier of the item." +msgstr "" + +msgid "``weight``" +msgstr "" + +msgid "Weight of the item." +msgstr "" + +msgid "Result Columns" +msgstr "" + +msgid "``bin``" +msgstr "" + +msgid "Integer to uniquely identify a bin." +msgstr "" + +msgid "Indentifier of an item in the ``bin``." +msgstr "" + +msgid "Example" +msgstr "" + +msgid "See Also" +msgstr "" + +msgid "`Wikipedia: Bin Packing problems `__" +msgstr "" + +msgid "`OR-Tools: Google OR-Tools `__" +msgstr "" + +msgid "Indices and tables" +msgstr "" + +msgid ":ref:`genindex`" +msgstr "" + +msgid ":ref:`search`" +msgstr "" diff --git a/locale/pot/por_full_version.pot b/locale/pot/por_full_version.pot index fac8d76..377177e 100644 --- a/locale/pot/por_full_version.pot +++ b/locale/pot/por_full_version.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/pot/por_knapsack.pot b/locale/pot/por_knapsack.pot new file mode 100644 index 0000000..58d274d --- /dev/null +++ b/locale/pot/por_knapsack.pot @@ -0,0 +1,155 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) pgORpy Contributors - Version 0.0 +# This file is distributed under the same license as the pgORpy package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: pgORpy 0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "``por_knapsack``" +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "Version 0.0.1" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "The knapsack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, Determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible" +msgstr "" + +msgid "Signatures" +msgstr "" + +msgid "\\ \\" +msgstr "" + +msgid "por_knapsack(`Weight Costs SQL`_, capacity, [``max_rows``])" +msgstr "" + +msgid "RETURNS SET OF (item_id)" +msgstr "" + +msgid "OR EMPTY SET" +msgstr "" + +msgid "Parameters" +msgstr "" + +msgid "Column" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "`Weight Costs SQL`_" +msgstr "" + +msgid "``TEXT``" +msgstr "" + +msgid "`Weight Costs SQL`_ as described below." +msgstr "" + +msgid "capacity" +msgstr "" + +msgid "**ANY-INTEGER**" +msgstr "" + +msgid "Maximum Capacity of the knapsack." +msgstr "" + +msgid "Optional Parameters" +msgstr "" + +msgid "Default" +msgstr "" + +msgid "``max_rows``" +msgstr "" + +msgid ":math:`100000`" +msgstr "" + +msgid "Maximum items(rows) to fetch from knapsack table." +msgstr "" + +msgid "Where:" +msgstr "" + +msgid "ANY-INTEGER" +msgstr "" + +msgid "``SMALLINT``, ``INTEGER``, ``BIGINT``" +msgstr "" + +msgid "Inner Queries" +msgstr "" + +msgid "Weight Costs SQL" +msgstr "" + +msgid "``id``" +msgstr "" + +msgid "Unique identifier of the item." +msgstr "" + +msgid "``weight``" +msgstr "" + +msgid "Weight of the item." +msgstr "" + +msgid "``cost``" +msgstr "" + +msgid "Cost of the item." +msgstr "" + +msgid "Result Columns" +msgstr "" + +msgid "``INTEGER``" +msgstr "" + +msgid "Indentifier of an item in the knapsack." +msgstr "" + +msgid "Example" +msgstr "" + +msgid "See Also" +msgstr "" + +msgid "`OR-Tools: Google OR-Tools `__" +msgstr "" + +msgid "Indices and tables" +msgstr "" + +msgid ":ref:`genindex`" +msgstr "" + +msgid ":ref:`search`" +msgstr "" diff --git a/locale/pot/por_multiple_knapsack.pot b/locale/pot/por_multiple_knapsack.pot new file mode 100644 index 0000000..1599bc3 --- /dev/null +++ b/locale/pot/por_multiple_knapsack.pot @@ -0,0 +1,167 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) pgORpy Contributors - Version 0.0 +# This file is distributed under the same license as the pgORpy package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: pgORpy 0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "``por_multiple_knapsack``" +msgstr "" + +msgid "Availability" +msgstr "" + +msgid "Version 0.0.1" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" +msgstr "" + +msgid "Description" +msgstr "" + +msgid "The multiple knapsack problem is a problem in combinatorial optimization: it is a more general verison of the classic knapsack problem where instead of a single knapsack, you will be given multiple knapsacks and your goal is maximise the total value of packed items in all knapsacks." +msgstr "" + +msgid "Signatures" +msgstr "" + +msgid "\\ \\" +msgstr "" + +msgid "por_multiple_knapsack(`Weight Costs SQL`_, capacities, [,``max_rows``])" +msgstr "" + +msgid "RETURNS SET OF (knapsack, id)" +msgstr "" + +msgid "OR EMPTY SET" +msgstr "" + +msgid "Parameters" +msgstr "" + +msgid "Column" +msgstr "" + +msgid "Type" +msgstr "" + +msgid "`Weight Costs SQL`_" +msgstr "" + +msgid "``TEXT``" +msgstr "" + +msgid "`Weight Costs SQL`_ as described below" +msgstr "" + +msgid "capacities" +msgstr "" + +msgid "``ARRAY[`` **ANY-INTEGER** ``]``" +msgstr "" + +msgid "An array describing the capacity of each knapsack." +msgstr "" + +msgid "Optional Parameters" +msgstr "" + +msgid "Default" +msgstr "" + +msgid "``max_rows``" +msgstr "" + +msgid "**ANY-INTEGER**" +msgstr "" + +msgid ":math:`100000`" +msgstr "" + +msgid "Maximum items(rows) to fetch from bin_packing table." +msgstr "" + +msgid "Inner Queries" +msgstr "" + +msgid "Weight Costs SQL" +msgstr "" + +msgid "``id``" +msgstr "" + +msgid "Unique identifier of the item." +msgstr "" + +msgid "``weight``" +msgstr "" + +msgid "Weight of the item." +msgstr "" + +msgid "``cost``" +msgstr "" + +msgid "Cost of the item." +msgstr "" + +msgid "Where:" +msgstr "" + +msgid "ANY-INTEGER" +msgstr "" + +msgid "``SMALLINT``, ``INTEGER``, ``BIGINT``" +msgstr "" + +msgid "Result Columns" +msgstr "" + +msgid "``knapsak``" +msgstr "" + +msgid "``INTEGER``" +msgstr "" + +msgid "Indentifier of the knapsack." +msgstr "" + +msgid "Indentifier of an item in the ``knapsack``." +msgstr "" + +msgid "Example" +msgstr "" + +msgid "See Also" +msgstr "" + +msgid "`Wikipedia: Bin Packing problems `__" +msgstr "" + +msgid "`OR-Tools: Google OR-Tools `__" +msgstr "" + +msgid "Indices and tables" +msgstr "" + +msgid ":ref:`genindex`" +msgstr "" + +msgid ":ref:`search`" +msgstr "" diff --git a/locale/pot/por_version.pot b/locale/pot/por_version.pot index ba9de7f..f2eb2e7 100644 --- a/locale/pot/por_version.pot +++ b/locale/pot/por_version.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/pot/release_notes.pot b/locale/pot/release_notes.pot index f0fecef..8426c43 100644 --- a/locale/pot/release_notes.pot +++ b/locale/pot/release_notes.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,15 +37,36 @@ msgstr "" msgid "Contents" msgstr "" -msgid "pgORpy 0.0.0 Release Notes" +msgid "pgORpy 0.0.1 Release Notes" msgstr "" -msgid "To see all issues & pull requests closed by this release see the `Git closed milestone for 0.0.0 `_ on Github." +msgid "To see all issues & pull requests closed by this release see the `Git closed milestone for 0.0.1 `_ on Github." msgstr "" msgid "Version functions" msgstr "" +msgid "por_bin_backing" +msgstr "" + +msgid "New function" +msgstr "" + +msgid "Support for or-tools v9.10.4067" +msgstr "" + +msgid "por_knapsack" +msgstr "" + +msgid "por_multiple_knapsack" +msgstr "" + +msgid "pgORpy 0.0.0 Release Notes" +msgstr "" + +msgid "To see all issues & pull requests closed by this release see the `Git closed milestone for 0.0.0 `_ on Github." +msgstr "" + msgid "por_version" msgstr "" diff --git a/locale/pot/sampledata.pot b/locale/pot/sampledata.pot index 82f2d53..0ae7c27 100644 --- a/locale/pot/sampledata.pot +++ b/locale/pot/sampledata.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,3 +24,6 @@ msgstr "" msgid "Function to activate python on a local environment" msgstr "" + +msgid "Sample data" +msgstr "" diff --git a/locale/pot/support.pot b/locale/pot/support.pot index fa60b9c..d09d626 100644 --- a/locale/pot/support.pot +++ b/locale/pot/support.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgORpy 0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-09 10:49-0600\n" +"POT-Creation-Date: 2025-08-09 10:57-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/pgtap/or_tools/inner_query.pg b/pgtap/or_tools/inner_query.pg new file mode 100644 index 0000000..e4b3631 --- /dev/null +++ b/pgtap/or_tools/inner_query.pg @@ -0,0 +1,109 @@ +/*PGR-GNU***************************************************************** + +License: GNU General Public License v2.0 +Copyright (c) 2025 pgORpy developers +Mail: project@pgrouting.org + + ********************************************************************PGR-GNU*/ + +BEGIN; + +SELECT plan(48); + +CREATE OR REPLACE FUNCTION test_value(fn TEXT, inner_query_table TEXT, start_sql TEXT, rest_sql TEXT, params TEXT[], parameter TEXT, accept TEXT[], reject TEXT[]) +RETURNS SETOF TEXT AS +$BODY$ +DECLARE + end_sql TEXT; + query TEXT; + p TEXT; + type_name TEXT; +BEGIN + + start_sql = 'SELECT * FROM ' || fn || '(' || start_sql || '$$ SELECT '; + FOREACH p IN ARRAY params + LOOP + IF p = parameter THEN CONTINUE; + END IF; + start_sql = start_sql || p || ', '; + END LOOP; + end_sql = ' FROM ' || inner_query_table || '$$' || rest_sql; + + FOREACH type_name IN ARRAY accept + LOOP + query := start_sql || parameter || '::' || type_name || end_sql; + RETURN query SELECT lives_ok(query); + END LOOP; + + FOREACH type_name IN ARRAY reject + LOOP + query := start_sql || parameter || '::' || type_name || end_sql; + RETURN query SELECT throws_ok(query, 38000); + END LOOP; +END; + +$BODY$ LANGUAGE plpgsql; + + +CREATE OR REPLACE FUNCTION test_anyInteger(fn TEXT, inner_query_table TEXT, start_sql TEXT, rest_sql TEXT, params TEXT[], parameter TEXT) +RETURNS SETOF TEXT AS +$BODY$ +DECLARE + accept TEXT[] := ARRAY['SMALLINT', 'INTEGER', 'BIGINT']; + reject TEXT[] := ARRAY['REAL', 'FLOAT8', 'NUMERIC']; +BEGIN + RETURN query SELECT test_value(fn, inner_query_table, start_sql, rest_sql, params, parameter, accept, reject); +END; +$BODY$ LANGUAGE plpgsql; + + +CREATE OR REPLACE FUNCTION inner_query() +RETURNS SETOF TEXT AS +$BODY$ +DECLARE + fn TEXT; + start_sql TEXT; + rest_sql TEXT; + inner_query_table TEXT; + params TEXT[]; +BEGIN + + -- por_knapsack + fn := 'por_knapsack'; + inner_query_table := 'knapsack'; + start_sql := ''; + rest_sql := ', 15)'; + params := ARRAY['id', 'weight', 'cost']; + RETURN QUERY SELECT test_anyInteger(fn, inner_query_table, start_sql, rest_sql, params, 'id'); + RETURN QUERY SELECT test_anyInteger(fn, inner_query_table, start_sql, rest_sql, params, 'weight'); + RETURN QUERY SELECT test_anyInteger(fn, inner_query_table, start_sql, rest_sql, params, 'cost'); + + -- por_multiple_knapsack + fn := 'por_multiple_knapsack'; + inner_query_table := 'multiple_knapsack'; + start_sql := ''; + rest_sql := ', ARRAY[100,100,100,100,100])'; + params := ARRAY['id', 'weight', 'cost']; + RETURN QUERY SELECT test_anyInteger(fn, inner_query_table, start_sql, rest_sql, params, 'id'); + RETURN QUERY SELECT test_anyInteger(fn, inner_query_table, start_sql, rest_sql, params, 'weight'); + RETURN QUERY SELECT test_anyInteger(fn, inner_query_table, start_sql, rest_sql, params, 'cost'); + + -- bin_packing + fn := 'por_bin_packing'; + inner_query_table := 'bin_packing'; + start_sql := ''; + rest_sql := ', 100)'; + params := ARRAY['id', 'weight']; + RETURN QUERY SELECT test_anyInteger(fn, inner_query_table, start_sql, rest_sql, params, 'id'); + RETURN QUERY SELECT test_anyInteger(fn, inner_query_table, start_sql, rest_sql, params, 'weight'); + +END; +$BODY$ +LANGUAGE plpgsql; + +SELECT inner_query(); + + + +SELECT * FROM finish(); +ROLLBACK; diff --git a/pgtap/or_tools/no_crash_test.pg b/pgtap/or_tools/no_crash_test.pg new file mode 100644 index 0000000..6927364 --- /dev/null +++ b/pgtap/or_tools/no_crash_test.pg @@ -0,0 +1,87 @@ +/*PGR-GNU***************************************************************** + +License: GNU General Public License v2.0 +Copyright (c) 2025 pgORpy developers +Mail: project@pgrouting.org + + ********************************************************************PGR-GNU*/ + +BEGIN; + +SELECT plan(18); + +CREATE OR REPLACE FUNCTION no_crash() +RETURNS SETOF TEXT AS +$BODY$ +DECLARE +params TEXT[]; +subs TEXT[]; +error_messages TEXT[]; +non_empty_args INTEGER[]; +BEGIN + -- por_knapsack + params = ARRAY[ + '$$SELECT * FROM knapsack$$', + 'capacity => 15', + 'max_rows => 100000' + ]::TEXT[]; + subs = ARRAY[ + 'NULL', + 'capacity => NULL', + 'max_rows => NULL' + ]::TEXT[]; + error_messages = ARRAY[ + 38000, + 38000, + '' + ]::TEXT[]; + non_empty_args = ARRAY[0, 1, 2, 3]::INTEGER[]; + + RETURN QUERY SELECT * FROM no_crash_test('por_knapsack', params, subs, error_messages, non_empty_args); + + --por_multiple_knapsack + params = ARRAY[ + '$$SELECT * FROM multiple_knapsack$$', + 'capacities => ARRAY[100,100,100,100,100]', + 'max_rows => 100000' + ]::TEXT[]; + subs = ARRAY[ + 'NULL', + 'capacities => NULL', + 'max_rows => NULL' + ]::TEXT[]; + error_messages = ARRAY[ + 38000, + 38000, + '' + ]::TEXT[]; + non_empty_args = ARRAY[0, 1, 2, 3]::INTEGER[]; + + RETURN QUERY SELECT * FROM no_crash_test('por_multiple_knapsack', params, subs, error_messages, non_empty_args); + + -- bin_packing + params = ARRAY[ + '$$SELECT * FROM bin_packing$$', + 'bin_capacity => 100', + 'max_rows => 100000' + ]::TEXT[]; + subs = ARRAY[ + 'NULL', + 'bin_capacity => NULL', + 'max_rows => NULL' + ]::TEXT[]; + error_messages = ARRAY[ + 38000, + 38000, + '' + ]::TEXT[]; + non_empty_args = ARRAY[0, 1, 2, 3]::INTEGER[]; + + RETURN QUERY SELECT * FROM no_crash_test('por_bin_packing', params, subs, error_messages, non_empty_args); +END +$BODY$ +LANGUAGE plpgsql VOLATILE; + +SELECT * FROM no_crash(); + +ROLLBACK; diff --git a/pgtap/or_tools/types_check.pg b/pgtap/or_tools/types_check.pg new file mode 100644 index 0000000..423c7f9 --- /dev/null +++ b/pgtap/or_tools/types_check.pg @@ -0,0 +1,96 @@ +/*PGR-GNU***************************************************************** + +License: GNU General Public License v2.0 +Copyright (c) 2025 pgORpy developers +Mail: project@pgrouting.org + + ********************************************************************PGR-GNU*/ + +BEGIN; + +SELECT plan(15); + +CREATE OR REPLACE FUNCTION types_check() +RETURNS SETOF TEXT AS +$BODY$ +BEGIN + + -- por_knapsack + RETURN QUERY + SELECT has_function('por_knapsack'); + RETURN QUERY + SELECT has_function('por_knapsack', ARRAY['text', 'integer', 'integer']); + RETURN QUERY + SELECT function_returns('por_knapsack', ARRAY['text', 'integer', 'integer'], 'setof integer'); + + -- parameter names + RETURN QUERY + SELECT bag_has( + $$SELECT proargnames from pg_proc where proname = 'por_knapsack'$$, + $$SELECT '{"inner_query","capacity","max_rows","id"}'::TEXT[]$$ + ); + + -- parameter types + RETURN QUERY + SELECT set_eq( + $$SELECT proallargtypes from pg_proc where proname = 'por_knapsack'$$, + $$VALUES + (ARRAY[25,23,23,23]::OID[]) + $$ + ); + + -- por_multiple_knapsack + RETURN QUERY + SELECT has_function('por_multiple_knapsack'); + RETURN QUERY + SELECT has_function('por_multiple_knapsack', ARRAY['text', 'integer[]', 'integer']); + RETURN QUERY + SELECT function_returns('por_multiple_knapsack', ARRAY['text', 'integer[]', 'integer'], 'setof record'); + + -- parameter names + RETURN QUERY + SELECT bag_has( + $$SELECT proargnames from pg_proc where proname = 'por_multiple_knapsack'$$, + $$SELECT '{"inner_query","capacities","max_rows","knapsack","id"}'::TEXT[]$$ + ); + + -- parameter types + RETURN QUERY + SELECT set_eq( + $$SELECT proallargtypes from pg_proc where proname = 'por_multiple_knapsack'$$, + $$VALUES + (ARRAY[25,1007,23,23,23]::OID[]) + $$ + ); + + -- por_bin_packing + RETURN QUERY + SELECT has_function('por_bin_packing'); + RETURN QUERY + SELECT has_function('por_bin_packing', ARRAY['text', 'integer', 'integer']); + RETURN QUERY + SELECT function_returns('por_bin_packing', ARRAY['text', 'integer', 'integer'], 'setof record'); + + -- parameter names + RETURN QUERY + SELECT bag_has( + $$SELECT proargnames from pg_proc where proname = 'por_bin_packing'$$, + $$SELECT '{"inner_query","bin_capacity","max_rows","bin","id"}'::TEXT[]$$ + ); + + -- parameter types + RETURN QUERY + SELECT set_eq( + $$SELECT proallargtypes from pg_proc where proname = 'por_bin_packing'$$, + $$VALUES + (ARRAY[25,23,23,23,23]::OID[]) + $$ + ); +END; +$BODY$ +LANGUAGE plpgsql; + +SELECT types_check(); + +SELECT * FROM finish(); +ROLLBACK; diff --git a/sql/or_tools/CMakeLists.txt b/sql/or_tools/CMakeLists.txt new file mode 100644 index 0000000..9777576 --- /dev/null +++ b/sql/or_tools/CMakeLists.txt @@ -0,0 +1,12 @@ +SET(LOCAL_FILES + knapsack.sql + multiple_knapsack.sql + bin_packing.sql + ) + +foreach (f ${LOCAL_FILES}) + configure_file(${f} ${f}) + list(APPEND PACKAGE_SQL_FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}) +endforeach() + +set(PROJECT_SQL_FILES ${PROJECT_SQL_FILES} ${PACKAGE_SQL_FILES} PARENT_SCOPE) diff --git a/sql/or_tools/bin_packing.sql b/sql/or_tools/bin_packing.sql new file mode 100644 index 0000000..859cd6f --- /dev/null +++ b/sql/or_tools/bin_packing.sql @@ -0,0 +1,138 @@ +/*PGR-GNU***************************************************************** +File: bin_packing.sql + +Copyright (c) 2022 GSoC-2022 pgRouting developers +Mail: project@pgrouting.org + +Function's developer: +Copyright (c) 2022 Manas Sivakumar + +------ + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + ********************************************************************PGR-GNU*/ + +-- v0.0 +CREATE OR REPLACE FUNCTION por_bin_packing( + inner_query TEXT, -- weights SQL + bin_capacity INTEGER, -- Bin Capacity + max_rows INTEGER = 100000 -- Maximum number of rows to be fetched. Default is value = 100000. +) +RETURNS TABLE(bin INTEGER, id INTEGER) +AS $$ + try: + from ortools.linear_solver import pywraplp + except Exception as err: + plpy.error(err) + + global max_rows + if inner_query == None: + raise Exception('Inner Query Cannot be NULL') + if bin_capacity == None: + raise Exception('Capacity Cannot be NULL') + if max_rows == None: + max_rows = 100000 + + # Program Execution Starts here + + try: + inner_query_result = plpy.execute(inner_query, max_rows) + num_of_rows = inner_query_result.nrows() + colnames = inner_query_result.colnames() + coltypes = inner_query_result.coltypes() + except plpy.SPIError as error_msg: + plpy.error("Error Processing Inner Query. The given query is not a valid SQL command") + + if len(colnames) != 2: + plpy.error("Expected 2 column, Got ", len(colnames)) + if ('weight' in colnames) and ('id' in colnames): + # got expected column names + pass + else: + plpy.error("Expected column weight, Got ", colnames) + if all(item in [20, 21, 23] for item in coltypes): + # got expected column types + pass + else: + raise Exception("Returned columns of different type. Expected Integer") + + data = {} + weights = [] + data_ids = [] + + for i in range(num_of_rows): + weights.append(inner_query_result[i]["weight"]) + data_ids.append(inner_query_result[i]["id"]) + + + data['weights'] = weights + data['items'] = list(range(len(weights))) + data['bins'] = data['items'] + data['bin_capacity'] = bin_capacity + + try: + solver = pywraplp.Solver.CreateSolver('SCIP') + except: + plpy.error("Unable to Initialize solver") + + if solver is None: + plpy.error('SCIP solver unavailable.') + + + x = {} + for i in data['items']: + for j in data['bins']: + x[(i, j)] = solver.IntVar(0, 1, 'x_%i_%i' % (i, j)) + + y = {} + for j in data['bins']: + y[j] = solver.IntVar(0, 1, 'y[%i]' % j) + + for i in data['items']: + solver.Add(sum(x[i, j] for j in data['bins']) == 1) + + for j in data['bins']: + solver.Add(sum(x[(i, j)] * data['weights'][i] + for i in data['items']) <= y[j] * data['bin_capacity']) + + solver.Minimize(solver.Sum([y[j] for j in data['bins']])) + + status = solver.Solve() + + if status == pywraplp.Solver.OPTIMAL: + for j in data['bins']: + if y[j].solution_value() == 1: + bin_items = [] + bin_weight = 0 + for i in data['items']: + if x[i, j].solution_value() > 0: + bin_items.append(i) + bin_weight += data['weights'][i] + if bin_weight > 0: + for k in range(len(bin_items)): + yield(j+1, data_ids[bin_items[k]]) + else: + plpy.notice('The problem does not have an optimal solution') + + # end of the program + +$$ LANGUAGE plpython3u VOLATILE; + +COMMENT ON FUNCTION por_bin_packing(TEXT, INTEGER, INTEGER) +IS 'por_bin_packing +- Documentation: + - ${PROJECT_DOC_LINK}/por_bin_packing.html +'; diff --git a/sql/or_tools/knapsack.sql b/sql/or_tools/knapsack.sql new file mode 100644 index 0000000..631605d --- /dev/null +++ b/sql/or_tools/knapsack.sql @@ -0,0 +1,111 @@ + +/*PGR-GNU***************************************************************** +File: knapsack.sql + +Copyright (c) 2022 GSoC-2022 pgRouting developers +Mail: project@pgrouting.org + +Function's developer: +Copyright (c) 2022 Manas Sivakumar + +------ + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + ********************************************************************PGR-GNU*/ + +-- v0.0 +CREATE OR REPLACE FUNCTION por_knapsack( + inner_query TEXT, -- weights_cost SQL + capacity INTEGER, -- Knapsack Capacity + max_rows INTEGER = 100000 -- Maximum number of rows to be fetched. Default is 100000. +) +RETURNS TABLE(id INTEGER) +AS $$ + try: + from ortools.algorithms.python import knapsack_solver + except Exception as err: + plpy.error(err) + + global max_rows + if inner_query == None: + raise Exception('Inner Query Cannot be NULL') + if capacity == None: + raise Exception('Capacity Cannot be NULL') + if max_rows == None: + max_rows = 100000 + try: + solver = knapsack_solver.KnapsackSolver( + knapsack_solver.SolverType. + KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER, 'KnapsackExample') + except: + plpy.error('Unable to Initialize Knapsack Solver') + + capacities = [] + capacities.append(capacity) + + # Program Execution Starts here + + try: + inner_query_result = plpy.execute(inner_query, max_rows) + num_of_rows = inner_query_result.nrows() + colnames = inner_query_result.colnames() + coltypes = inner_query_result.coltypes() + except plpy.SPIError as error_msg: + plpy.error("Error Processing Inner Query. The given query is not a valid SQL command") + + if len(colnames) != 3: + plpy.error("Expected 3 columns, Got ", len(colnames)) + if ('weight' in colnames) and ('cost' in colnames) and ('id' in colnames): + # got correct column names + pass + else: + plpy.error("Expected columns weight and cost, Got ", colnames) + if all(item in [20, 21, 23] for item in coltypes): + # got correct column types + pass + else: + raise Exception("Returned columns of different type. Expected Integer, Integer") + + ids = [] + values = [] + weight1 = [] + weights =[] + for i in range(num_of_rows): + ids.append(inner_query_result[i]["id"]) + values.append(inner_query_result[i]["cost"]) + weight1.append(inner_query_result[i]["weight"]) + weights.append(weight1) + + try: + solver.init(values, weights, capacities) + except Exception as error_msg: + plpy.error(error_msg) + computed_value = solver.solve() + + # prints results + for i in range(len(values)): + if solver.best_solution_contains(i): + yield (ids[i]) + + # end of the program + +$$ LANGUAGE plpython3u VOLATILE; + +COMMENT ON FUNCTION por_knapsack(TEXT, INTEGER, INTEGER) +IS 'por_knapsack +- Documentation: + - ${PROJECT_DOC_LINK}/por_knapsack.html +'; diff --git a/sql/or_tools/multiple_knapsack.sql b/sql/or_tools/multiple_knapsack.sql new file mode 100644 index 0000000..40bcb8c --- /dev/null +++ b/sql/or_tools/multiple_knapsack.sql @@ -0,0 +1,135 @@ +/*PGR-GNU***************************************************************** +File: multiple_knapsack.sql + +Copyright (c) 2022 GSoC-2022 pgRouting developers +Mail: project@pgrouting.org + +Function's developer: +Copyright (c) 2022 Manas Sivakumar + +------ + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + ********************************************************************PGR-GNU*/ + +--v0.0 +CREATE OR REPLACE FUNCTION por_multiple_knapsack( + inner_query TEXT, -- weights_cost SQL + capacities INTEGER[], -- ARRAY of Knapsack Capacities + max_rows INTEGER = 100000 -- Maximum number of rows to be fetched. Default value is 100000. +) +RETURNS TABLE(knapsack INTEGER, id INTEGER) +AS $$ + try: + from ortools.linear_solver import pywraplp + except Exception as err: + plpy.error(err) + + global max_rows + if inner_query == None: + raise Exception('Inner Query Cannot be NULL') + if capacities == None: + raise Exception('Capacity Cannot be NULL') + if max_rows == None: + max_rows = 100000 + + data = {} + data['values'] = [] + data['weights'] = [] + data_ids = [] + + # Program Execution Starts here + + try: + inner_query_result = plpy.execute(inner_query, max_rows) + num_of_rows = inner_query_result.nrows() + colnames = inner_query_result.colnames() + coltypes = inner_query_result.coltypes() + except plpy.SPIError as error_msg: + plpy.error("Error Processing Inner Query. The given query is not a valid SQL command") + + if len(colnames) != 3: + plpy.error("Expected 3 columns, Got ", len(colnames)) + if ('weight' in colnames) and ('cost' in colnames) and ('cost' in colnames): + # got expected column names + pass + else: + plpy.error("Expected columns weight and cost, Got ", colnames) + if all(item in [20, 21, 23] for item in coltypes): + # got expected column types + pass + else: + raise Exception("Returned columns of different type. Expected Integer, Integer") + + for i in range(num_of_rows): + data['values'].append(inner_query_result[i]["cost"]) + data['weights'].append(inner_query_result[i]["weight"]) + data_ids.append(inner_query_result[i]["id"]) + + + data['num_items'] = len(data['weights']) + data['all_items'] = range(data['num_items']) + + data['bin_capacities'] = capacities + data['num_bins'] = len(data['bin_capacities']) + data['all_bins'] = range(data['num_bins']) + + try: + solver = pywraplp.Solver.CreateSolver('SCIP') + except: + plpy.error("Unable to Initialize solver") + + if solver is None: + plpy.error('SCIP solver unavailable.') + + x = {} + for i in data['all_items']: + for b in data['all_bins']: + x[i, b] = solver.BoolVar(f'x_{i}_{b}') + + for i in data['all_items']: + solver.Add(sum(x[i, b] for b in data['all_bins']) <= 1) + + for b in data['all_bins']: + solver.Add(sum(x[i, b] * data['weights'][i] for i in data['all_items']) <= data['bin_capacities'][b]) + + objective = solver.Objective() + for i in data['all_items']: + for b in data['all_bins']: + objective.SetCoefficient(x[i, b], data['values'][i]) + objective.SetMaximization() + + status = solver.Solve() + + if status == pywraplp.Solver.OPTIMAL: + for b in data['all_bins']: + for i in data['all_items']: + if x[i, b].solution_value() > 0: + yield(b+1, data_ids[i]) + else: + plpy.notice('The problem does not have an optimal solution.') + # end of the program +$$ LANGUAGE plpython3u VOLATILE; + +-- SELECT * FROM por_multiple_knapsack('SELECT id, weight, cost FROM multiple_knapsack_data', ARRAY[100,100,100,100,100]); + +-- COMMENTS + +COMMENT ON FUNCTION por_multiple_knapsack(TEXT, INTEGER[], INTEGER) +IS 'por_multiple_knapsack +- Documentation: + - ${PROJECT_DOC_LINK}/por_multiple_knapsack.html +'; diff --git a/sql/sigs/pgorpy--0.0.sig b/sql/sigs/pgorpy--0.0.sig index b51203e..fe9b496 100644 --- a/sql/sigs/pgorpy--0.0.sig +++ b/sql/sigs/pgorpy--0.0.sig @@ -1,2 +1,5 @@ +por_bin_packing(text,integer,integer) por_full_version() +por_knapsack(text,integer,integer) +por_multiple_knapsack(text,integer[],integer) por_version() diff --git a/tools/testers/sampledata.sql b/tools/testers/sampledata.sql index fb83239..0b673db 100644 --- a/tools/testers/sampledata.sql +++ b/tools/testers/sampledata.sql @@ -2,6 +2,10 @@ -- Creative Commons Attribution-Share Alike 3.0 -- License : https://creativecommons.org/licenses/by-sa/3.0/ +DROP TABLE IF EXISTS bin_packing; +DROP TABLE IF EXISTS knapsack; +DROP TABLE IF EXISTS multiple_knapsack; + -- activate_python_start CREATE OR REPLACE PROCEDURE activate_python_venv(venv text) LANGUAGE plpython3u AS @@ -18,3 +22,34 @@ $BODY$ $BODY$; -- activate_python_end + +CREATE TABLE bin_packing( + id SERIAL, + weight INTEGER); + +INSERT INTO bin_packing(weight) +VALUES +(48), (30), (19), (36), (36), (27), (42), (42), (36), (24), (30); + + +CREATE TABLE knapsack( + id SERIAL, + weight INTEGER, + cost INTEGER); + +INSERT INTO knapsack(weight, cost) +VALUES +(12, 4), (2, 2), (1, 1), (4, 10), (1, 2); + +CREATE TABLE multiple_knapsack( + id SERIAL, + weight INTEGER, + cost INTEGER); + +INSERT INTO multiple_knapsack(weight, cost) +VALUES +(48, 10), (30, 30), (42, 25), +(36, 50), (36, 35), (48, 30), +(42, 15), (42, 40), (36, 30), +(24, 35), (30, 45), (30, 10), +(42, 20), (36, 30), (36, 25);