[
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