Skip to content

Instantly share code, notes, and snippets.

View nickyreinert's full-sized avatar

nicky nickyreinert

View GitHub Profile
@rbnvrw
rbnvrw / community_detection.py
Last active May 7, 2022 09:34
python-igraph example
from igraph import *
import numpy as np
# Create the graph
vertices = [i for i in range(7)]
edges = [(0,2),(0,1),(0,3),(1,0),(1,2),(1,3),(2,0),(2,1),(2,3),(3,0),(3,1),(3,2),(2,4),(4,5),(4,6),(5,4),(5,6),(6,4),(6,5)]
g = Graph(vertex_attrs={"label":vertices}, edges=edges, directed=True)
visual_style = {}