Giraph支持哪些类型的Graph

本文介绍了Giraph图处理框架的特点,包括其分布式BSP性质、Vertex实现方式及不同类型的图输入处理方法,如无向图、无权图、加权图和多重图等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Due to the distributed BSP nature of Giraph, all graphs are represented by application code as a Vertex implementation. By subclassing existing Vertex implementations (strongly suggested at this stage of Giraph development) the user can decide on trade offs in memory and speed vs. feature set of that Vertex. This is also important because common, provided base classes in Giraph handle the underlying mechanisms for messaging vertices that are not local to the worker node hosting the sender vertex, etc. Only very experienced users are likely to have good luck re-implementing low-level Vertex bases such as those in graph/ – New users are encouraged to extend or emulate user-ready templates in the example/ directory instead.

Directed Graphs: All Giraph input data is considered directed by default. All edges represented in input data are assumed to be out-edges extending from the vertex with which they are associated in said data.

Undirected Graphs: When supplying a Giraph job with input data, the user must ensure that this data includes an out-edge from both adjacent neighbors in an undirected relationship. Example: if vertex 1 has an out-edge to vertex 33 in your data, when vertex 33 is read it had better contain an out-edge back to 1. If the data does not supply this information, Giraph will not detect this discrepancy for you!

Unweighted Graphs: In Giraph, an unweighted graph is selected by (1) Choosing or supplying a VertexInputFormat/VertexReader combo that expects out-edges without attached value data, and (2) setting the generic E parameter in the Vertex<I,V,E,M> as a NullWritable. This includes supplying NullWritable for the edge values where required (use NullWrtiable.get() to acquire a NullWritable object in Giraph, use "new" for other Writables!)

Weighted Graphs: A weighted graph can be supplied as input to Giraph when the user (1) Chooses or supplies a VertexInputFormat/VertexReader combo that expects out-edge destination data to also include out-edge value data, and (2) chooses the Writable subclass that the user wishes to represent the edge values and to applies it to the generic E parameter in application code.

Multigraphs: Giraph now features native support for Multigraphs! More to follow...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值