generated from potassco/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
243 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ jobs: | |
run: pre-commit run --all --show-diff-on-failure | ||
|
||
- name: run tests | ||
run: nox | ||
run: nox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,61 @@ | ||
# Example : Graph Coloring | ||
|
||
+ This example encodes the classic graph coloring problem together with an unsatisfiable instance | ||
+ Here for the sake of illustration some of the graph nodes are already assigned a color from the start, which is where the conflict occurs | ||
+ Using `clingexplaid` we can discover the underlying Minimal Unsatisfiable Cores (MUCs) and their respective unsatisfiable constraints | ||
|
||
- This example encodes the classic graph coloring problem together with an | ||
unsatisfiable instance | ||
- Here for the sake of illustration some of the graph nodes are already | ||
assigned a color from the start, which is where the conflict occurs | ||
- Using `clingexplaid` we can discover the underlying Minimal Unsatisfiable | ||
Cores (MUCs) and their respective unsatisfiable constraints | ||
|
||
## Visualization | ||
|
||
![](graph_coloring_example.svg) | ||
|
||
## Run | ||
|
||
+ Finding all MUCs | ||
- Finding all MUCs | ||
|
||
```bash | ||
clingexplaid 0 encoding.lp instance.lp --muc -a assign/2 | ||
``` | ||
|
||
Expected Output: | ||
```bash | ||
clingexplaid 0 encoding.lp instance.lp --muc -a assign/2 | ||
``` | ||
|
||
```bash | ||
MUC 1 | ||
assign(1,green) assign(5,red) assign(7,green) | ||
MUC 2 | ||
assign(1,green) assign(2,blue) assign(5,red) | ||
``` | ||
Expected Output: | ||
|
||
+ Finding the unsatisfiable constraints | ||
```bash | ||
MUC 1 | ||
assign(1,green) assign(5,red) assign(7,green) | ||
MUC 2 | ||
assign(1,green) assign(2,blue) assign(5,red) | ||
``` | ||
|
||
```bash | ||
clingexplaid 0 encoding.lp instance.lp --unsat-constraints | ||
``` | ||
- Finding the unsatisfiable constraints | ||
|
||
Expected Output: | ||
```bash | ||
clingexplaid 0 encoding.lp instance.lp --unsat-constraints | ||
``` | ||
|
||
```bash | ||
Unsat Constraints | ||
:- edge(N1,N2); assign(N1,C); assign(N2,C). | ||
``` | ||
Expected Output: | ||
|
||
```bash | ||
Unsat Constraints | ||
:- edge(N1,N2); assign(N1,C); assign(N2,C). | ||
``` | ||
|
||
- Combined call with unsatisfiable constraints for every found MUC | ||
|
||
+ Combined call with unsatisfiable constraints for every found MUC | ||
```bash | ||
clingexplaid 0 encoding.lp instance.lp --muc --unsat-constraints -a assign/2 | ||
``` | ||
|
||
Expected Output: | ||
|
||
```bash | ||
MUC 1 | ||
assign(1,green) assign(5,red) assign(7,green) | ||
├── Unsat Constraints | ||
├──:- edge(N1,N2); assign(N1,C); assign(N2,C). | ||
MUC 2 | ||
assign(1,green) assign(2,blue) assign(5,red) | ||
├── Unsat Constraints | ||
├──:- edge(N1,N2); assign(N1,C); assign(N2,C). | ||
``` | ||
Expected Output: | ||
|
||
```bash | ||
MUC 1 | ||
assign(1,green) assign(5,red) assign(7,green) | ||
├── Unsat Constraints | ||
├──:- edge(N1,N2); assign(N1,C); assign(N2,C). | ||
MUC 2 | ||
assign(1,green) assign(2,blue) assign(5,red) | ||
├── Unsat Constraints | ||
├──:- edge(N1,N2); assign(N1,C); assign(N2,C). | ||
``` |
Oops, something went wrong.