You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by mushketyk <gi...@git.apache.org> on 2016/12/10 17:42:18 UTC

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

GitHub user mushketyk opened a pull request:

    https://github.com/apache/flink/pull/2984

    [FLINK-5311] Add user documentation for bipartite graph

    Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful description of your changes.
    
    - [x] General
      - The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message (including the JIRA id)
    
    - [x] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [x] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis build has passed
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mushketyk/flink bipartite-docs

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/2984.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2984
    
----
commit 9c49eed7960ec1a7a853b32b742bd36615ba5fc0
Author: Ivan Mushketyk <iv...@gmail.com>
Date:   2016-12-10T17:41:30Z

    [FLINK-5311] Add user documentation for bipartite graph

----


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908875
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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 type.
    +
    +<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>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +{% top %}
    +
    +
    +Graph Creation
    +--------------
    +
    +You can create a `BipartiteGraph` in the following ways:
    +
    +* from a `DataSet` of top vertices, a `DataSet` of bottom vertices and a `DataSet` of edges:
    +
    +<div class="codetabs" markdown="1">
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    +
    +DataSet<Vertex<String, Long>> topVertices = ...
    +
    +DataSet<Vertex<String, Long>> bottomVertices = ...
    +
    +DataSet<Edge<String, String, Double>> edges = ...
    +
    +Graph<String, String, Long, Long, Double> graph = BipartiteGraph.fromDataSet(topVertices, bottomVertices, edges, env);
    +{% endhighlight %}
    +</div>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +
    +
    +Graph Transformations
    +---------------------
    +
    +
    +* <strong>Projection</strong>: Projection is a common operation for bipartite graphs that converts a bipartite graph into a regular graph. There are two types of projections: top and bottom projections. Top projection preserves only top nodes in the result graph and create a link between them in a new graph only if there is an intermediate bottom node both top nodes connect to in the original graph. Bottom projection is the opposite to top projection, i.e. only preserves bottom nodes and connects a pair of node if they are connected in the original graph.
    +
    +Gelly supports two sub-types of projections: simple projections and full projections. The only difference between them is what data is associated with edges in the result graph.
    +
    +In case of a simple projection each node in the result graph contains a pair of values of bipartite edges that connect nodes in the original graph:
    --- End diff --
    
    *the case


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908101
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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
    --- End diff --
    
    *graphs


---
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.
---

[GitHub] flink issue #2984: [FLINK-5311] Add user documentation for bipartite graph

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on the issue:

    https://github.com/apache/flink/pull/2984
  
    Thank you @mushketyk. That's OK. I'm merging this PR.


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908641
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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 type.
    +
    +<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>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +{% top %}
    +
    +
    +Graph Creation
    +--------------
    +
    +You can create a `BipartiteGraph` in the following ways:
    +
    +* from a `DataSet` of top vertices, a `DataSet` of bottom vertices and a `DataSet` of edges:
    +
    +<div class="codetabs" markdown="1">
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    +
    +DataSet<Vertex<String, Long>> topVertices = ...
    +
    +DataSet<Vertex<String, Long>> bottomVertices = ...
    +
    +DataSet<Edge<String, String, Double>> edges = ...
    +
    +Graph<String, String, Long, Long, Double> graph = BipartiteGraph.fromDataSet(topVertices, bottomVertices, edges, env);
    +{% endhighlight %}
    +</div>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +
    +
    +Graph Transformations
    +---------------------
    +
    +
    +* <strong>Projection</strong>: Projection is a common operation for bipartite graphs that converts a bipartite graph into a regular graph. There are two types of projections: top and bottom projections. Top projection preserves only top nodes in the result graph and create a link between them in a new graph only if there is an intermediate bottom node both top nodes connect to in the original graph. Bottom projection is the opposite to top projection, i.e. only preserves bottom nodes and connects a pair of node if they are connected in the original graph.
    --- End diff --
    
    *creates


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91907660
  
    --- Diff: docs/dev/libs/gelly/bipartite_graph.md ---
    @@ -0,0 +1,148 @@
    +---
    +title: Graph Generators
    --- End diff --
    
    This shouldn't be Graph Generators I believe :)


---
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.
---

[GitHub] flink issue #2984: [FLINK-5311] Add user documentation for bipartite graph

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on the issue:

    https://github.com/apache/flink/pull/2984
  
    Thank you for the update @mushketyk! I still don't see any link from the Gelly guide page to the bipartite docs though. Can you please add that too? Otherwise people won't be able to find the docs :)
    As for the images, I think it would be nice to have show how a projection works.


