You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@giraph.apache.org by Carmen Manzulli <ca...@gmail.com> on 2014/07/25 10:33:44 UTC

concept of vertex in giraph

 Hi experts,
i would like to ask you if , in the graph rapresentation, every time a
vertexId is reapeated, would giraph consider just one time that vertexId?

for example:

Carmen (vertexId) 24 (vertex value) .....
Carmen (vertexId) 1,60 m (vertex value)...

does it became

Carmen -->24
            -->1,60

from a point of view conceptual?

Re: concept of vertex in giraph

Posted by Lukas Nalezenec <lu...@firma.seznam.cz>.
BTW, You can fully customize vertex combining by writing our own 
Partition class.
Lukas

On 25.7.2014 10:56, Carmen Manzulli wrote:
> ah ok, thanksa lot!...so is the same for edgevalues and 
> targetvertexids??? i need to use combiners, can you show me where can 
> i read more information about?
>
>
> 2014-07-25 10:52 GMT+02:00 Lukas Nalezenec 
> <lukas.nalezenec@firma.seznam.cz 
> <ma...@firma.seznam.cz>>:
>
>     Hi,
>     Afaik vertex ids must be unique but you can combine vertexes with
>     same ID to one using VertexValueCombiner.
>
>     Lukas
>
>
>     On 25.7.2014 10:33, Carmen Manzulli wrote:
>>      Hi experts,
>>     i would like to ask you if , in the graph rapresentation, every
>>     time a vertexId is reapeated, would giraph consider just one time
>>     that vertexId?
>>
>>     for example:
>>
>>     Carmen (vertexId) 24 (vertex value) .....
>>     Carmen (vertexId) 1,60 m (vertex value)...
>>
>>     does it became
>>
>>     Carmen -->24
>>                 -->1,60
>>
>>     from a point of view conceptual?
>
>


Re: concept of vertex in giraph

Posted by Lukas Nalezenec <lu...@firma.seznam.cz>.
Hi
IMHO third way, overriding method combine in own Partition is best.
Lukas

On 25.7.2014 18:47, Schweiger, Tom wrote:
> Edges "combine" differently than vertexes.
>
> By default, each edge you read is added to the adjacency set of the 
> source vertex (all edges are directed in Giraph, if you had not 
> realized that yet).  So if you read multiple edge for the same source 
> -> target, they will all be represented in the source vertex's edges.
>
> If you actually need to combine edges there are two way to go about it.
>
> 1) (easy but unelegant) deal with the fact in your compute
>
> 2) (more involved but efficient) write your own OutEdges class, unless 
> one already exists that does what you need.
>
>
> ------------------------------------------------------------------------
> *From:* Carmen Manzulli [carmenmanzulli@gmail.com]
> *Sent:* Friday, July 25, 2014 1:56 AM
> *To:* user@giraph.apache.org
> *Subject:* Re: concept of vertex in giraph
>
> ah ok, thanksa lot!...so is the same for edgevalues and 
> targetvertexids??? i need to use combiners, can you show me where can 
> i read more information about?
>
>
> 2014-07-25 10:52 GMT+02:00 Lukas Nalezenec 
> <lukas.nalezenec@firma.seznam.cz 
> <ma...@firma.seznam.cz>>:
>
>     Hi,
>     Afaik vertex ids must be unique but you can combine vertexes with
>     same ID to one using VertexValueCombiner.
>
>     Lukas
>
>
>     On 25.7.2014 10:33, Carmen Manzulli wrote:
>>      Hi experts,
>>     i would like to ask you if , in the graph rapresentation, every
>>     time a vertexId is reapeated, would giraph consider just one time
>>     that vertexId?
>>
>>     for example:
>>
>>     Carmen (vertexId) 24 (vertex value) .....
>>     Carmen (vertexId) 1,60 m (vertex value)...
>>
>>     does it became
>>
>>     Carmen -->24
>>                 -->1,60
>>
>>     from a point of view conceptual?
>
>


RE: concept of vertex in giraph

Posted by "Schweiger, Tom" <th...@ebay.com>.
Edges "combine" differently than vertexes.

By default, each edge you read is added to the adjacency set of the source vertex (all edges are directed in Giraph, if you had not realized that yet).  So if you read multiple edge for the same source -> target, they will all be represented in the source vertex's edges.

If you actually need to combine edges there are two way to go about it.

1) (easy but unelegant) deal with the fact in your compute

2) (more involved but efficient) write your own OutEdges class, unless one already exists that does what you need.


________________________________
From: Carmen Manzulli [carmenmanzulli@gmail.com]
Sent: Friday, July 25, 2014 1:56 AM
To: user@giraph.apache.org
Subject: Re: concept of vertex in giraph

