Skip to content

Joint Community and Structural Hole Spanner Detection via Harmonic Modularity

Notifications You must be signed in to change notification settings

LifangHe/KDD16_HAM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Python implementation of HAM algorithm

Please see the following paper for more details of HAM algorithm:

  • He, L., Lu, C. T., Ma, J., Cao, J., Shen, L., & Philip, S. Y. Joint Community and Structural Hole Spanner Detection via Harmonic Modularity. Proceedings of the 22th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), 2016.

*** USAGE

To try the code, we provide a graph benchmark dataset “Karate” as an example, which includes adjacency matrix and ground-truth community (label) interface for graph files and code.

karatern.txt - adjacency list

The first line is a summary of the graph (# Nodes || # Edges) (space-delimited)

karatecrn.txt - ground-truth community

Each row is a COMMUNITY containing the indices of nodes (tab-delimited)

—------—------—------—------NOTE—-----—-------—------—------

Please change the following code according to your environment and applications.

datapath= os.getcwd() + '/data/'
adj_name = 'karatern'     # Note: the data index starts from 0, not from 1
community_name = 'karatecrn'
topk=3     # the number of selected SH spanner

See comments inline of the code for more details.

In terminal

You can use the following routine to perform the code.

$ python HAM.py

For SHII metric, please see README file in the SHII_metric folder.

Contact

Lifang He (Email: lifanghescut@gmail.com)

About

Joint Community and Structural Hole Spanner Detection via Harmonic Modularity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published