File: README.md

package info (click to toggle)
gringo 5.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,128 kB
  • sloc: cpp: 210,867; ansic: 37,507; python: 11,271; yacc: 825; javascript: 627; sh: 368; xml: 364; makefile: 102
file content (30 lines) | stat: -rw-r--r-- 956 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Example to enumerate all solutions in lexicographical order

This example enumerates all solutions of a logic program in lexicographical
order where costs are determined using the minimize constraint.

The program should be called with option `--opt-mode=optN` and can optionally
use `-q1` to suppress intermediate solutions. A maximum number of solutions can
be requested as usual.

Option `--restore` can be used to heuristically guide the solver to the next
solution once all solutions with an equal cost have been enumerated.

## Example Calls

Note that the purpose of the domain heuristic in the examples below is just to
show case that a lot of intermediate solutions might be enumerated.

```
➜ python opt.py example1.lp --opt-mode=optN 0 --heu=domain -q1 --stats
...
Enumerate
  Enumerated : 27
  Intermediate: 10

➜ python opt.py example1.lp --opt-mode=optN 15 --heu=domain -q1 --stats
...
Enumerate
  Enumerated : 15
  Intermediate: 5
...