MCPcopy Index your code
hub / github.com/clips/pattern / cliques

Function cliques

pattern/graph/__init__.py:1024–1033  ·  view source on GitHub ↗

Returns all cliques in the graph with at least the given number of nodes.

(graph, threshold=3)

Source from the content-addressed store, hash-verified

1022 return a
1023
1024def cliques(graph, threshold=3):
1025 """ Returns all cliques in the graph with at least the given number of nodes.
1026 """
1027 a = []
1028 for n in graph.nodes:
1029 c = clique(graph, n.id)
1030 if len(c) >= threshold:
1031 c.sort()
1032 if c not in a: a.append(c)
1033 return a
1034
1035#--- GRAPH MAINTENANCE -----------------------------------------------------------------------------
1036# Utility functions for safe linking and unlinking of nodes,

Callers

nothing calls this directly

Calls 4

cliqueFunction · 0.85
lenFunction · 0.85
sortMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…