ah ok, thanksa lot!...so is the same for edgevalues and targetvertexids??? i need to use combiners, can you show me where can i read more information about?


2014-07-25 10:52 GMT+02:00 Lukas Nalezenec <lu...@firma.seznam.cz>>:
Hi,
Afaik vertex ids must be unique but you can combine vertexes with same ID to one using VertexValueCombiner.

Lukas


On 25.7.2014 10:33, Carmen Manzulli wrote:
 Hi experts,
i would like to ask you if , in the graph rapresentation, every time a vertexId is reapeated, would giraph consider just one time that vertexId?

for example:

Carmen (vertexId) 24 (vertex value) .....
Carmen (vertexId) 1,60 m (vertex value)...

does it became

Carmen -->24
            -->1,60

from a point of view conceptual?



Re: concept of vertex in giraph

Posted by Lukas Nalezenec <lu...@firma.seznam.cz>.
On 25.7.2014 10:56, Carmen Manzulli wrote:
> ah ok, thanksa lot!...so is the same for edgevalues and 
> targetvertexids??? i need to use combiners, can you show me where can 
> i read more information about?
>
>
I have never used the feature so I dont know much about it.

See source code.
For example ByteArrayPartition.java:183:

   /**
    * Combine two vertices together and store the serialized bytes
    * in the vertex map.
    *
    * @param representativeVertex existing vertex
    * @param representativeCombinerVertex new vertex to combine
    */
   private void combine(Vertex<I, V, E> representativeVertex,
       Vertex<I, V, E> representativeCombinerVertex) {
getVertexValueCombiner().combine(representativeVertex.getValue(),
         representativeCombinerVertex.getValue());
     // Add the edges to the representative vertex
     for (Edge<I, E> edge : representativeCombinerVertex.getEdges()) {
       representativeVertex.addEdge(edge);
     }
     vertexMap.put(representativeCombinerVertex.getId(),
         WritableUtils.writeVertexToByteArray(
             representativeVertex, useUnsafeSerialization, getConf()));
   }


By default Giraph uses DefaultVertexValueCombiner which does nothing.


> 2014-07-25 10:52 GMT+02:00 Lukas Nalezenec 
> <lukas.nalezenec@firma.seznam.cz 
> <ma...@firma.seznam.cz>>:
>
>     Hi,
>     Afaik vertex ids must be unique but you can combine vertexes with
>     same ID to one using VertexValueCombiner.
>
>     Lukas
>
>
>     On 25.7.2014 10:33, Carmen Manzulli wrote:
>>      Hi experts,
>>     i would like to ask you if , in the graph rapresentation, every
>>     time a vertexId is reapeated, would giraph consider just one time
>>     that vertexId?
>>
>>     for example:
>>
>>     Carmen (vertexId) 24 (vertex value) .....
>>     Carmen (vertexId) 1,60 m (vertex value)...
>>
>>     does it became
>>
>>     Carmen -->24
>>                 -->1,60
>>
>>     from a point of view conceptual?
>
>


Re: concept of vertex in giraph

Posted by Carmen Manzulli <ca...@gmail.com>.
ah ok, thanksa lot!...so is the same for edgevalues and targetvertexids???
i need to use combiners, can you show me where can i read more information
about?


2014-07-25 10:52 GMT+02:00 Lukas Nalezenec <lu...@firma.seznam.cz>
:

>  Hi,
> Afaik vertex ids must be unique but you can combine vertexes with same ID
> to one using VertexValueCombiner.
>
> Lukas
>
>
> On 25.7.2014 10:33, Carmen Manzulli wrote:
>
>      Hi experts,
>  i would like to ask you if , in the graph rapresentation, every time a
> vertexId is reapeated, would giraph consider just one time that vertexId?
>
>  for example:
>
>  Carmen (vertexId) 24 (vertex value) .....
>  Carmen (vertexId) 1,60 m (vertex value)...
>
>  does it became
>
>  Carmen -->24
>             -->1,60
>
>  from a point of view conceptual?
>
>
>

Re: concept of vertex in giraph

Posted by Lukas Nalezenec <lu...@firma.seznam.cz>.
Hi,
Afaik vertex ids must be unique but you can combine vertexes with same 
ID to one using VertexValueCombiner.

Lukas

On 25.7.2014 10:33, Carmen Manzulli wrote:
>  Hi experts,
> i would like to ask you if , in the graph rapresentation, every time a 
> vertexId is reapeated, would giraph consider just one time that vertexId?
>
> for example:
>
> Carmen (vertexId) 24 (vertex value) .....
> Carmen (vertexId) 1,60 m (vertex value)...
>
> does it became
>
> Carmen -->24
>             -->1,60
>
> from a point of view conceptual?