[
https://issues.apache.org/jira/browse/FLINK-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14377667#comment-14377667
]
ASF GitHub Bot commented on FLINK-1726:
---------------------------------------
Github user vasia commented on a diff in the pull request:
https://github.com/apache/flink/pull/505#discussion_r27017296
--- Diff:
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SimpleCommunityDetection.java
---
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.graph.library;
+
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.flink.graph.Edge;
+import org.apache.flink.graph.Graph;
+import org.apache.flink.graph.GraphAlgorithm;
+import org.apache.flink.graph.spargel.MessageIterator;
+import org.apache.flink.graph.spargel.MessagingFunction;
+import org.apache.flink.graph.spargel.VertexCentricIteration;
+import org.apache.flink.graph.spargel.VertexUpdateFunction;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * Simple Community Detection Algorithm.
+ *
+ * Initially, each vertex is assigned a tuple formed of its own id along
with a score equal to 1.0, as value.
+ * The vertices propagate their labels and max scores in iterations, each
time adopting the label with the
+ * highest score from the list of received messages. The chosen label is
afterwards re-scored.
+ *
+ * The algorithm converges when vertices no longer update their value or
when the maximum number of iterations
+ * is reached.
--- End diff --
It would be nice to also add a link to the paper that describes the
algorithm in detail.
> Add Community Detection Library and Example
> -------------------------------------------
>
> Key: FLINK-1726
> URL: https://issues.apache.org/jira/browse/FLINK-1726
> Project: Flink
> Issue Type: Task
> Components: Gelly
> Affects Versions: 0.9
> Reporter: Andra Lungu
> Assignee: Andra Lungu
>
> Community detection paper: http://arxiv.org/pdf/0808.2633.pdf
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)