暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
TKDE 2021_Graph Algorithms with Partition Transparency_深算院.pdf
98
12页
3次
2023-09-13
免费下载
Graph Algorithms with Partition Transparency
Wenfei Fan Muyang Liu Ping Lu Qiang Yin
Abstract—Graph computations often have to be conducted in parallel on partitioned graphs. The choice of graph partitioning
strategies, however, has strong impact on the design of graph computation algorithms. A graph algorithm developed under edge-cut
partitions may not work correctly under vertex-cut, and vice versa. We often have to rewrite our algorithms when we switch from, e.g.,
edge-cut to vertex-cut. To cope with this, we propose a notion of partition transparency, such that graph algorithms are able to work
correctly under different partitions without changes and moreover, benefit from recent hybrid partitions to speed up computations.
Furthermore, we identify conditions under which graph algorithms are guaranteed to be partition-transparent, in graph-centric and
vertex-centric models. We show that a variety of graph algorithms can be made partition-transparent. Using real-life and synthetic
graphs, we experimentally verify that partition-transparent algorithms compute correct answers under different partitions; better still,
under hybrid partitions these algorithms perform better than algorithms tailored for edge-cut and vertex-cut partitions in efficiency.
Index Terms—graph partition, partition transparency, graph-centric algorithms, vertex-centric algorithms
F
1 INTRODUCTION
To handle large-scale real-life graphs, it is often necessary to
conduct parallel computations on partitioned graphs. The
idea is to cut a large graph G into smaller fragments and
distribute the fragments to a cluster of processors (a.k.a.
workers), such that computations on G can be conducted in
parallel by the processors on their local fragments, subject
to message passing among different processors.
A variety of graph partitioning algorithms (a.k.a. parti-
tioners) have been developed. These partitioners are often
either edge-cut [8], [30], which evenly partitions vertices
and cuts edges, or vertex-cut [11], [25], [31], which evenly
partitions edges by replicating vertices. There have also been
recent work on hybrid partitioners, which cut both edges and
vertices [20], [14], [17], [52], [33], [9], [50], [43], to overcome
the limitations of edge-cut and vertex-cut partitions. It has
been shown that the hybrid partitioners often make graph
computations faster than edge-cut and vertex-cut.
The choice of a partitioning strategy has strong impact
on the performance of graph algorithms. Neither vertex-cut
nor edge-cut consistently outperforms the other for different
algorithms. Worse still, an algorithm developed under edge-
cut may not work correctly under vertex-cut, and vice versa.
Hence, when developing a parallel algorithm for a graph
computation problem, one has to decide in advance which
partitioning strategy to use. If the strategy picked does not
work well, we may want to switch to the other method,
but then we may have to rewrite our algorithms. Moreover,
algorithms developed for edge-cut and vertex-cut often
do not work correctly under hybrid partitions, and hence
cannot benefit from the state-of-the-art hybrid partitioners.
Wenfei Fan is with Shenzhen Institute of Computing Sciences, University
of Edinburgh, and BDBC, Beihang University
Email: wenfei@inf.ed.ac.uk.
Muyang Liu is with University of Edinburgh
Email: muyang.liu@ed.ac.uk.
Ping Lu (corresponding author) is with SKLSDE, Beihang University
Email: luping@buaa.edu.cn
Qiang Yin is with Shanghai Jiao Tong University and Alibaba Group
Email: q.yin@sjtu.edu.cn
(a) Graph G
(b) Edge-cut
(c) Vertex-cut
(d) Hybrid partition
F
e
1
F
e
2
F
e
1
F
v
2
F
v
1
F
h
2
F
h
1
v
5
v
2
v
4
v
3
v
1
v
2
v
4
v
3
v
1
v
5
v
2
v
4
v
1
v
2
v
4
v
3
v
1
v
2
v
4
v
3
v
5
v
2
v
4
v
3
v
1
v
5
v
2
v
4
v
3
v
1
Fig. 1: Graph partitions
Example 1: Consider the common neighbor problem (CN),
which computes the number of common neighbors for each
pair of vertices in a graph. It is widely used in link pre-
diction, product recommendation and fraud detection [35],
[16]. For a directed graph G = (V, E), where V is the
set of vertices and E is the set of edges, denote by Γ
+
(v)
(resp. Γ
(v)) the set of outgoing (resp. incoming) neighbors
of vertex v in V . To simplify the discussion, here we consider
common outgoing neighbors, i.e., given G, CN is to compute
CN(u, v) = |Γ
+
(u) Γ
+
(v)| for all pairs (u, v) V × V .
Consider graph G shown in Figure 1 and its partitions
(F
e
1
, F
e
2
) and (F
v
1
, F
v
2
) under edge-cut (Figure 1(a)) and
vertex-cut (Figure 1(b)), respectively. Observe the follow-
ing. (1) Edge-cut partitioning cuts edges to generate vertex
disjoint fragments, e.g., {v
1
, v
2
, v
5
} and {v
3
, v
4
}. A vertex
is assigned to only one fragment [8], [30] (colored in gray
in Figure 1), referred to as a master vertex; the others are
mirrors, e.g., v
3
in F
e
2
is a master vertex and v
3
in F
e
1
is a
mirror. Each master and all of its incident edges reside in the
same fragment. (2) In contrast, vertex-cut partitioning cuts
vertices to produce edge disjoint partitions. Thus all edges
incident to a master vertex may not be necessarily assigned
to the same fragment, e.g., v
2
is a master vertex in F
v
1
and
its edge set at F
v
1
does not include the edge (v
3
, v
2
), which
resides in fragment F
v
2
(see Figure 1(b)).
Algorithms developed for edge-cut partitions may not
work under vertex-cut partitions, and vice versa. To see
these, let us consider the following algorithms.
(1) Edge-cut. Under edge-cut, an algorithm A
e
for CN works
as follows. (a) For each master vertex v in a fragment F
e
k
,
it increases the local count CN
k
(v
i
, v
j
) for each incoming
neighbor pair (v
i
, v
j
) of v. (b) After this, A
e
collects the
local CN counts from all fragments, and computes their sum
for all vertex pairs (v
i
, v
j
). It returns the aggregate values
as the final result. One can verify that A
e
correctly returns
count CN(v
1
, v
3
) = 2 in the partition of Figure 1(a). Indeed,
CN(v
1
, v
3
) is set to be 1 after step (a) in each fragment, and
is then increased to 2 after the aggregation in step (b).
However, A
e
erroneously returns CN(v
1
, v
3
)=1 when it
runs on the vertex-cut partition of Figure 1(b). That is the
count in fragment F
v
2
due to the common neighbor v
4
. It
misses the common neighbor v
2
for v
1
and v
3
since the edge
(v
3
, v
2
) is missing for master vertex v
2
in fragment F
v
1
.
(2) Vertex-cut. Under vertex-cut, an algorithm A
v
works in
three steps. (a) It first computes the local count CN for each
master vertex v. (b) It then collects all incoming edges of
v from other fragments, and increases the CN counts using
these received edges. Denote by Γ
(v) the set of incoming
neighbors of v adjacent to received edges. Then A
v
increases
CN(v
i
, v
j
) for each v
i
Γ
(v) and v
j
Γ
(v), where
v
j
is a vertex on a received edge. Note that A
v
has all
incoming edges Γ
(v) of v after collecting edges from other
fragments. (c) Finally, it collects and aggregates local CN
counts from all fragments. One can verify that A
v
correctly
computes CN given the vertex-cut partition in Figure 1(b).
For instance, A
v
first increases the CN(v
1
, v
3
) in fragment
F
v
1
to 1, and then increases it to 2 after receiving (v
3
, v
2
).
In contrast, algorithm A
v
does not work correctly when
given the edge-cut partition of Figure 1(a). To see this,
observe that A
v
would return CN(v
1
, v
3
) = 4, which is
wrong. This is because there exist duplicated edges in the
edge-cut partition (e.g., (v
1
, v
4
) and (v
3
, v
2
) are in both F
e
1
and F
e
2
); after collecting such edges from other fragments,
A
v
counts CN(v
1
, v
3
) twice for each duplicated edge.
The problem with algorithm A
e
is that it assumes a
master vertex to have all its edges in its local fragment,
which is not true under vertex-cut. Algorithm A
v
gets
wrong answers on edge-cut partitions due to the duplicated
edges, which do not exist under vertex-cut partitions.
(3) Hybrid partition. For the same reason, neither algorithm
A
e
nor A
v
works under the hybrid partition (F
h
1
, F
h
2
) of
Figure 1(c). More specifically, master vertex v
4
in fragment
F
h
2
does not have all of its incident edges in F
h
2
, and edge
(v
3
, v
2
) replicates in F
h
1
and F
h
2
. As a result, A
e
finds
CN(v
1
, v
3
)=1, and A
v
gets CN(v
1
, v
3
)=3. None is correct. 2
This example gives rise to several questions. Is it possible
to make an algorithm A transparent to different partitions
of a graph G, i.e., it works correctly no matter how G is
partitioned? If so, we do not have to rewrite our algorithms
when, e.g., switching from edge-cut partitions to vertex-
cut; and better still, we can capitalize on the state-of-the-art
hybrid partitions to speed up graph computations. Another
question concerns under what conditions algorithms are
transparent to different partitions? Moreover, is it within the
reach in practice to develop transparent algorithms?
Contributions & organization. This paper aims to answer
the questions above, all in the affirmative. We consider
parallel graph-centric [23], [7] and vertex-centric [25], [36]
algorithms, which will be reviewed in Section 2.
(1) Partition transparency (Section 3). We introduce a notion
of partition transparency for parallel graph algorithms. A
partition-transparent algorithm A works correctly under both
edge-cut and vertex-cut without requiring any change to A.
Better yet, they work correctly under hybrid partitions, and
hence are able to reduce the cost of graph computations by
leveraging, e.g., application-driven partitions [20].
(2) Transparency conditions (Section 4). We identify conditions
for algorithm A to be guaranteed partition-transparent, i.e., A
works correctly under edge-cut, vertex-cut and hybrid par-
titions without requiring any change to A. We provide such
conditions for both graph-centric programs of GRAPE [23]
and vertex-centric GAS programs of PowerGraph [25].
(3) Transparent algorithms (Section 5). We show that partition-
transparent algorithms are within the reach of a variety of
problems, including common neighbor (CN), single source
shortest path (SSSP), weakly connected component (WCC),
PageRank (PR), strongly connected components (SCC), and
maximum cliques (MaxClique). We show that these algo-
rithms work correctly no matter what partitions are given.
(4) Experimental study (Section 6). Using real-life and syn-
thetic graphs, we verify the effectiveness and efficiency of
partition-transparent algorithms. We find the following. (a)
Transparent algorithms work correctly regardless of what
partitions are adopted, without changes, in both graph-
centric PIE mode and vertex-centric GAS model. (b) Trans-
parent algorithms A under hybrid partitions of [20] are
on average 2.3 times faster than non-transparent B under
vertex-cut or edge-cut, while B may not work correctly
under hybrid partitions. (c) Even when all algorithms run
under vertex-cut and edge-cut, transparent A performs
comparably to B developed for vertex-cut and edge-cut.
The performance gap is less than 5.8%. (d) Under hybrid
partitions, transparent algorithms scale well with both the
size of graphs and the number of processors used, e.g.,
transparent WCC and PR take on average 66.5s on graphs
of 500 million nodes and 6 billion edges with 90 processors.
Related work. This paper extends its conference version [20]
as follows. (1) While [20] targets hybrid partitioners, this
paper focuses on partition-transparent algorithms. We have
substantially reorganized and rewritten a large part of the
paper, from motivation and examples to technical discus-
sions (Sections 1–7). (2) We have provided a detailed anal-
ysis of partition transparency conditions for graph-centric
algorithms, from examples to proofs; we have also devel-
oped new transparency conditions for vertex-centric GAS
programs (Section 4). (3) We have developed new partition-
transparent algorithms as proof of concept (Section 5: SSSP,
WCC, SCC and MaxClique). (4) The experimental study
is almost entirely new, and evaluates partition-transparent
algorithms with more cases and datasets (Section 6).
We discuss the other related work as follows.
A host of graph partitioners have been developed for
edge-cut and vertex-cut (see [13], [10] for surveys). Edge-cut
(resp. vertex-cut) aims to (a) partition vertices (resp. edges)
into disjoint subsets of even sizes for load balancing, and
(b) reduce replicated edges (resp. vertices). Popular edge-
cut partitioners include exact algorithms [8], [32] such as
METIS [28], [29] and its parallel version ParMETIS [27], as
2
of 12
免费下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