Ramsey's theorem: Difference between revisions

m (→‎{{header|REXX}}: added whitespace, change comments, used a better method of showing a negative result.)
Line 1,135:
 
=={{header|Mathematica}}==
<lang mathematica>g = CirculantGraph[17, {1, 2, 4, 8}]</lang>
{{needs-review|C|The task has been changed to also require demonstrating that the graph is a solution.}}
vl = VertexList[g];
<lang mathematica>CirculantGraph[17, {1, 2, 4, 8}]</lang>
ss = Subsets[vl, {4}];
NoneTrue[ss, CompleteGraphQ[Subgraph[g, #]] &]
NoneTrue[ss, Length[ConnectedComponents[Subgraph[g, #]]] == 4 &]</lang>
{{out}}
[[File:Ramsey.png]]
<pre>True
True</pre>
 
=={{header|Mathprog}}==
1,111

edits