Question

I want to calculate eigenvector centrality measure for vertices of specific graph using JUNG library. Unfortunately my code returns a wrong result. here is some part of my code:

DirectedSparseGraph<Customer, Transaction> tsn=f.getTSN()
EigenvectorCentrality<Customer, Transaction> eScorer=new EigenvectorCentrality<>(tsn);
for(Customer node:tsn.getVertices()){
            System.out.println(node.getName()+" :eigen:"+eScorer.getVertexScore(node));
        }

Would you please tell me what part of using eigenvector with jung library i missed? Regards.

Was it helpful?

Solution

I figure out how to calculate eigenvector using jung. Two line of code need for calculation of Eigenvector:

eScorer.acceptDisconnectedGraph(true);
eScorer.evaluate();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top