A.50.1 Introduction
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(simplex): Solve linear programming problems
          • Introduction
            • gen_state/1
            • constraint/3
            • maximize/3
            • minimize/3
            • variable_value/3
            • objective/2
    • Packages
Availability::- use_module(library(simplex)).
constraint(+Constraint, +S0, -S)
Adds a linear or integrality constraint to the linear program corresponding to state S0. A linear constraint is of the form Left Op C, where Left is a list of Coefficient*Variable terms (variables in the context of linear programs can be atoms or compound terms) and C is a non-negative numeric constant. The list represents the sum of its elements. Op can be =, =< or >=. The coefficient 1 can be omitted. An integrality constraint is of the form integral(Variable) and constrains Variable to an integral value.