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

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

Github user andralungu commented on the pull request:

    https://github.com/apache/flink/pull/544#issuecomment-88088234
  
    Sure, 
    
    I thought it was obvious from the ugly if :)
    
    In EmitOneEdgePerNode we have:
    public void flatMap(Edge<K, EV> edge, Collector<Tuple2<K, Edge<K, EV>>> 
out) {
      out.collect(new Tuple2<K, Edge<K, EV>>(edge.getSource(), edge));
      out.collect(new Tuple2<K, Edge<K, EV>>(edge.getTarget(), edge));
    } 
    
    so, for an edge 4-5;
    when you have 4 - you collect edge 4-5;
    when you have 5 - you collect edge 4-5 again.
    
    So, in Jaccard, instead of having:
    neighborsHashSet.add(next.f1) in the EdgesFunction, you now need to do 
something like:
    if(next.f1.getSource() == next.f0) {
         neighborsHashSet.add(next.f1.getTarget());
     } else {
         neighborsHashSet.add(next.f1.getSource());
    }
    
    If that's the desired behaviour we can keep the if, but at least for me, it 
was not expected :D 


> Add Jaccard Similarity Metric Example
> -------------------------------------
>
>                 Key: FLINK-1741
>                 URL: https://issues.apache.org/jira/browse/FLINK-1741
>             Project: Flink
>          Issue Type: Task
>          Components: Gelly
>    Affects Versions: 0.9
>            Reporter: Andra Lungu
>            Assignee: Andra Lungu
>
> http://www.inside-r.org/packages/cran/igraph/docs/similarity



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

Reply via email to