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

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

GitHub user andralungu opened a pull request:

    https://github.com/apache/flink/pull/801

    [FLINK-2150][gelly] Added library method for assigning unique labels to 
vertices

    This PR adds a library method that assigns unique labels to vertices. 
    The following facts are used:
     * a map function generates an n-bit(n - number of parallel tasks) ID based 
on its own index
     * with each record, a counter c is increased
     * the unique label is then produced by shifting the counter c by the n-bit 
mapper ID
    
    Thanks @fhueske for the useful tips!
    And thanks @rmetzger for the nice stackoverflow answer 
(http://stackoverflow.com/questions/30596556/zipwithindex-on-apache-flink)
    
    If you guys find some spare minutes, you are more than welcome to have a 
look at what I did here. If not, we'll just let @vasia do what she does best :) 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/andralungu/flink generateUniqueIds

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/801.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #801
    
----
commit d655187a9626be6aca734fdbe035de62e3ead839
Author: andralungu <lungu.an...@gmail.com>
Date:   2015-06-07T13:27:24Z

    [FLINK-2150][gelly] Added library method for assigning unique labels to 
vertcies

----


> Add a library method that assigns unique Long values to vertices
> ----------------------------------------------------------------
>
>                 Key: FLINK-2150
>                 URL: https://issues.apache.org/jira/browse/FLINK-2150
>             Project: Flink
>          Issue Type: New Feature
>          Components: Gelly
>            Reporter: Vasia Kalavri
>            Assignee: Andra Lungu
>            Priority: Minor
>              Labels: starter
>
> In some graph algorithms, it is required to initialize the vertex values with 
> unique values (e.g. label propagation).
> This issue proposes adding a Gelly library method that receives an input 
> graph and initializes its vertex values with unique Long values.
> This method can then also be used to improve the MusicProfiles example.



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

Reply via email to