giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paolo Castagna (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GIRAPH-202) SimplePageRankVertex and divide by zero
Date Wed, 06 Jun 2012 14:17:23 GMT
Paolo Castagna created GIRAPH-202:
-------------------------------------

             Summary: SimplePageRankVertex and divide by zero
                 Key: GIRAPH-202
                 URL: https://issues.apache.org/jira/browse/GIRAPH-202
             Project: Giraph
          Issue Type: Bug
            Reporter: Paolo Castagna
            Priority: Trivial


Current SimplePageRankVertex implementation might have a problem if there are vertexes with
not edges.

This should fix it (if you think it's a problem):

{code:java}
     if (getSuperstep() < MAX_SUPERSTEPS) {
       long edges = getNumOutEdges();
-      sendMsgToAllEdges(
-          new DoubleWritable(getVertexValue().get() / edges));
+      if ( edges > 0 ) {
+    	  sendMsgToAllEdges(
+    			  new DoubleWritable(getVertexValue().get() / edges));
+      }
     } else {
       voteToHalt();
     }
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message