Skip to content

NetSCAN: a community detection algorithm plugin for Neo4j graph database

License

Notifications You must be signed in to change notification settings

vitorhorta/netscan-neo4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netscan-neo4j

NetSCAN is an overlapping community detection algorithm plugin for Neo4j graph database.

Building

This plugin was created based on the Neo4j procudure template.

This project uses maven, to build a jar-file with the procedure in this project, simply package the project with maven:

mvn clean package

This will produce a jar-file,target/netscan-1.0.0.jar, that can be deployed in the plugin directory of your Neo4j instance.

Installing

To use the NetSCAN plugin you can simply move the jar-file to the plugins folder on neo4j.

Usage

The basic cypher query to run the NetSCAN procedure is the following:

CALL netscan.find_communities('NodeLabel','RelType','id_attribute','weight_attribute', 'HIGHER_BETTER', eps, minPts, radius);
Parameter Type Description
NodeType String Nodes to be clustered
RelType String Relationships to be considered
id_attribute String Nodes unique key
weight_attribute String Relationship weight attribute
relDirection String Direction used to define core nodes ('INCOMING' OR 'OUTGOING')
higher_better Boolean Indicates whether the weights should be higher better or lower better
eps Double Number to be define which edges can be considered as strong connections
minPts Integer Minimum strong neighborhood size for a node to be considered a core
radius Integer Expansion depth. Number of hops in core expansion

Example

The file netscan-neo4j/src/test/java/netscan/fixtures.db contains a neo4j dump with a protein network to be used for testing and demonstration.

To run the example import or execute the queries contained this file.

To achieve the most correct results run the NetSCAN with the following parameters:

CALL netscan.find_communities('Person','LIKES', 'id','weight', 'INCOMING', true, 0.5, 5, 1);

The following result should be achieved:

Restore database to previous state

After running the NetSCAN algorithm you can restore your database to the previous state with the following queries:

MATCH (p) REMOVE p.expanded, p.core, p.noise

MATCH (n:Cluster)-[r:CONTAINS]->(p) DELETE r

MATCH (n:Cluster) DELETE n

About

NetSCAN: a community detection algorithm plugin for Neo4j graph database

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages