Github user gallenvara commented on a diff in the pull request: https://github.com/apache/flink/pull/1956#discussion_r63856679 --- 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) { --- End diff -- Done!
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---