0

I am having trouble understanding how the JUNG graph handles edgeweights. I am using PageRankWithPriors and when I use the constructor without edge weights I get OK results, but when I construct the PageRankWithPriors with edgeweights I get no results. PageRankWithPriors .getVertexScore() returns "NaN"

here is the constructor:

PageRankWithPriors<customVertex, customEdge> ranker = new PageRankWithPriors<customVertex, customEdge>(graph.getGraph(),
        new Transformer<customEdge, Double>() {
      @Override
      public Double transform(customEdge edge) {

          return edge.getnormalizedWeight();
      }
    },
    new Transformer<customVertex, Double>() {
      @Override
      public Double transform(customVertex vertex) {
        //return getSourceNodes().contains(vertex) ? 1.0 : 0;
          if (priorityVertexList !=null){
              if (priorityVertexList.contains(vertex)) return new Double((0.85/priorityVertexList.size())).doubleValue();
              else return new Double((0.15/(graph.getGraph().getVertexCount()-priorityVertexList.size()))).doubleValue();
          }
          else{
              return new Double((0.15/(graph.getGraph().getVertexCount()))).doubleValue();
          }
      }
    }, alpha);

so my question is how the edgeweights are interpreted... can I give an edge weight of 5 or does it have to be between 0 and 1? (propability)

cm4l
  • 31
  • 1
  • 5

1 Answers1

0

The edge weights represent transition probabilities, so the sum of the weights on the outgoing edges of a given vertex must be 1.

Joshua O'Madadhain
  • 2,704
  • 1
  • 14
  • 18
  • thank you for the info. I eventually figured this out and have the system working ok now. good answer. – cm4l Nov 03 '13 at 13:42