[ https://issues.apache.org/jira/browse/FLINK-3772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15273993#comment-15273993 ]
ASF GitHub Bot commented on FLINK-3772: --------------------------------------- Github user greghogan commented on a diff in the pull request: https://github.com/apache/flink/pull/1901#discussion_r62325628 --- Diff: docs/apis/batch/libs/gelly.md --- @@ -2067,7 +2067,92 @@ configuration. <tbody> <tr> - <td><strong>TranslateGraphIds</strong></td> + <td>degree.annotate.directed.<br/><strong>VertexInDegree</strong></td> + <td> + <p>Annotate vertices of a directed graph with the in-degree count.</p> +{% highlight java %} +DataSet<Vertex<K, LongValue>> inDegree = graph + .run(new VertexInDegree() + .setIncludeZeroDegreeVertices(true)); +{% endhighlight %} + </td> + </tr> + + <tr> + <td>degree.annotate.directed.<br/><strong>VertexOutDegree</strong></td> + <td> + <p>Annotate vertices of a directed graph with the out-degree count.</p> +{% highlight java %} +DataSet<Vertex<K, LongValue>> outDegree = graph + .run(new VertexOutDegree() + .setIncludeZeroDegreeVertices(true)); +{% endhighlight %} + </td> + </tr> + + <tr> + <td>degree.annotate.directed.<br/><strong>VertexDegreePair</strong></td> + <td> + <p>Annotate vertices of a directed graph with both the out-degree and in-degree count.</p> +{% highlight java %} +DataSet<Vertex<K, Tuple2<LongValue, LongValue>>> pairDegree = graph + .run(new VertexDegreePair() + .setIncludeZeroDegreeVertices(true)); +{% endhighlight %} + </td> + </tr> + + <tr> + <td>degree.annotate.undirected.<br/><strong>VertexDegree</strong></td> + <td> + <p>Annotate vertices of an undirected graph with the degree count.</p> +{% highlight java %} +DataSet<Vertex<K, LongValue>> degree = graph + .run(new VertexDegree() + .setIncludeZeroDegreeVertices(true) + .setReduceOnTargetId(true)); +{% endhighlight %} + </td> + </tr> + + <tr> + <td>degree.annotate.undirected.<br/><strong>EdgeSourceDegree</strong></td> + <td> + <p>Annotate edges of an undirected graph with degree of the source ID.</p> --- End diff -- An `Edge` is always directed but a `Graph` may be undirected if it contains a matching reverse of every edge. > Graph algorithms for vertex and edge degree > ------------------------------------------- > > Key: FLINK-3772 > URL: https://issues.apache.org/jira/browse/FLINK-3772 > Project: Flink > Issue Type: New Feature > Components: Gelly > Affects Versions: 1.1.0 > Reporter: Greg Hogan > Assignee: Greg Hogan > Fix For: 1.1.0 > > > Many graph algorithms require vertices or edges to be marked with the degree. > This ticket provides algorithms for annotating > * vertex degree for undirected graphs > * vertex out-, in-, and out- and in-degree for directed graphs > * edge source, target, and source and target degree for undirected graphs -- This message was sent by Atlassian JIRA (v6.3.4#6332)