Skip to content

analyze temporal networks to discover the flow of community structures

License

Notifications You must be signed in to change notification settings

muftring/community-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

community-flow

analyze temporal networks to discover the flow of community structures

Execution

import pandas as pd
import communityflow as cf
from communityflow import PsdPartitioner

# load data from CSV into a DataFrame
psd = pd.read_csv("primaryschool.with-header.csv")

# partition the data into temporal slices
partitions = cf.partition(psd, 'Time', PsdPartitioner())

# create graphs for each temporal slice
graphs, nodemap = cf.create_graphs(partitions)

# perform community detection
modularities = cf.communities(graphs)

# tabulate modularities into a DataFrame
df = cf.tabulate(nodemap, modularities)

# align the community assignments
df_aligned = cf.align_community_assignments(df)

# compute the community flow
flow = cf.community_flow(df_aligned)

# visualze the community flow
cf.visualize_flow(flow, ColorGrid('tab20'))

About

analyze temporal networks to discover the flow of community structures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages