Segmented dynamic planning solving method for ordered backpack problem under limited resources
The invention discloses a segmented dynamic planning solving method for an ordered knapsack problem under limited resources, and the method comprises the steps: presetting the number n of articles, the serial number i of each article, the weight and price, and the load W of a knapsack for input data...
Saved in:
Main Authors | , , , |
---|---|
Format | Patent |
Language | Chinese English |
Published |
21.10.2022
|
Subjects | |
Online Access | Get full text |
Cover
Loading…
Summary: | The invention discloses a segmented dynamic planning solving method for an ordered knapsack problem under limited resources, and the method comprises the steps: presetting the number n of articles, the serial number i of each article, the weight and price, and the load W of a knapsack for input data; setting the maximum storage of the state array F; reading the size of an available memory, and determining the number S of elements of the state array F through the maximum storage of the state array and the minimum value between the size of the available memory; sorting the articles according to the weight from light to heavy, recording the serial number of the sorted articles as j, and recording the corresponding relationship between the serial number j and the serial number i; the line number and the column number of the state array are defined as n; defining the load bearing of the knapsack at the tth stage, sequentially judging whether each article is selected to be put into the knapsack or not, and calculat |
---|---|
Bibliography: | Application Number: CN202211140581 |