Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1956#discussion_r63765556
  
    --- Diff: 
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/library/HITSAlgorithm.java
 ---
    @@ -122,22 +179,45 @@ public void updateVertex(Vertex<K, 
Tuple2<DoubleValue, DoubleValue>> vertex, Mes
                        DoubleValue newAuthorityValue = vertex.getValue().f1;
     
                        if (getSuperstepNumber() > 1) {
    -                           iterationValueSum = Math.sqrt(((DoubleValue) 
getPreviousIterationAggregate("sumVertexValue")).getValue());
    +                           iterationValueSum = Math.sqrt(((DoubleValue) 
getPreviousIterationAggregate("updatedValueSum")).getValue());
                        }
    -                   if (getSuperstepNumber() != maxIteration) {
    +                   if (getSuperstepNumber() < maxIteration) {
                                if (getSuperstepNumber() % 2 == 1) {
    -                                   
newHubValue.setValue(newHubValue.getValue() / iterationValueSum);
    -                                   newAuthorityValue.setValue(updateValue);
    +
    +                                   //in the first iteration, the diff is 
the authority value of each vertex
    +                                   double previousAuthAverage = 1.0;
    +                                   double diffValueSum = 1.0 * 
numberOfVertices;
    +                                   if (getSuperstepNumber() > 1) {
    +                                           previousAuthAverage = 
((DoubleValue) getPreviousIterationAggregate("authorityValueSum")).getValue() / 
numberOfVertices;
    +                                           diffValueSum = ((DoubleValue) 
getPreviousIterationAggregate("diffValueSum")).getValue();
    +                                   }
    +                                   
authoritySumAggregator.aggregate(previousAuthAverage);
    +                                   
    +                                   if (diffValueSum > convergeThreshold) {
    +                                           
newHubValue.setValue(newHubValue.getValue() / iterationValueSum);
    +                                           
newAuthorityValue.setValue(updateValue);
    +                                   } else {
    +
    +                                           //scores are converged and stop 
iteration
    +                                           maxIteration = 
getSuperstepNumber();
    --- End diff --
    
    I don't think this assignment has any effect?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to