ClosenessCentrality Problem

  • Yifeng Zhang
    Yifeng Zhang

    My program crashed when calling the getVertexScore() function of ClosenessCentrality. A null pointer exception is reported. Please see both below. I can run BetweennessCentrality, PageRank without any problem. I found a thread on this in the forum that was posted several years ago. It seems there is a solution, but the instruction wasn't complete. Any help will be appreciated!

    ClosenessCentrality closenessScorer = new ClosenessCentrality(socialNetworkJung);
    for (User user : socialNetworkJung.getVertices()) {
    closenessMap.put(user, closenessScorer.getVertexScore(user));

    at edu.uci.ics.jung.algorithms.scoring.DistanceCentralityScorer.getVertexScore(

    Yifeng Zhang
    Univ. of Illinois at Springfield