» ASP Competition

Example of Input and Output for Optimization Problem

In the knapsack problem, a set of n objects O1 , ..., On is given, each Oi with a weight wi and a value pi. The goal is to select a subset S with maximal value and weight below a fixed upperbound W. The cost function then is

Oi∈ S -pi .

A suitable input vocabulary consists of predicates max_weight/1, value/2 and weight/2. The unique output symbol is selected/1.

An example input is:

max_weight(3). value(a,1). value(b,3). value(c,3). weight(a,2). weight(b,1). weight(c,3).

A possible output is:


selected(c).
selected(a). selected(b).
OPTIMUM FOUND

An example of the input and output format of a search problem can be found here.