All Downloads are FREE. Search and download functionalities are using the official Maven repository.

angry1980.neo4j.louvain.DefaultTaskAdapter Maven / Gradle / Ivy

There is a newer version: 0.0.10
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy