You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@giraph.apache.org by "Claudio Martella (JIRA)" <ji...@apache.org> on 2012/06/07 18:13:40 UTC

[jira] [Commented] (GIRAPH-202) SimplePageRankVertex and divide by zero

    [ https://issues.apache.org/jira/browse/GIRAPH-202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291098#comment-13291098 ] 

Claudio Martella commented on GIRAPH-202:
-----------------------------------------

what do you dislike of uploading a patch? :)
                
> 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