angry1980.neo4j.louvain.DefaultTaskAdapter Maven / Gradle / Ivy
package angry1980.neo4j.louvain;
import org.neo4j.graphdb.*;
import org.neo4j.tooling.GlobalGraphOperations;
public class DefaultTaskAdapter implements TaskAdapter{
@Override
public ResourceIterable getNodes(GraphDatabaseService g) {
return GlobalGraphOperations.at(g).getAllNodes();
}
@Override
public Iterable getRelationships(Node node) {
return node.getRelationships(Direction.BOTH);
}
@Override
public double getInitWeight(Relationship r) {
return 1.0;
}
@Override
public long getId(Node node) {
return node.getId();
}
}