Home Online Manual
Top
Back: unbounded_knapsack
Forward: naccache_stern_generation
FastBack:
FastForward:
Up: crypto_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.12.2.46 multidimensional_knapsack

Procedure from library crypto.lib (see crypto_lib).

Usage:
multidimensional_knapsack(m,capacities,profits)

Return:
binary list of the positions of the elements included in the optimal selection

Example:
 
LIB "crypto.lib";
ring r = 0,x,lp;
matrix m[3][3] = 1,4,10,7,8,3,1,9,7;
list c = 12,17,10;
list p = 3,2,5;
multidimensional_knapsack(m,c,p);
==> [1]:
==>    1
==> [2]:
==>    0
==> [3]:
==>    1