You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@giraph.apache.org by "Roman K (JIRA)" <ji...@apache.org> on 2012/05/08 11:08:24 UTC

[jira] [Commented] (GIRAPH-141) mulitgraph support in giraph

    [ https://issues.apache.org/jira/browse/GIRAPH-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13270329#comment-13270329 ] 

Roman K commented on GIRAPH-141:
--------------------------------

On one hand, the problem with two separate constructions for two graph types (like 2 separate vertex implementations ) is that it would lead to some code-duplications, though not too many but there will be.
On the other hand, if you chose to implement the simple graph as the private case of multigraph, it would have some memory overhead (i.e. edge value for simple graph per vertex is 4 bytes vs 20 bytes, which turns into additional 2MB in heap for 1M vertices) and some slight performance impact (which, in my opinion, can be neglected) and the simplicity of the API could be somewhat preserved.
In my opinion, creation of two separate APIs is less preferable because it would complicate things for people who want, for some reason, migrate their simple graph to multigraph.
                
> mulitgraph support in giraph
> ----------------------------
>
>                 Key: GIRAPH-141
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-141
>             Project: Giraph
>          Issue Type: Improvement
>          Components: graph
>            Reporter: André Kelpe
>
> The current vertex API only supports simple graphs, meaning that there can only ever be one edge between two vertices. Many graphs like the road network are in fact multigraphs, where many edges can connect two vertices at the same time.
> Support for this could be added by introducing an Iterator<EdgeWritable> getEdgeValue() or a similar construct. Maybe introducing a slim object like a Connector between the edge and the vertex is also a good idea, so that you could do something like:
> {code} 
> for (final Connector<EdgeWritable, VertexWritable> conn: getEdgeValues(){
>      final EdgeWritable edge = conn.getEdge();
>      final VertexWritable otherVertex = conn.getOther();
>      doInterestingStuff(otherVertex);
>      doMoreInterestingStuff(edge);
> }
> {code} 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira