Skip to main content

clingo[LP]

clingo[LP] extends the ASP solver clingo with linear constraints as dealt with in Linear Programming (LP).

Install

Install via conda:

conda install -c potassco -c conda-forge clingo-lp

CPLEX

The clingoLP propagator requires an LP solver. The default is lpsolve but cplex can be used optionally.

IBM also provides a promotional version of cplex that is sufficient to solve small problems limited to 1000 variables and 1000 constraints.

conda install -c ibmdecisionoptimization cplex`

To solve larger problems, you need to use the full version of CPLEX Studio.

Syntax

LP constraints can be expressed as follows:

LP constraints ClingoLP Syntax
w1x1+...+wnxn >= k &sum{w1*x1;...;wn*xn} >= k
domain(x)={l,...,u} &dom{l..u} = x
maximize: w1x1+...+wnxn &maximize{w1*x1;...;wn*x1} (minimize analogous)

To avoid syntax clashes, you must quote " real numbers. Instead of 1.5 write "1.5".

Usage

clingoLP [number] [options] [files]

Options:

  --lp-solver=<arg>       : Set LP solver
      <arg>: {lps,cplx} (default lp-solver=lps)
  --[no-]show-lp-solution : Show LP solution and value of objective function
  --accuracy=n            : Set decimal position of LP solver accuracy (default accuracy=3)
  --epsilon=n,m           : Set epsilon to convert lhs > k into lhs >= k+n*10^-m (default epsilon=1,3)
  --[no-]trace            : Enables detailed output of theory propagation
  --core-confl=n          : Searches for core conflicts if at least n% of the theory atoms are decided
                            (default core-confl=20)
  --prop-heur=n           : Starts a solve call of the LP solver if at least n% of the theory atoms are decided
                            (default prop-heur=0)
  --[no-]ilp              : Sets the LP solver to solve an Integer Linear Programming (ILP) problem

Example:

clingoLP 0 --show-lp-solution example_encoding.lp example_instance.lp

For more options you can ask for help as follows:

clingoLP --help

Publication

Clingo goes linear constraints over reals and integers, Janhunen, T., Kaminski, R., Ostrowski, M., Schellhorn, S., Wanko, P., Schaub, T. (2017), TPLP, 17(5-6), 872–888.

Metadata

Release files for clingo-lp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clingo-lp 0.2.0
File Size Uploaded
clingo-lp-0.2.0.tar.gz 13.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clingo-lp 0.2.0
File Interpreter ABI Platform
clingo_lp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release files / clingo-lp-0.2.0.tar.gz

Download URL clingo-lp-0.2.0.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4ca85f015fa6f83531ea4cdf47eccd455ef63755e29ea8f1c1268ec70e92e867
BLAKE2b-256 checksum
How to use checksums
84005a95dee7ce6caaa46cbcbd02aaa60907dced8943fac211f143865baac948
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / clingo_lp-0.2.0-py3-none-any.whl

Download URL clingo_lp-0.2.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53738c2306542d534f778e849fafc248d699f0071761b27a3e10571c212eaac4
BLAKE2b-256 checksum
How to use checksums
17fa17286ea010f339fe957f62f2bb0950b9677bb29d9d4ed2ceaf90d92a4599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page