Answer set programming: Difference between revisions

Content deleted Content added
VadeveSi (talk | contribs)
Removed `not e(Y,X)`. The previous formulation would consider nodes unconnected only when they had no connection at all. Rather, we want them to have edges in both ways.
Line 185:
 
===Large clique===
A [[Clique (graph theory)|clique]] in a graph is a set of pairwise adjacent vertices. The following Lparse program finds a clique of size <math>\geq n</math> in a given directed graph, or determines that it does not exist:
 
<syntaxhighlight lang="prolog" line="1">
n {in(X) : v(X)}.
:- in(X), in(Y), v(X), v(Y), X!=Y, not e(X,Y), not e(Y,X).
</syntaxhighlight>