[
https://issues.apache.org/jira/browse/FLINK-2044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15289637#comment-15289637
]
ASF GitHub Bot commented on FLINK-2044:
---------------------------------------
Github user vasia commented on a diff in the pull request:
https://github.com/apache/flink/pull/1956#discussion_r63765397
--- Diff:
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/library/HITSAlgorithm.java
---
@@ -46,40 +46,89 @@
* represented a page that is linked by many different hubs.
* Each vertex has a value of Tuple2 type, the first field is hub score
and the second field is authority score.
* The implementation assumes that the two score are the same in each
vertex at the beginning.
+ * If the number of vertices of the input graph is known, it should be
provided as a parameter
+ * to speed up computation. Otherwise, the algorithm will first execute a
job to count the vertices.
* <p>
*
* @see <a href="https://en.wikipedia.org/wiki/HITS_algorithm">HITS
Algorithm</a>
*/
public class HITSAlgorithm<K, VV, EV> implements GraphAlgorithm<K, VV, EV,
DataSet<Vertex<K, Tuple2<DoubleValue, DoubleValue>>>> {
+ private final static int MAXIMUMITERATION = (Integer.MAX_VALUE - 1) / 2;
+ private final static double MINIMUMTHRESHOLD = 1e-9;
+
private int maxIterations;
+ private long numberOfVertices;
+ private double convergeThreshold;
+
+ public HITSAlgorithm(int maxIterations) {
+ this(maxIterations, MINIMUMTHRESHOLD);
+ }
+
+ public HITSAlgorithm(double convergeThreshold) {
+ this(MAXIMUMITERATION, convergeThreshold);
+ }
+
+ public HITSAlgorithm(int maxIterations, long numberOfVertices) {
+ this(maxIterations, MINIMUMTHRESHOLD, numberOfVertices);
+ }
+
+ public HITSAlgorithm(double convergeThreshold, long numberOfVertices) {
+ this(MAXIMUMITERATION, convergeThreshold, numberOfVertices);
+ }
/**
* Creates an instance of HITS algorithm.
*
- * @param maxIterations the maximum number of iterations
+ * @param maxIterations the maximum number of iterations
+ * @param convergeThreshold convergence threshold for sum of scores
--- End diff --
Can you extend the description of the convergenceThreshold argument a bit?
"Sum of scores" is not very clear imo.
> 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)