incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1139151 - /incubator/hama/trunk/src/examples/org/apache/hama/examples/graph/PageRank.java
Date Fri, 24 Jun 2011 04:13:17 GMT
Author: edwardyoon
Date: Fri Jun 24 04:13:16 2011
New Revision: 1139151

URL: http://svn.apache.org/viewvc?rev=1139151&view=rev
Log:
Fix typo.

Modified:
    incubator/hama/trunk/src/examples/org/apache/hama/examples/graph/PageRank.java

Modified: incubator/hama/trunk/src/examples/org/apache/hama/examples/graph/PageRank.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/examples/org/apache/hama/examples/graph/PageRank.java?rev=1139151&r1=1139150&r2=1139151&view=diff
==============================================================================
--- incubator/hama/trunk/src/examples/org/apache/hama/examples/graph/PageRank.java (original)
+++ incubator/hama/trunk/src/examples/org/apache/hama/examples/graph/PageRank.java Fri Jun
24 04:13:16 2011
@@ -153,7 +153,7 @@ public class PageRank extends PageRankBa
     List<PageRankVertex> outgoingEdges = adjacencyList.get(v);
     for (PageRankVertex adjacent : outgoingEdges) {
       int mod = Math.abs(adjacent.getId() % peerNames.length);
-      // send a message of the tentative pagerank devided by the size of
+      // send a message of the tentative pagerank divided by the size of
       // the outgoing edges to all adjacents
       peer.send(peerNames[mod], new DoubleMessage(adjacent.getUrl(),
           tentativePagerank.get(v) / outgoingEdges.size()));
@@ -164,8 +164,8 @@ public class PageRank extends PageRankBa
   public void setConf(Configuration conf) {
     this.conf = conf;
     numOfVertices = Integer.parseInt(conf.get("num.vertices"));
-    ALPHA = 0.15 / (double) numOfVertices;
     DAMPING_FACTOR = Double.parseDouble(conf.get("damping.factor"));
+    ALPHA = (1 - DAMPING_FACTOR) / (double) numOfVertices;
     EPSILON = Double.parseDouble(conf.get("epsilon.error"));
     MAX_ITERATIONS = Integer.parseInt(conf.get("max.iterations"));
     peerNames = conf.get(ShortestPaths.BSP_PEERS).split(";");



Mime
View raw message