flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vasia <...@git.apache.org>
Subject [GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...
Date Mon, 12 Dec 2016 09:28:26 GMT
Github user vasia commented on a diff in the pull request:

    --- Diff: docs/dev/libs/gelly/bipartite_graph.md ---
    @@ -0,0 +1,148 @@
    +title: Graph Generators
    +nav-parent_id: graphs
    +nav-pos: 6
    +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
    +KIND, either express or implied.  See the License for the
    +specific language governing permissions and limitations
    +under the License.
    +* This will be replaced by the TOC
    +Bipartite Graph
    +A bipartite graph (also called a two-mode graph) is a type of graph where vertices are
separated into two disjoint sets. These sets are usually called top and bottom vertices. A
single edge in this graph can only connect vertices from opposite sets (i.e. bottom vertex
to top vertex) and cannot connect to vertices in the same set.
    +Theses graphs have wide application in practice and can be a more natural choice for
particular domains. For example to represent authorship of scientific papers top vertices
can represent scientific papers while bottom nodes will represent authors. Naturally a node
between a top and a bottom nodes would represent an authorship of a particular scientific
paper. Another common example for applications of bipartite graphs is a relationships between
actors and movies. In this case an edge represents that a particular actor played in a movie.
    +Bipartite graph are used instead of regular graphs (one-mode) for the following practical
    + * They preserve more information about a connection between vertices. For example instead
of a single link between two researchers in a graph that represents that they authored a paper
together a bipartite graph preserve the information about what papers they authored
    + * Bipartite graph can encode the same information more compactly than one-mode graphs
    +Graph Representation
    +A `BipartiteGraph` is represented by:
    + * `DataSet` of top nodes
    + * `DataSet` of bottom nodes
    + * `DataSet` of edges between top and bottom nodes
    +As in the `Graph` class nodes are represented by the `Vertex` type and the same rules
applies to its types and values.
    +The graph edges are represented by the `BipartiteEdge` type. An `BipartiteEdge` is defined
by a top ID (the ID of the top `Vertex`), a bottom ID (the ID of the bottom `Vertex`) and
an optional value. The main difference between the `Edge` and `BipartiteEdge` is that IDs
of nodes it links can be of different types. Edges with no value have a `NullValue` value
    +<div class="codetabs" markdown="1">
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +BipartiteEdge<Long, String, Double> e = new BipartiteEdge<Long, String, Double>(1L,
"id1", 0.5);
    +Double weight = e.getValue(); // weight = 0.5
    +{% endhighlight %}
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    --- End diff --
    Don't leave a TODO in the docs. Either state explicitly that BipartiteGraph currently
only exists in the Java API or we should make sure to implement the Scala methods before merging

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 infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message