From ecdefa92215d905543dc4c297f3702d14982c5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Mon, 12 Jun 2017 02:43:19 +0200 Subject: [PATCH] Added graph coloring example. --- examples/graph-coloring.lp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/graph-coloring.lp diff --git a/examples/graph-coloring.lp b/examples/graph-coloring.lp new file mode 100644 index 0000000..8b7487c --- /dev/null +++ b/examples/graph-coloring.lp @@ -0,0 +1,12 @@ +colored(V, red) :- vertex(V), not colored(V, green), not colored(V, blue). +colored(V, green) :- vertex(V), not colored(V, red), not colored(V, blue). +colored(V, blue) :- vertex(V), not colored(V, red), not colored(V, green). + +:- edge(V1, V2), colored(V1, C), colored(V2, C). + +vertex(a). +vertex(b). +vertex(c). + +edge(a, b). +edge(a, c).