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] [Updated] (GIRAPH-202) SimplePageRankVertex and divide by zero
Date Thu, 07 Jun 2012 20:54:23 GMT

     [ https://issues.apache.org/jira/browse/GIRAPH-202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Paolo Castagna updated GIRAPH-202:
----------------------------------

    Attachment: GIRAPH-202.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
>         Attachments: GIRAPH-202.patch
>
>
> 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