sf.apps.clique.c_1

c_1(clique, graph)[source]

Generates the set \(C_1\) of nodes that are connected to all but one of the nodes in the input clique subgraph.

The set \(C_1\) is defined in [15] and is used to determine outside nodes that can be swapped with clique nodes to create a new clique.

Example usage:

>>> graph = nx.wheel_graph(5)
>>> clique = [0, 1, 2]
>>> c_1(clique, graph)
[(1, 3), (2, 4)]
Parameters
  • clique (list[int]) – a subgraph specified by a list of nodes; the subgraph must be a clique

  • graph (nx.Graph) – the input graph

Returns

A list of tuples. The first node in the tuple is the node in the clique and the second node is the outside node it can be swapped with.

Return type

list[tuple[int]]