---
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.
---

[GitHub] flink issue #2984: [FLINK-5311] Add user documentation for bipartite graph

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on the issue:

    https://github.com/apache/flink/pull/2984
  
    Hi @mushketyk, thank you for the update!
    Just a couple of small things and we can merge:
    - Can you add a note in the beginning of the docs that bipartite graphs are only currently supported in the Gelly Java API?
    - I would rename the "Graph transformations" section to "Projection".


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908769
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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 type.
    +
    +<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>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +{% top %}
    +
    +
    +Graph Creation
    +--------------
    +
    +You can create a `BipartiteGraph` in the following ways:
    +
    +* from a `DataSet` of top vertices, a `DataSet` of bottom vertices and a `DataSet` of edges:
    +
    +<div class="codetabs" markdown="1">
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    +
    +DataSet<Vertex<String, Long>> topVertices = ...
    +
    +DataSet<Vertex<String, Long>> bottomVertices = ...
    +
    +DataSet<Edge<String, String, Double>> edges = ...
    +
    +Graph<String, String, Long, Long, Double> graph = BipartiteGraph.fromDataSet(topVertices, bottomVertices, edges, env);
    +{% endhighlight %}
    +</div>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +
    +
    +Graph Transformations
    +---------------------
    +
    +
    +* <strong>Projection</strong>: Projection is a common operation for bipartite graphs that converts a bipartite graph into a regular graph. There are two types of projections: top and bottom projections. Top projection preserves only top nodes in the result graph and create a link between them in a new graph only if there is an intermediate bottom node both top nodes connect to in the original graph. Bottom projection is the opposite to top projection, i.e. only preserves bottom nodes and connects a pair of node if they are connected in the original graph.
    --- End diff --
    
    Can you add a figure to illustrate a top and a bottom projection?


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908073
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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
    --- End diff --
    
    *preserves


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908174
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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
    --- End diff --
    
    *a DataSet...


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908032
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    --- End diff --
    
    *graphs


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908249
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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 type.
    --- End diff --
    
    *A BipartiteEdge


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91909237
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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 type.
    +
    +<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>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +{% top %}
    +
    +
    +Graph Creation
    +--------------
    +
    +You can create a `BipartiteGraph` in the following ways:
    +
    +* from a `DataSet` of top vertices, a `DataSet` of bottom vertices and a `DataSet` of edges:
    +
    +<div class="codetabs" markdown="1">
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    +
    +DataSet<Vertex<String, Long>> topVertices = ...
    +
    +DataSet<Vertex<String, Long>> bottomVertices = ...
    +
    +DataSet<Edge<String, String, Double>> edges = ...
    +
    +Graph<String, String, Long, Long, Double> graph = BipartiteGraph.fromDataSet(topVertices, bottomVertices, edges, env);
    +{% endhighlight %}
    +</div>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +
    +
    +Graph Transformations
    +---------------------
    +
    +
    +* <strong>Projection</strong>: Projection is a common operation for bipartite graphs that converts a bipartite graph into a regular graph. There are two types of projections: top and bottom projections. Top projection preserves only top nodes in the result graph and create a link between them in a new graph only if there is an intermediate bottom node both top nodes connect to in the original graph. Bottom projection is the opposite to top projection, i.e. only preserves bottom nodes and connects a pair of node if they are connected in the original graph.
    +
    +Gelly supports two sub-types of projections: simple projections and full projections. The only difference between them is what data is associated with edges in the result graph.
    +
    +In case of a simple projection each node in the result graph contains a pair of values of bipartite edges that connect nodes in the original graph:
    +
    +
    +<div class="codetabs" markdown="1">
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    +Graph<String, String, Long, Long, Double> bipartiteGraph = ...;
    +
    +Graph<String, Long, Tuple2<Double, Double>> graph bipartiteGraph.projectionBottomSimple();
    --- End diff --
    
    Again here, I believe we should either add a figure to illustrate or do something with the resulting projections in the code example to show why they are useful.


---
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.
---

[GitHub] flink issue #2984: [FLINK-5311] Add user documentation for bipartite graph

Posted by mushketyk <gi...@git.apache.org>.
Github user mushketyk commented on the issue:

    https://github.com/apache/flink/pull/2984
  
    Hi @vasia , thank you for your review!
    
    I've added the warning to the Bipartite Graph page.
    I am a bit reluctant to rename "Graph transformations" though since I wanted to extend this section in other commits when we have more operations for BipartiteGraph transformations, e.g. map.
    
    What do you think about this?


