This low level function finds all the triangles (cliques of size 3)
in a finite graph with nvert vertices and with edges
specified by iedge, jedge.
The interpretation of iedge, jedge is that each successive
pair of entries specifies an edge in the graph.
The \(k\)th edge joins vertex iedge[k] to vertex jedge[k].
Entries of iedge and jedge must be integers
from 1 to nvert.
To improve efficiency in some applications, the optional argument
friendly can be used. It should be a logical vector of
length nvert specifying a labelling of the vertices,
such that two vertices j,k which are not friendly
(friendly[j] = friendly[k] = FALSE)
are never connected by an edge.