Added graph coloring example.

This commit is contained in:
Patrick Lühne 2017-06-12 02:43:19 +02:00
parent c1899a6347
commit ecdefa9221
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -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).