---
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.
---

[GitHub] flink issue #2984: [FLINK-5311] Add user documentation for bipartite graph

Posted by mushketyk <gi...@git.apache.org>.
Github user mushketyk commented on the issue:

    https://github.com/apache/flink/pull/2984
  
    Hi @vasia,
    
    Thank you for your review. I've updated the documentation accordingly and added more detailed descriptions for projections code examples. Do you think it is still better to add some images?


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908511
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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 type.
    +
    +<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>
    +
    +<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 this.


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908218
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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.
    --- End diff --
    
    *apply


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/2984


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908589
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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 type.
    +
    +<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>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +{% top %}
    +
    +
    +Graph Creation
    +--------------
    +
    +You can create a `BipartiteGraph` in the following ways:
    +
    +* from a `DataSet` of top vertices, a `DataSet` of bottom vertices and a `DataSet` of edges:
    +
    +<div class="codetabs" markdown="1">
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    +
    +DataSet<Vertex<String, Long>> topVertices = ...
    +
    +DataSet<Vertex<String, Long>> bottomVertices = ...
    +
    +DataSet<Edge<String, String, Double>> edges = ...
    +
    +Graph<String, String, Long, Long, Double> graph = BipartiteGraph.fromDataSet(topVertices, bottomVertices, edges, env);
    +{% endhighlight %}
    +</div>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    --- End diff --
    
    same as above


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by mushketyk <gi...@git.apache.org>.
Github user mushketyk commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91995428
  
    --- Diff: docs/dev/libs/gelly/bipartite_graph.md ---
    @@ -0,0 +1,148 @@
    +---
    +title: Graph Generators
    --- End diff --
    
    Oops, right :)


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91908677
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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 [reasons](http://www.complexnetworks.fr/wp-content/uploads/2011/01/socnet07.pdf):
    + * 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 type.
    +
    +<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>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +{% top %}
    +
    +
    +Graph Creation
    +--------------
    +
    +You can create a `BipartiteGraph` in the following ways:
    +
    +* from a `DataSet` of top vertices, a `DataSet` of bottom vertices and a `DataSet` of edges:
    +
    +<div class="codetabs" markdown="1">
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    +
    +DataSet<Vertex<String, Long>> topVertices = ...
    +
    +DataSet<Vertex<String, Long>> bottomVertices = ...
    +
    +DataSet<Edge<String, String, Double>> edges = ...
    +
    +Graph<String, String, Long, Long, Double> graph = BipartiteGraph.fromDataSet(topVertices, bottomVertices, edges, env);
    +{% endhighlight %}
    +</div>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// TODO: Should be added when Scala interface is implemented
    +{% endhighlight %}
    +</div>
    +</div>
    +
    +
    +Graph Transformations
    +---------------------
    +
    +
    +* <strong>Projection</strong>: Projection is a common operation for bipartite graphs that converts a bipartite graph into a regular graph. There are two types of projections: top and bottom projections. Top projection preserves only top nodes in the result graph and create a link between them in a new graph only if there is an intermediate bottom node both top nodes connect to in the original graph. Bottom projection is the opposite to top projection, i.e. only preserves bottom nodes and connects a pair of node if they are connected in the original graph.
    --- End diff --
    
    *nodes


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91907989
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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.
    --- End diff --
    
    a relationships => relationships


---
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.
---

[GitHub] flink issue #2984: [FLINK-5311] Add user documentation for bipartite graph

Posted by mushketyk <gi...@git.apache.org>.
Github user mushketyk commented on the issue:

    https://github.com/apache/flink/pull/2984
  
    Hi @vasia. Thank you for your comments. I've added the link to the doc and added the image (I tried to make it in the same style as other Gelly image).


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91907816
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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.
    --- End diff --
    
    A single edge => an edge
    cannot connect to vertices => cannot connect *two vertices


---
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.
---

[GitHub] flink pull request #2984: [FLINK-5311] Add user documentation for bipartite ...

Posted by vasia <gi...@git.apache.org>.
Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2984#discussion_r91907924
  
    --- 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
    +"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.
    +-->
    +
    +* This will be replaced by the TOC
    +{: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.
    --- End diff --
    
     a node between a top and a bottom nodes => an edge?


---
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.
---