image_output_1.png
import igraph as ig

import igraph as ig

import igraph as ig

import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

import igraph as ig
import matplotlib.pyplot as plt

g = ig.Graph.Famous('Zachary')

# Compute cliques
cliques = g.cliques(4, 4)

# Plot each clique highlighted in a separate axes
fig, axs = plt.subplots(3, 4, figsize = (20,10))
axs = axs.ravel()
for clique, ax in zip(cliques, axs):
    ig.plot(
        ig.VertexCover(g, [clique]),
        mark_groups=True, palette=ig.RainbowPalette(),
        edge_width=0.5,
        target=ax,
    )

plt.axis('off')
plt.show()

import igraph as ig
import matplotlib.pyplot as plt

g = ig.Graph.Famous('Zachary')

# Compute cliques
cliques = g.maximal_cliques(min = 4)# (4, 4)

# Plot each clique highlighted in a separate axes
fig, axs = plt.subplots(1, 4, figsize = (20,10))
axs = axs.ravel()
for clique, ax in zip(cliques, axs):
    ig.plot(
        ig.VertexCover(g, [clique]),
        mark_groups=True, palette=ig.RainbowPalette(),
        edge_width=0.5,
        target=ax,
    )

plt.axis('off')
plt.show()

()

import igraph as ig
import matplotlib.pyplot as plt

g = ig.Graph.Famous('Zachary')

# Compute cliques
cliques = g.largest_cliques()# (min = 4)# (4, 4)

# Plot each clique highlighted in a separate axes
fig, axs = plt.subplots(1, 2, figsize = (20,10))
axs = axs.ravel()
for clique, ax in zip(cliques, axs):
    ig.plot(
        ig.VertexCover(g, [clique]),
        mark_groups=True, palette=ig.RainbowPalette(),
        edge_width=0.5,
        target=ax,
    )

plt.axis('off')
plt.show()

subgraph_vs = g.subgraph(cliques[0])

fig, axs = plt.subplots(1, 2, figsize=(20, 10))
ig.plot(subgraph_vs, mark_groups=True, palette=ig.RainbowPalette(), edge_width=0.5, target=axs[0])
plt.axis('off')
plt.show()