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

ASF GitHub Bot commented on FLINK-2044:
---------------------------------------

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

    https://github.com/apache/flink/pull/1956#discussion_r64055156
  
    --- Diff: 
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/library/HITSAlgorithm.java
 ---
    @@ -243,18 +255,22 @@ public void sendMessages(Vertex<K, 
Tuple2<DoubleValue, DoubleValue>> vertex) {
                                iterationValueSum = Math.sqrt(((DoubleValue) 
getPreviousIterationAggregate("updatedValueSum")).getValue());
                        }
                        for (Edge<K, EV> edge : getEdges()) {
    -                           K messageSource = getSuperstepNumber() % 2 == 1 
? edge.getSource() : edge.getTarget();
    -                           K messageTarget = getSuperstepNumber() % 2 == 1 
? edge.getTarget() : edge.getSource();
    -                           double messageValue = getSuperstepNumber() % 2 
== 1 ? vertex.getValue().f0.getValue() : vertex.getValue().f1.getValue();
    -
    -                           if (!messageTarget.equals(vertex.getId())) {
    -                                   if (getSuperstepNumber() != 
maxIteration) {
    -                                           sendMessageTo(messageTarget, 
messageValue / iterationValueSum);
    -
    -                                           // in order to make every 
vertex updated
    -                                           sendMessageTo(messageSource, 
0.0);
    +                           if (getSuperstepNumber() != maxIteration) {
    +                                   if (getSuperstepNumber() % 2 == 1) {
    +                                           if 
(edge.getValue().equals("Authority")) {
    +                                                   
sendMessageTo(edge.getTarget(), vertex.getValue().f0.getValue() / 
iterationValueSum);
    +                                           }
                                        } else {
    -                                           sendMessageTo(messageSource, 
iterationValueSum);
    +                                           if 
(edge.getValue().equals("Hub")) {
    +                                                   
sendMessageTo(edge.getTarget(), vertex.getValue().f1.getValue() / 
iterationValueSum);
    +                                           }
    +                                   }
    +                                   
    +                                   // make all the vertices be updated
    +                                   sendMessageTo(edge.getSource(), 0.0);
    --- End diff --
    
    Sorry, this line should be moved. :)
    In the previous commit without edge label, i use the same edge for hub and 
authority updating and this line would keep every vertex updating. But in the 
newest implementation with edge label, we can drop this because the added edges 
can do the same work.


> Implementation of Gelly HITS Algorithm
> --------------------------------------
>
>                 Key: FLINK-2044
>                 URL: https://issues.apache.org/jira/browse/FLINK-2044
>             Project: Flink
>          Issue Type: New Feature
>          Components: Gelly
>            Reporter: Ahamd Javid
>            Assignee: GaoLun
>            Priority: Minor
>
> Implementation of Hits Algorithm in Gelly API using Java. the feature branch 
> can be found here: (https://github.com/JavidMayar/flink/commits/HITS)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to