Display program code

knapsack.pl : Solves the knapsack problem
Given a set of items (each one with its value and weight) and a knapsack with a weight limit WL, find the (sub)set of items which maximizes the total value and whose total weight is not greater than WL.

How to use:
Give in input a set of items (with their values and their weights) and a weight limit (item(V1, W1), item(V2, W2)... knapsack(WL)). The output is the optimal (sub)set of items with their total value.

Program: Change the code, then submit!

Console: Enter query or select example from below, then submit and wait for answer!

Select example query: 

WebCHR help - CHR Website - (c) Copyrights Martin Kaeser Uni Ulm 2007