Communities & cliques

Introduction to Network Analysis in Python

Eric Ma

Data Carpentry instructor and author of nxviz package

Cliques

  • Social cliques: tightly-knit groups
  • Network cliques: completely connected graphs

A clique graph. Every node is connected to every other node.

Introduction to Network Analysis in Python

Cliques

  • Simplest complex clique: a triangle

A clique graph with three nodes, which looks like a triangle.

Introduction to Network Analysis in Python

Triangle Applications

  • Friend recommendation systems

A graph with three nodes. One node is connected to both other nodes. A dotted line is shown between the two nodes that don't have edge connections.

Introduction to Network Analysis in Python

Clique Code

G
<networkx.classes.graph.Graph at 0x10c99ecf8>
from itertools import combinations

for n1, n2 in combinations(G.nodes(), 2): print(n1, n2)
0 1
0 2
0 3
0 4
0 5
...
Introduction to Network Analysis in Python

Let's practice!

Introduction to Network Analysis in Python

Preparing Video For Download...