• No results found

Effective Community Search for Large Attributed Graphs

N/A
N/A
Protected

Academic year: 2021

Share "Effective Community Search for Large Attributed Graphs"

Copied!
18
0
0

Loading.... (view fulltext now)

Full text

(1)

Title

Effective Community Search for Large Attributed Graphs

Author(s)

FANG, Y; Cheng, CK; LUO, S; HU, J

Citation

Proceedings of the VLDB Endowment, 2016, v. 9 n. 12, p. 1233-

1244

Issued Date

2016

URL

http://hdl.handle.net/10722/232839

Rights

Proceedings of the VLDB Endowment. Copyright © Proceedings

of the VLDB Endowment International Conference on Very Large

Data Bases.; This work is licensed under a Creative Commons

Attribution-NonCommercial-NoDerivatives 4.0 International

License.

(2)

Effective Community Search for Large Attributed Graphs

Yixiang Fang, Reynold Cheng, Siqiang Luo, Jiafeng Hu

Department of Computer Science, The University of Hong Kong, Pokfulam Road, Hong Kong

{

yxfang, ckcheng, sqluo, jhu

}

@cs.hku.hk

ABSTRACT

Given a graphGand a vertexq∈G, thecommunity searchquery

returns a subgraph ofGthat contains vertices related toq. Commu-nities, which are prevalent inattributed graphssuch as social net-works and knowledge bases, can be used in emerging applications such as product advertisement and setting up of social events. In

this paper, we investigate theattributed community query(or

AC-Q), which returns anattributed community(AC) for anattributed

graph. The AC is a subgraph ofG, which satisfies bothstructure

cohesiveness(i.e., its vertices are tightly connected) andkeyword

cohesiveness(i.e., its vertices share common keywords). The AC

enables a better understanding of how and why a community is formed (e.g., members of an AC have a common interest in mu-sic, because they all have the same keyword “music”). An AC can be “personalized”; for example, an ACQ user may specify that an AC returned should be related to some specific keywords like “re-search” and “sports”.

To enable efficient AC search, we develop the CL-tree structure and three algorithms based on it. We evaluate our solutions on four large graphs, namely Flickr, DBLP, Tencent, and DBpedia. Our re-sults show that ACs are more effective and efficient than existing community retrieval approaches. Moreover, an AC contains more precise and personalized information than that of existing commu-nity search and detection methods.

1.

INTRODUCTION

Due to the recent developments of gigantic social networks (e.g., Flickr, Facebook, and Twitter), the topic ofattributed graphshas attracted attention from industry and research communities [28, 3, 6, 15, 17, 32, 18]. An attributed graph is essentially a graph associ-ated with text strings or keywords. Figure 1 illustrates an attributed graph, where each vertex represents a social network user, and its keywords describe the interest of that user.

In this paper, we investigate theattributed community query(or

ACQ). Given an attributed graphGand a vertexq∈G, the ACQ

returns one or more subgraphs ofGknown asattributed

commu-nities(or ACs). An AC is a kind ofcommunity, which consists of

vertices that are closely related [27, 5, 4, 16, 23, 12]. Particularly,

Yixiang: hiking, swimming Jiafeng: hiking, swimming

Reynold: research

Ivy: hiking Yong: hiking, swimming, ping-pong

Kai: hiking, swimming Tomas: hiking Tomas: hiking

Bob: {research, tour, yoga}

Tom: {art, tour, yoga}

Alice: {art, cook, yoga}

Jack: {research, sport, tour} Mike: {art, research, sport}

Ada: {cook, music, yoga} Jane: {art, drama, music} John: {kongfu, research, web}

Bob: {research, sport, yoga}

Tom: {art, chess, yoga}

Alice: {art, cook, yoga}

Jack: {research, sport, tour} Mike: {art, research, sport}

Ada: {cook, music, yoga} Jane: {art, drama, music} John: {kungfu, research, web}

Bob: {research, sports, yoga}

Tom: {art, chess, yoga}

Alice: {art, cook, yoga}

Jack: {research, sports, tour} Mike: {art, research, sports}

Ada: {cook, music, yoga} Jane: {art, drama, music} John: {kungfu, research, web}

Bob:{research, sports, yoga}

Tom:{fiction, film, game}

Alice:{art, music, yoga}

Jack:{research, sports, tour} Mike:{film, research, sports}

Anna:{art, cook, music} Ada:{art, cook, music} John:{research, sports, web} Alex:{chess, tour, research}

Bob:{chess, research, sports, yoga}

Tom:{research, sports, game}

Alice:{art, music, tour}

Jack:{research, sports, web} Mike:{research, sports, yoga}

Anna:{art, cook, tour} Ada:{art, cook, music} John:{chess, film, yoga} Alex:{chess, web, yoga}

Figure 1: Attributed graph and AC (circled).

Table 1: Classification of works in community retrieval. Graph Type Community detection (CD) Community search (CS) Non-attributed [23, 12] [27, 5, 4, 16, 19]

Attributed [33, 22, 21, 28, 24] ACQ (This paper)

an AC satisfiesstructure cohesiveness(i.e., its vertices are close-ly linked to each other) andkeyword cohesiveness(i.e., its vertices have keywords in common). Figure 1 illustrates an AC (circled), which is a connected subgraph with vertex degree 3; its vertices

{Jack,Bob,John,Mike}have two keywords (i.e., “research”

and “sports”) in common.

Prior works. The problems related to retrieving communities

from a graph can generally be classified intocommunity detection

(CD) andcommunity search(CS). In general, CD algorithms aim

to retrieve all communities for a graph [33, 22, 21, 28, 24]. These solutions are not “query-based”, i.e., they are not customized for a query request (e.g., a user-specified query vertex). Moreover, they can take a long time to find all the communities for a large graph, and so they are not suitable for quick oronlineretrieval of commu-nities. To solve these problems, CS solutions have been recently developed [27, 5, 4, 16]. These approaches are query-based, and are able to derive communities in an “online” manner. However,

existing CS algorithms assumenon-attributedgraphs, and only use

the graph structure information to find communities. The ACQ is a class of CS problem for attributed graphs. As we will show, the use of keyword information can significantly improve the effectiveness of the communities retrieved. Table 1 summarizes some represen-tative existing works in this area.

Features of ACs.We now present more details about ACs. •Ease of interpretation. As demonstrated in Figure 1, an AC contains tightly-connected vertices with similar contexts or back-grounds. Thus, an ACQ user can focus on the common keywords or features of these vertices (e.g., the vertices of the AC in this ex-ample contain “research” and “sports”, reflecting that all members of this AC like research and sports). We call the set of common

1

(3)

keywords among AC vertices theAC-label. In our experiments, the AC-labels facilitate understanding of the vertices that form the AC. The design of ACs allows it to be used in setting up of social events. For example, if a Twitter member has many keywords about traveling (e.g., he posted a lot of photos about his trips, with key-words), issuing an ACQ with this member as the query vertex may return other members interested in traveling, because their vertices also have keywords related to traveling. A group tour can then be recommended to these members.

•Personalization. The user of an ACQ can control the

semantic-s of the AC, by semantic-specifying a semantic-set ofS of keywords. Intuitively,S

decides the meaning of the AC based on the user’s need. If we let

q=JackandS={“research”}, the AC is formed by{Jack,Bob,

John,Mike,Alex}, who are all interested in research. Let us

consider another example in the DBLP bibliographical network, where each vertex’s attribute is represented by the top-20 frequent keywords in their publications. Letq=Jim Gray. IfSis the set

of keywords{transaction, data, management, system, research},

we obtain the AC in Figure 2(a), which contains six prominen-t daprominen-tabase researchers closely relaprominen-ted prominen-to Jim. On prominen-the oprominen-ther hand,

whenS is {sloan, digital, sky, survey, SDSS}, the ACQ

yield-s another AC in Figure 2(b), which indicateyield-s the yield-seven yield-scientiyield-styield-s involved in the SDSS project1. Thus, with the use of different key-word setsS, different “personalized” communities can be obtained. Existing CS algorithms, which do not handle attributed graphs, may not produce the two ACs above. For example, the CS

algorith-m in [27] returns the coalgorith-malgorith-munity withallthe 14 vertices shown in

Figures 2(a) and (b). The main reasons are: (1) these vertices are heavily linked with Jim; and (2) the keywords are not considered. In contrast, the use of setSin the ACQ places these vertices into two communities, containing vertices that are cohesive in terms of

structureandkeyword. This allows a user to focus on the important

vertices that are related toS. For example, using the AC of Fig-ure 2(a), a database conference organizer can invite speakers who have a close relationship with Jim.

The personalization feature is also useful in marketing. Suppose that Mary, a yoga lover, is a customer of a gym. An ACQ can be issued on a social network, with Mary as the query vertex and

S={“yoga”}. Since members of the AC contain the keyword

“yo-ga”, they can be the gym’s advertising targets. On the other hand, current CS algorithms may return a community that contains one or more vertices without the keyword “yoga”. It is not clear whether the corresponding user of this vertex is interested in yoga. •Online evaluation.Similar to other CS solutions, we have devel-oped efficient ACQ algorithms for large graphs, allowing ACs to be generated quickly upon a query request. On the contrary, existing CD algorithms [33, 24, 22, 21] that generate all communities for a graph are often considered to be offline solutions, since they are often costly and time-consuming, especially on very large graphs.

Technical challenges and our contributions. We face two im-portant questions: (1) What should be a sound definition of an AC? (2) How to evaluate ACQ efficiently? For the first question, we

de-fine an AC based on theminimum degree, which is one of the most

common structure cohesiveness metrics [23, 12, 27, 5]. This mea-sure requires that every vertex in the community has a degree ofk

or more. We formulate the keyword cohesiveness as maximizing

the number of shared keywords in keyword setS. The shared

key-words naturally reveal the common features among vertices (e.g., common interest of social network users). We can also use these shared keywords to explain how a community is formed.

1

URL of the SDSS project:http://www.sdss.org.

Jiawei Han Jeffrey Xu Yu Xifeng Yan Dong Xin Hong Cheng Jian Pei

Frequent pattern mining

Jiawei Han Charu C. Aggarwal Mohammad M. Masud Nikunj C. Oza Latifur khan Jing Gao

Data stream classification Hongyan Liu Reynold Cheng Hans-peter Kriege Matthias Renz Lei Chen Andreas zufle

Efficient probabilistic data query database Hans-peter Kriege Jeffrey Xu Yu Philip S. Yu Ada Wai-chee Matthias Renz

Efficient query data mine database Andreas zufle

Yiping Ke Reynold Cheng

Ben Kao Kwok-wa Lam Tei-wei Kuo Sheung-lun Hung Kam-yiu Lam Victor C. S. Lee

Concurrency control database system

Ben Kao

Michael Chau

Reynold Cheng David Wai-lok Cheung

Kevin Y. Yip

Sau Dan Lee

Data mine uncertain system

Jiawei Han Xifeng Yan Philip S. Yu Yizhou Sun Tianyi Wu Jiawei Han Jeffrey Xu Yu Philip S. Yu Jianyong Wang Jian Pei Guozhu Dong Jim Gray Michael Stonebraker

Hector Garcia-Moina Stanley B. Zdonik Gerhard Weikum Bruce G. Lindsay Michael L. Brodie Jim Gray Peter Z. Kunszt Christopher Stoughton Alexander S. Szalay Jordan Raddick Jan Vandenberg Ani Thakar Tanu Malik

(a)S={transaction, data, man-agement, system, research}

Jiawei Han Jeffrey Xu Yu Xifeng Yan Dong Xin Hong Cheng Jian Pei

Frequent pattern mining

Jiawei Han Charu C. Aggarwal Mohammad M. Masud Nikunj C. Oza Latifur khan Jing Gao

Data stream classification Hongyan Liu Reynold Cheng Hans-peter Kriege Matthias Renz Lei Chen Andreas zufle

Efficient probabilistic data query database Hans-peter Kriege Jeffrey Xu Yu Philip S. Yu Ada Wai-chee Matthias Renz

Efficient query data mine database Andreas zufle

Yiping Ke Reynold Cheng

Ben Kao Kwok-wa Lam Tei-wei Kuo Sheung-lun Hung Kam-yiu Lam Victor C. S. Lee

Concurrency control database system

Ben Kao

Michael Chau

Reynold Cheng David Wai-lok Cheung

Kevin Y. Yip

Sau Dan Lee

Data mine uncertain system

Jiawei Han Xifeng Yan Philip S. Yu Yizhou Sun Tianyi Wu Jiawei Han Jeffrey Xu Yu Philip S. Yu Jianyong Wang Jian Pei Guozhu Dong Jim Gray Michael Stonebraker

Hector Garcia-Moina Stanley B. Zdonik Gerhard Weikum Bruce G. Lindsay Michael L. Brodie Jim Gray Peter Z. Kunszt Christopher Stoughton Alexander S. Szalay Jordan Raddick Jan Vandenberg Ani Thakar Tanu Malik

(b)S={sloan, digital, sky, da-ta, sdss}

Figure 2: Two ACs of Jim Gray.

The second question is not easy to answer, because the attribut-ed graphGto be explored can be very large, and the (structure and keyword) cohesiveness criteria can be complex to handle. A simple way is first to consider all the possible keyword combinations, and then return the subgraphs, which satisfy the minimum degree con-straint and have the most shared keywords. This solution, which requires the enumeration of all the subsets ofq’s keyword set, has a complexity exponential to the sizelofq’s keyword set. In our experiments, for some queries,lcan be up to 30, resulting in the consideration of230= 1,073,741,824subsets ofq. The algorith-m is ialgorith-mpractical, especially whenq’s keyword set is large.

We observe theanti-monotonicityproperty, which states that giv-en a setSof keywords, if it appears in every vertex of an AC, then for every subsetS0ofS, there exists an AC in which every vertex containsS0. We use this intuition to propose better algorithms. We further develop theCL-tree, an index that organizes the vertex key-word data in a hierarchical structure. The CL-tree has a space and construction time complexity linear to the size ofG. We have de-veloped three different ACQ algorithms based on the CL-tree, and they are able to achieve a superior performance.

We have performed extensive experiments on four large real graph datasets (namely Flickr, DBLP, Tencent, and DBpedia). We found that a large number of common keywords appear across vertices in our graph datasets. In DBLP, for instance, an AC with one com-mon keyword contains over 5,000 vertices on average; an AC with two common keywords contains over 700 vertices. Hence, using shared keywords among vertices as keyword cohesiveness makes sense. We have also studied how to quantify the quality of a com-munity, based on occurrence frequencies of keywords and similar-ity between the keyword sets of two vertices. We conducted a de-tailed case study on DBLP. These results confirm the superiority of the AC over the communities returned by existing community de-tection and community search algorithms, in terms of community quality. The performance of our best algorithm is 2 to 3 order-of-magnitude better than solutions that do not use the CL-tree. An-other advantage of our approaches is that they organize and search vertex keywords for ACs effectively, achieving a higher efficiency than existing community search solutions (that do not use vertex keywords in the community search process).

Organization. We review the related work in Section 2, and define the ACQ problem formally in Section 3. Section 4 presents the basic solutions, and Section 5 discusses the CL-tree index. We present the query algorithms in Section 6. Our experimental results are reported in Section 7. We conclude in Section 8.

2.

RELATED WORK

Community detection (CD).A large class of studies aim to

dis-cover ordetectall the communities from an entire graph. Table 1

summarises these works. Earlier solutions, such as [23, 12], em-ploy link-based analysis to obtain these communities. However, they do not consider the textual information associated with graphs.

(4)

Recent works focus on attributed graphs, and use clustering tech-niques to identify communities. For instance, Zhou et al. [33] con-sidered both links and keywords of vertices to compute the vertices’ pairwise similarities, and then clustered the graph. Ruan et al. [24]

proposed a method calledCODICIL. This solution augments the

original graphs by creating new edges based on content similarity, and then uses an effective graph sampling to boost the efficiency of clustering. We will compare ACQ with this method experimentally. Another common approach is based on topic models. In [22,

21], theLink-PLSA-LDAandTopic-Link LDAmodels

joint-ly model vertices’ content and links based on theLDAmodel. In [28], the attributed graph is clustered based on probabilistic inference. In [25], the topics, interaction types and the social connections

are considered for discovering communities. CESNA[30]

detect-s overlapping communitiedetect-s by adetect-sdetect-suming communitiedetect-s “generate” both the link and content. A discriminative approach [31] has also been considered for community detection. As discussed before, CD algorithms are generally slow, as they often consider the pairwise distance/similarity among vertices. Also, it is not clear how they can be adapted to perform online ACQ. In this paper, we propose online algorithms for finding communities on attributed graphs.

Community search (CS).Another class of solutions aims to ob-tain communities in an “online” manner, based on a query request. For example, given a vertexq, several existing works [27, 5, 19, 4, 16] have developed fast algorithms to obtain a community forq.

To measure the structure cohesiveness of a community, the

mini-mum degreeis often used [27, 5, 19]. Sozio et al. [27] proposed

the first algorithmGlobalto find thek-cored containingq. Cui

et al. [5] proposedLocal, which uses local expansion techniques

to enhance the performance ofGlobal. We will compare these

two solutions in our experiments. Other definitions, includingk -clique [4] andk-truss [16], have also been considered for searching communities. A recent work [19] finds communities with high in-fluence. These works assume non-attributed graphs, and overlook the rich information of vertices that come with attributed graphs. As we will see, performing CS on attributed graphs is better than on non-attributed graphs.

Graph keyword search.Given an attributed graphGand a set

Qof keywords, graph keyword search solutions output a tree struc-ture, whose nodes are vertices ofG, and the union of these vertices’ keyword sets is a superset ofQ[3, 6, 17]. Recent work studies the

use of a subgraph ofGas the query output [18]. These works

are substantially different from the ACQ problem. First, they do not specify query vertices as required by the ACQ problem. Sec-ond, the tree or subgraph produced do not guarantee structure co-hesiveness. Third, keyword cohesiveness is not ensured; there is no mechanism that enforces query keywords to be shared among the keyword sets of all query output’s vertices. Thus, graph keyword search solutions are not designed to find ACs.

Graph pattern matching (GPM).Given apatternP, the goal

of GPM is to extract a setRof subgraphs ofG, where for every

r∈R,ris highly similar toP. Tong et al. [8] studied the use of lines, loops and stars; Fan et al. [9, 10] proposed bounded simula-tion techniques for GPM queries; in [11], GPM has been studied for finding association rules from graphs. However, there is no de-tailed study about how to use GPM for community search. To do this, a user has to defineP, but this is not trivial: there are many

possible topologies forP, and numerous ways of placing

keyword-s on the verticekeyword-s inP. Moreover, current GPM solutions focus on

small patterns that generate small communities, and it is not clear whether they can support large and complex ones. Answering AC-Q with GPM can also be expensive, since it involves enumerating many patterns and finding an AC with the largest number of shared

Table 2: Symbols and meanings.

Symbol Meaning

G(V, E) An attributed graph with vertex setV and edge setE

W(v) The keyword set of vertexv

degG(v) The degree of vertexvinG

G[S0] The largest connected subgraph ofGs.t.q∈G[S

0],

and for anyv∈G[S0],S0⊆W(v)

Gk[S0] The largest connected subgraph of

Gs.t.q∈Gk[S0],

and for anyv∈Gk[S0],degGk[S0]v≥kandS

0W(v)

keywords. For the ACQ problem, there is no need to specifyP.

3.

THE ACQ PROBLEM

We now discuss the attributed graph model, thek-core, and the

AC. In the CS and CD literature, most existing works assume that the underlying graph is undirected [27, 19, 28, 24]. We also sup-pose that an attributed graphG(V, E)is undirected, with vertex set

V and edge setE. Each vertexv ∈V is associated with a set of

keywords,W(v). Letnandmbe the corresponding sizes ofV and

E. The degree of a vertexvofGis denoted bydegG(v). Table 2 lists the symbols used in the paper.

A community is often a subgraph ofGthat satisfiesstructure

co-hesiveness(i.e., the vertices contained in the community are linked

to each other in some way). A common notion of structure cohe-siveness is that theminimum degreeof all the vertices that appear in the community has to bekor more [27, 26, 2, 7, 5, 19]. This is used in thek-core and the AC. Let us discuss thek-core first.

DEFINITION1 (k-CORE[26, 2]). Given an integer k (k ≥

0), thek-core ofG, denoted byHk, is the largest subgraph ofG,

such that∀v∈Hk,degHk(v)≥k.

We say thatHkhas an order ofk. Notice thatHkmay not be

a connected graph [2], and its connected components, denoted by

k-coreds, are usually the “communities” returned byk-cored search algorithms. w: A x: A,B,C,D y: A,C,D z: D y: E z: E x: G y: F, G x: I y: H z: H 0 1 1 2 3 ABCD ABCDE ABCDEFG ABCDE FGHIJ HI A:{w, x, y} D:{x, y, z} B:{x} C:{x, y} F:{y} E:{y, z} G:{x, y} J:{x} I:{x} H:{y, z}

Core number Vertex IDs

0 J 1 F, G, H, I 2 E 3 A, B, C, D C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D K=3 K(K) J I L B(E) C A DE FG k=2 K(K) k=1 J I L B(H) C A D E FG H K(M) J I L M 3 A B C D E F G H N I J K L M N Inverted index: Union-find tree: 3: A, B, C, D, I, J, K, L 2: E, F, G 1: H, M 0: N 0 1 1 2 3 ABCD E FG J HI C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D k=3 K(K) J I L B(E) C A DE FG k=2 K(K) k=1 J I L B(H) C A DE FG H K(M) J I L M 3 A B C D E F G H N I J K L M N Inverted array: Anchored union-find forests:

3: A, B, C, D, I, J, K, L 2: E, F, G

1: H, M 0: N

Sets Vextex IDs

V0 N V1 H, M V2 E, F, G V3 A, B, C, D, I, J, K, L p1 p2 p3 p4 p5 p6 r1 r2 r3 A:{w, x, y} D:{x, y, z} B:{x} C:{x, y} F:{y} E:{y, z} G:{x, y} J:{x} I:{x} H:{y, z} 1 2 3 (a) graph w: A x: A,B,C,D y: A,C,D z: D y: E z: E x: G y: F, G x: I y: H z: H 0 1 1 2 3 ABCD ABCDE ABCDEFG ABCDE FGHIJ HI A:{w, x, y} D:{x, y, z} B:{x} C:{x, y} F:{y} E:{y, z} G:{x, y} J:{x} I:{x} H:{y, z}

Core number Vertices

0 J 1 F, G, H, I 2 E 3 A, B, C, D C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D K=3 K(K) J I L B(E) C A DE FG k=2 K(K) k=1 J I L B(H) C A DE FG H K(M) J I L M 3 A B C D E F G H N I J K L M N Inverted index: Union-find tree: 3: A, B, C, D, I, J, K, L 2: E, F, G 1: H, M 0: N 0 1 1 2 3 ABCD E FG J HI C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D k=3 K(K) J I L B(E) C A D E F G k=2 K(K) k=1 J I L B(H) C A D E F G H K(M) J I L M 3 A B C D E F G H N I J K L M N Vertex-node map: Anchored union-find forests:

3: A, B, C, D, I, J, K, L 2: E, F, G

1: H, M 0: N

Sets Vextex IDs

V0 N V1 H, M V2 E, F, G V3 A, B, C, D, I, J, K, L p1 p2 p3 p4 p5 p6 r1 r2 r3 A:{w, x, y} D:{x, y, z} B:{x} C:{x, y} F:{y} E:{y, z} G:{x, y} J:{x} I:{x} H:{y, z} 1 2 3 (b) core number Figure 3: Illustrating thek-core and the AC.

EXAMPLE 1. In Figure 3(a), {A, B, C, D} is both a 3-core

and a 3-cored. The 1-core has vertices{A, B, C, D, E, F, G, H, I},

and is composed of two1-coredcomponents:{A, B, C, D, E, F, G}

and{H, I}. The numberk in each circle represents thek-cored

contained in that ellipse.

Observe thatk-cores are “nested” [2]: given two positive in-tegersiandj, ifi < j, thenHj ⊆ Hi. In Figure 3(a),H3 is contained inH2, which is nested withinH1.

DEFINITION2 (CORE NUMBER). Given a vertexv ∈V, its

core number, denoted bycoreG[v], is the highest order of ak-core

that containsv.

(5)

A list of core numbers and their respective vertices for Example 1 are shown in Figure 3(b). In [2], anO(m)algorithm was proposed to compute the core number of every vertex.

We now formally define the ACQ problem as follows.

PROBLEM1 (ACQ). Given a graphG(V, E), a positive

in-tegerk, a vertexq∈V and a set of keywordsS⊆W(q), return a

setGof graphs, such that∀Gq∈ G, the following properties hold:

•Connectivity.Gq⊆Gis connected and containsq; •Structure cohesiveness.∀v∈Gq,degGq(v)≥k;

•Keyword cohesiveness. The size ofL(Gq, S)is maximal, where

L(Gq, S) =∩v∈Gq(W(v)∩S)is the set of keywords shared inS

by all vertices ofGq.

We callGqtheattributed community(or AC) ofq, andL(Gq, S)

theAC-labelofGq. In Problem 1, the first two properties are also

specified by thek-cored of a given vertexq[27]. Thekeyword

co-hesiveness(Property 3), which is unique to Problem 1, enables the

retrieval of communities whose vertices have common

keyword-s inS. We useS to impose semantics on the AC produced by

Problem 1. By default,S=W(q), which means that the AC

gen-erated should have keywords common to those associated withq.

IfS ⊂W(q), it means that the ACQ user is interested in forming communities that are related to some (but not all) of the keywords ofq. A user interface could be developed to displayW(q)to the user, allowing her to include the desired keywords intoS. For ex-ample, in Figure 3(a), ifq=A,k=2 andS={w, x, y}, the output of Problem 1 is{A, C, D}, with AC-label{x, y}, meaning that these vertices share the keywordsxandy.

We requireL(Gq, S)to be maximal in Property 3, because we wish the AC(s) returned only contain(s) the most related vertices, in terms of the number of common keywords. Let us use Fig-ure 3(a) to explain why this is important. Using the same query (q=A,k=2,S={w, x, y}), without the “maximal” requirement, we can obtain communities such as{A, B, E}(which do not share any

keywords),{A, B, D}, or{A, B, C} (which share 1 keyword).

Note that there does not exist an AC with AC-label being

exact-ly{w,x, y}. Our experiments (Section 7) show that imposing the

“maximal” constraint yields the best result. Thus, we adopt Prop-erty 3 in Problem 1. If there is no AC whose vertices share one or more keywords (i.e.,|L(Gq, S)|=0), we return the subgraph ofG that satisfies Properties 1 and 2 only. 2

There are other candidates for structure cohesiveness (e.g.,k -truss,k-clique) andkeyword cohesiveness(e.g., Jaccard similarity and string edit distance). In our report [29], we studied a variant of keyword cohesiveness, in which an ACQ user may specify that an AC returned must contain vertices having specific keywords. We also examined its approximate version, where given a threshold

θ∈[0,1], each vertex in an AC has at least|S| ×θkeywords inS. These variants can be easily supported by our solutions to ACQ. An interesting future work is to compare the use of different structure and keyword cohesiveness definitions in an ACQ.

4.

BASIC SOLUTIONS

For ease of presentation, we say thatvcontains a setS0of key-words, ifS0⊆W(v). We useG[S0]to denote the largest connect-ed subgraph ofG, where each vertex containsS0 andq ∈ G[S]. We useGk[S0]to denote the largest connected subgraph ofG[S0], in which every vertex has degree being at leastkinGk[S0]. We callS0a qualified keyword set for the query vertexqon the graph

G, ifGk[S0]exists.

2In practice, the query user can be alerted by the system when there

is no sharing among the vertices.

Given a query vertexq, a straightforward method to answer ACQ

performs three steps. First, all non-empty subsets ofS,S1, S2,· · ·,

S2l−1(l=|S|), are enumerated. Then, for each subsetSi(1≤i≤

2l

-1), we verify the existence of Gk[Si]and compute it when it exists (We postpone to discuss the details). Finally, we output the subgraphs having the most shared keywords among allGk[Si].

One major drawback of the straightforward method is that we

need to compute2l1subgraphs (

i.e.,Gk[Si]). For large values ofl, the computation overhead renders the method impractical, and we do not further consider this method in the paper. To alleviate this issue, we propose the following two-step framework.

4.1

Two-Step Framework

The two-step framework is mainly based on the following

anti-monotonicityproperty.

LEMMA1 (ANTI-MONOTONICITY). Given a graphG, a

ver-texq∈Gand a setSof keywords, if there exists a subgraphGk[S],

then there exists a subgraphGk[S0]for any subsetS0⊆S.

All the proofs of lemmas studied in this paper can be found in the full version [29]. The anti-monotonicity property allows us to stop examining all the super sets ofS0(S0⊆S), once have verified that

Gk[S0]does not exist. The basic solution begins with examining the set,Ψ1, of size-1candidate keyword sets,i.e., each candidate

contains a single keyword of S. It then repeatedly executes the

following two key steps, to retrieve the size-2(size-3, . . . ) qualified keyword subsets until no qualified keyword sets are found. •Verification. For each candidateS0inΨc(initiallyc=1), mark

S0as a qualified set ifGk[S0]exists.

•Candidate generation.For any two current size-cqualified key-word sets which only differ in one keykey-word, union them as a new expanded candidate with size-(c+1), and put it into setΨc+1, if all

its subsets are qualified, by Lemma 1.

Among the above steps, the key issue is how to computeGk[S0]. SinceGk[S0]should satisfy thestructure cohesiveness(i.e., mini-mum degree at leastk) andkeyword cohesiveness(i.e., every ver-tex contains keyword setS0). Intuitively, we have two approaches to computeGk[S0]: either searching the subgraph satisfying de-gree constraint first, followed by further refining with keyword con-straints (calledbasic-g); or vise versa (calledbasic-w). These two algorithms form our baseline solutions. Their pseudocodes are presented in the appendix of the full version [29].

5.

CL-TREE INDEX

The major limitation ofbasic-g andbasic-w is that they

need to find thek-coreds and do keyword filtering repeatedly. This makes the community search very inefficient. To achieve higher

query efficiency, we propose a novel index, calledCL-tree(Core

Label tree), which organizes both thek-coreds and keywords into a tree structure. Based on the index, the efficiency of answering ACQ and its variants can be improved significantly. We first introduce the index in Section 5.1, and then propose two index construction methods in Section 5.2.

5.1

Index Overview

The CL-tree index is built based on the key observation that cores are nested. Specifically, a(k+1)-cored must be contained in ak

-d

core. The rationale behind is, a subgraph has a minimum degree at leastk+1implies that it has a minimum degree at leastk. Thus, all

k-coreds can be organized into a tree structure3. We illustrate this in

Example 2.

3

We use “node” to mean “CL-tree node” in this paper.

(6)

w: A x: A,B,C,D y: A,C,D z: D y: E z: E x: G y: F, G x: I y: H z: H 0 1 1 2 3 ABCD ABCDE ABCDEFG ABCDE FGHIJ HI A:{w, x, y} D:{x, y, z} B:{x} C:{x, y} F:{y} E:{y, z} G:{x, y} J:{x} I:{x}

H:{y, z} Core number Vertex IDs

0 J 1 F, G, H, I 2 E 3 A, B, C, D C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D K=3 K(K) J I L B(E) C A DE FG k=2 K(K) k=1 J I L B(H) C A DE FG H K(M) J I L M 3 A B C D E F G H N I J K L M N Inverted index: Union-find tree: 3: A, B, C, D, I, J, K, L 2: E, F, G 1: H, M 0: N 0 1 1 2 3 ABCD E FG J HI C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D k=3 K(K) J I L B(E) C A DE FG k=2 K(K) k=1 J I L B(H) C A DE FG H K(M) J I L M 3 A B C D E F G H N I J K L M N Inverted array: Anchored union-find forests:

3: A, B, C, D, I, J, K, L 2: E, F, G

1: H, M 0: N

Sets Vextex IDs

V0 N V1 H, M V2 E, F, G V3 A, B, C, D, I, J, K, L p1 p2 p3 p4 p5 p6 r1 r2 r3

(a) tree structure

w: A x: A,B,C,D y: A,C,D z: D y: E z: E x: G y: F, G x: I y: H z: H 0 1 1 2 3 ABCD ABCDE ABCDEFG ABCDE FGHIJ HI A:{w, x, y} D:{x, y, z} B:{x} C:{x, y} F:{y} E:{y, z} G:{x, y} J:{x} I:{x} H:{y, z}

Core number Vertices

0 J 1 F, G, H, I 2 E 3 A, B, C, D C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D K=3 K(K) J I L B(E) C A DE FG k=2 K(K) k=1 J I L B(H) C A DE FG H K(M) J I L M 3 A B C D E F G H N I J K L M N Inverted index: Union-find tree: 3: A, B, C, D, I, J, K, L 2: E, F, G 1: H, M 0: N 0 1 1 2 3 ABCD E FG J HI C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D k=3 K(K) J I L B(E) C A DE FG k=2 k=1 K(K) J I L B(H) C A DE F G H K(M) J I L M 3 A B C D E F G H N I J K L M N Vertex-node map: Anchored union-find forests:

3: A, B, C, D, I, J, K, L 2: E, F, G

1: H, M 0: N

Sets Vextex IDs

V0 N V1 H, M V2 E, F, G V3 A, B, C, D, I, J, K, L p1 p2 p3 p4 p5 p6 r1 r2 r3 A:{w, x, y} D:{x, y, z} B:{x} C:{x, y} F:{y} E:{y, z} G:{x, y} J:{x} I:{x} H:{y, z} 1 2 3 x: J (b) CL-tree index Figure 4: An example CL-tree index.

EXAMPLE 2. Consider the graph in Figure 3(a). All thek

-d

cores can be organized into a tree as shown in Figure 4(a). The

height of the tree is 4. For each tree node, we attach the core

num-ber and vertex set of its correspondingk-cored.

From the tree structure in Figure 4(a), we conclude that, if a (k+1)-cored (denoted asCk+1) is contained in ak-cored (denoted as

Ck), then there is a tree node corresponding toCk+1and its parent

node corresponds toCk. Besides, the height of the tree is at most

kmax+ 1, wherekmaxis the maximum core number.

The tree structure in Figure 4(a) can be stored compactly, as shown in Figure 4(b). The key observation is that, for any internal nodepin the tree, the vertex sets of its child nodes are the subsets ofp’s vertex set, because of the inclusion relationship. To save s-pace cost, we can remove the redundant vertices that are shared by

p’s child nodes fromp’s vertex set. After such removal, we obtain a compressed tree, where each graph vertex appears only once. This structure constitutes the CL-tree index, the nodes of which are fur-ther augmented by inverted lists (Figure 4(b)). For each keyworde

that appears in a CL-tree node, a list of IDs of vertices whose key-word sets containeis stored. For example, in noder3, the inverted list of keywordycontains{A, C, D}. As discussed later, given a keyword setT, these inverted lists allow efficient retrieval of

ver-tices whose keyword sets containT. To summarize, each CL-tree

node contains four elements:

•coreNum: the core number of thek-cored;

•vertexSet: a set of graph vertices;

•invertedList: a list of< key, value >pairs, where thekeyis a

keyword contained by vertices invertexSetand thevalueis the

list of vertices invertexSetcontainingkey;

•childList: a list of child nodes.

Figure 4(b) depicts the CL-tree index for the example graph in Figure 3(a), the elements of each tree node are labeled explicitly. Using the CL-tree, the following two key operations used by our query algorithms (Section 6), can be performed efficiently. •Core-locating. Given a vertexqand a core numberc, find the

k-cored with core numberccontainingq, by traversing the CL-tree.

•Keyword-checking.Given ak-cored, find vertices which contain

a given keyword set, by intersecting the inverted lists of keywords contained in the keyword set.

Remarks.The CL-tree can also supportk-cored queries on gen-eral graphs without keywords. For example, it can be applied to findingk-cored in previous community search methods [27].

Space cost.Since each graph vertex appears only once and each keyword only needs constant space cost, the space cost of keeping such an index isO(bl·n), wherebldenotes the average size ofW(v)

overV. Thus, the space cost is linear to the size ofG.

5.2

Index Construction

To build the CL-tree index, we propose two methods,basic

andadvanced, as presented in Section 5.2.1 and 5.2.2.

5.2.1

The Basic Method

Ask-coreds of a graph are nested naturally, it is straightforward to build the CL-tree recursively in a top-down manner. Specifically, we first generate the root node for0-core, which is exactly the entire graph. Then, for eachk-cored of1-core, we generate a child node for the root node. After that, we only remain vertices with core

numbers being0in the root node. Then for each child node, we

can generate its child nodes in the similar way. This procedure is executed recursively until all the nodes are well built.

Algorithm 1Index construction:basic

1: functionBUILDINDEX(G(V, E))

2: coreG[ ]←k-core decomposition onG;

3: k←0,root←(k, V);

4: BUILDNODE(root,0);

5: build an inverted list for each tree node;

6: returnroot;

7: functionBUILDNODE(root,k)

8: k←k+ 1;

9: ifk≤kmaxthen

10: obtainUkfromroot;

11: compute the connected components for the induced

graph onUk;

12: foreach connected componentCido

13: build a tree nodepi←(k, Ci.vertexSet);

14: addpiintoroot.childList;

15: removeCi’s vertex set fromroot.vertexSet;

16: BUILDNODE(pi,k);

Algorithm 1 illustrates the pseudocodes. We first dok-core de-composition using the linear algorithm [2], and obtain an array

coreG[ ](line 2), wherecoreG[i]denotes the core number of

ver-texiinG. We denote the maximal core number bykmax. Then,

we initialize the root node by the core number k=0 andV (line

3). Next, we call the functionBUILDNODEto build its child nodes (line 4). Finally, we build an inverted list for each tree node and obtain a well built CL-tree (lines 5-6).

InBUILDNODE, we first updatekand obtain the vertex setUk fromroot.vertexSet, which is a set of vertices with core numbers

being at leastk. Then we find all the connected components from

the subgraph induced byUk (lines 8-11). Since each connected

componentCicorresponds to a k-cored, we build a tree nodepi

with core numberkand the vertex set ofCi, and then link it as a

child ofroot(lines 12-14). We also updateroot’s vertex set by

removing vertices (line 15), which are shared byCi. Finally, we call theBUILDNODEfunction to buildpi’s child nodes recursively until all the tree nodes are created (line 16).

Complexity analysis. Thek-core decomposition can be done in O(m). The inverted lists of each node can be built inO(bl·

n). In functionBUILDNODE, we need to compute the connected

components with a given vertex set, which costsO(m)in the worst case. Since the recursive depth iskmax, the total time cost isO(m·

kmax+bl·n). Similarly, the space complexity isO(m+bl·n).

5.2.2

The Advanced Method

While thebasicmethod is easy to implement, it meets

effi-ciency issues when both the given graph size and itskmaxvalue

are large. For instance, when given a clique graph withnvertices (i.e., edges exist between every pair of nodes), the value ofkmaxis

n–1. Therefore, the time complexity of thebasicmethod could

beO((m+bl)·n), which may lead to low efficiency for large-scale

(7)

graphs. To enable more efficient index construction, we propose theadvancedmethod, whose time and space complexities are almost linear with the size of the input graph.

Theadvancedmethod builds the CL-tree level by level in a bottom-up manner. Specifically, the tree nodes corresponding to larger core numbers are created prior to those with smaller core numbers. For ease of presentation, we divide the discussion into two main steps: creating tree nodes and creating tree edges.

1. Creating tree nodes. We observe that, if we acquire the

vertices with core numbers at leastcand denote the induced

sub-graph on the vertices asTc, then the connected components ofTc have one-to-one correspondence to thec-coreds. A simple

algorith-m would be, searching connected coalgorith-mponents forTc(0 ≤ c ≤

kmax)independently, followed by creating one node for each

dis-tinct component. This algorithm apparently costsO(kmax ·m)

time, as computing connected components takes linear time. However, we can do better if we can incrementally update the connected components in a level by level manner (i.e., maintain the

connected components ofTc+1from those ofTc). We note that,

such a node creation process is feasible by exploiting the

classi-calunion-find forest[1]. Generally speaking, the union-find forest

enables efficient maintenance of connected components of a graph when edges are incrementally added. Using union-find forest to maintain connected components follows a process of edge exam-ination. Initially, each vertex is regarded as a connected compo-nent. Then, edges are examined one by one. During the examine process, two components are merged together when encounters an edge connecting them. To achieve an efficient merge of compo-nents, the vertices in the component form a tree. The tree root acts as the representative vertex of the component. As such, merging two components is essentially linking two root vertices together. To guarantee the CL-tree nodes are formed in a bottom-up manner, we assign an examine priority to each edge. The priority is defined by the larger value of the two core numbers corresponding to the two end vertices of an edge. The edges associated to vertices with larger core numbers are examined first.

2. Creating tree edges. Tree edges are also inserted during the graph edge examination process. In particular, when we examine a vertexvwith a set,B, of its neighbors, whose core numbers are larger thancoreG[v], we require that the tree node containingv should link to the tree node containing the vertex, whose core num-ber is the smallest among all the vertices inB. Nevertheless, the classical union-find forest is not able to maintain such information. To address this issue, we thus propose an auxiliary data structure,

calledAnchored Union-Find(details of AUF are in [29]), based

on the classical union-find forest. We first defineanchor vertex. DEFINITION3 (ANCHOR VERTEX). Given a connected

sub-graphG0 ⊆ G, the anchor vertex is the vertex with core number

beingmin{coreG[v]|v∈G0}.

The AUF is an extension of union-find forest, in which each tree has an anchor vertex, and it is attached to the root node. In CL-tree, for any nodepwith correspondingk-cored Ck, its child nodes

correspond to thek-coreds, which are contained byCkand have core

numbers being the most close to the core number of nodep. This

implies that, when building the CL-tree in a bottom-up manner, we can maintain the anchor vertices for thek-coreds dynamically, and

they can be used to link nodes with their child nodes. In addition, we maintain a vertex-node map, where the key is a vertex and the value is the tree node contains this vertex, for locating tree nodes. The pseudocodes and analysis are reported in the full version [29].

Complexity analysis. With our proposed AUF, we can reduce

the complexity of CL-tree construction to O(m·α(n)), where

w: A x: A,B,C,D y: A,C,D z: D y: E z: E x: G y: F, G x: I y: H z: H 0 1 1 2 3 ABCD ABCDE ABCDEFG ABCDE FGHIJ HI A:{w, x, y} D:{x, y, z} B:{x} C:{x, y} F:{y} E:{y, z} G:{x, y} J:{x} I:{x} H:{y, z}

Core number Vertices

0 J 1 F, G, H, I 2 E 3 A, B, C, D C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D K=3 K(K) J I L B(E) C A DE FG k=2 K(K) k=1 J I L B(H) C A DE FG H K(M) J I L M 3 A B C D E F G H N I J K L M N Inverted index: Union-find tree: 3: A, B, C, D, I, J, K, L 2: E, F, G 1: H, M 0: N 0 1 1 2 3 ABCD E FG J HI C D A F E G B H N H M EFG ABCD 0 1 1 2 3 IJKL J K L I M B(B) C A D k=3 K(K) J I L B(E) C A DE FG k=2 k=1 K(K) J I L B(H) C A DE F G H K(M) J I L M 3 A B C D E F G H N I J K L M N Vertex-node map: Anchored union-find forests:

3: A, B, C, D, I, J, K, L 2: E, F, G 1: H, M 0: N

Sets Vextex IDs

V0 N V1 H, M V2 E, F, G V3 A, B, C, D, I, J, K, L p1 p2 p3 p4 p5 p6 r1 r2 r3 A:{w, x, y} D:{x, y, z} B:{x} C:{x, y} F:{y} E:{y, z} G:{x, y} J:{x} I:{x} H:{y, z} 1 2 3

Figure 5: An index built byadvancedmethod.

α(n), the inverse Ackermann function, is less than 5 for all re-motely practical values ofn[1].

EXAMPLE 3. Figure 5 depicts an example graph with 14

ver-ticesA,· · ·, N.Videnotes the set of vertices whose core

number-s arei. Whenk=3, we first generate two leaf nodesp1 andp2,

then update the AUF, where roots’ anchor vertices are in the round

brackets. Whenk=2, we first generate nodep3, then link it top1,

and then update the AUF forest. Whenk=1, we first generate nodes

p4andp5. Specifically, to find the child nodes ofp4, we first find

its neighborA, then findA’s parentB using current AUF forest.

Since the anchor vertex ofBisEandEpoints top3in the inverted

array, we addp3 intop4’s child List. Whenk=0, we generatep6

and finish the index construction.

Index maintenance.We now briefly discuss anincremental ver-sion of the CL-tree construction algorithm, which can handle the changes of keywords and graph edges, without rebuilding the CL-tree from scratch. To insert (or remove) a keyword of a vertex, we

just need to update theinvertedListof the CL-tree node

contain-ing the vertex. To insert (or remove) a graph edge, we borrow the

results from [20], which discusses how to maintain a k-core. A

more detailed discussion can be found in our report [29]. We plan to investigate this issue more extensively in the future.

6.

QUERY ALGORITHMS

In this section, we present three query algorithms based on the CL-tree index. Based on how we verify the candidate keyword sets, we divide our algorithms into incremental algorithms (from exam-ining smaller candidate sets to larger ones) and decremental algo-rithm (from examining larger candidate sets to smaller ones). We

propose two incremental algorithms called Inc-S (Incremental

Space efficient) andInc-T(Incremental Time efficient), to trade

off between the memory consumption and the computational

over-head. We also design a decremental algorithm calledDec(Decremental).

Our interesting finding is that, whileDecseems not intuitive, it

ranks as the most efficient one. Inc-SandInc-Tare presented

in Section 6.1.Decis introduced in Section 6.2.

6.1

The Incremental Algorithms

While the high-level idea of incremental algorithms resembles

the basic solutions (see Section 4), Inc-Sand Inc-Tadvance

them with the exploitation of the CL-tree. Specifically, they can al-ways verify the existence ofGk[S0]within a subgraph ofGinstead

of the entire graphG. More interestingly, the subgraph for such

verifications shrinks when the candidate setS0expands. Therefore, a large sum of redundant computation is cut off during the

verifica-tion. We presentInc-SandInc-Tin Sections 6.1.1 and 6.1.2.

(8)

6.1.1

Inc-S Algorithm

We first introduce a new concept, calledsubgraph core

num-ber, which is geared to the main idea ofInc-S.

DEFINITION4 (SUBGRAPH CORE NUMBER). Given a subgraph

G0ofG, its core number,coreG[G0], is defined asmin{coreG[v]|

v∈G0}.

Inc-Sfollows the two-step framework (verificationand

can-didate generation) introduced in Section 4. With the CL-tree, we

improve the verification step as follows.

• Core-based verification. For each newly generated size-(c+1) candidate keyword setS0expanded from size-csetsS1

andS2, markS0as a qualified set ifGk[S0]existsin a

sub-graph of core numbermax{coreG[Gk[S1]],coreG[Gk[S2]]}.

The core-based verification guarantees that, with the expansion of the candidate keyword sets, the verification becomes faster as it only needs to examine the existence ofGk[S0]in a smallerk

-d

core(Recall that cores with large core numbers are nested in the

cores with small core numbers). The correctness of such shrunk verification range is guaranteed by the following lemma.

LEMMA 2. Given two subgraphsGk[S1]andGk[S2]of a graph

G, for a new keyword setS0generated fromS1andS2(i.e.,S0 =

S1∪S2), ifGk[S0]exists, then it must appear in ak-cored with core

number at least

max{coreG[Gk[S1]], coreG[Gk[S2]]}. (1) The verification process can be further accelerated by checking the numbers of vertices and edges, as indicated by Lemma 3.

LEMMA 3. Given a connected graphG(V, E)withn=|V|and

m=|E|, ifm−n < k22−k−1, there is nok-cored inG.

This lemma implies that, for a connected subgraphG0, whose

edge and vertex numbers aremandn, ifm−n <k2−k

2 −1, then

we cannot findGk[S0]fromG0.

We presentInc-Sin Algorithm 2. The input is a CL-tree rooted

atroot, a query vertexq, a positive integerkand a keyword setS.

We applycore-locatingon the CL-tree to locate the internal

nodes whose correspondingk-coreds containq(line 2). Note that their core numbers are in the range of[k, coreG[q]], as required by the structure cohesiveness. Then, we setl=0, indicating the sizes of current keyword sets, and initialize a setΨof< S0, c >pairs, whereS0is a set containing a keyword fromSandcis the initial

core numberk(line 3). Note that we skip those keywords, which

are inS, but not inW(q). In the while loop (lines 4-18), for each

< S0, c >pair, we first performkeyword-checkingto find

G[S0]using the keyword inverted lists of the subtree rooted at node

rc. If we cannot ensure thatG[S0]does not contain ak-cored by

Lemma 3, we then findGk[S0]fromG[S0](lines 8-9). IfGk[S0] exists, we putS0with its core number into the setΦl(lines 10-11).

Next, ifΦlis nonempty, we generate new candidates by calling

GENECAND(Φl), which is detailed in the full version [29]. For

each candidateS0inΨ, we compute the core number using

Lem-ma 2 and update it as a pair inΨ(lines 12-17); otherwise, we stop (line 18). Finally, we output the communities of the latest verified keyword sets (line 19).

EXAMPLE 4. Consider the graph in Figure 3(a) and its index

in Figure 4(b). Letq=A,k=1 andS={w, x, y}. By Algorithm 2,

we first find 3 root nodesr1,r2andr3. In the first while loop, we

find 2 qualified keyword sets{x}and{y}with core numbers being

3 and 1. By Lemma 2, we only need to verify the new candidate

keyword set{x, y}under noder3.

Algorithm 2Query algorithm:Inc-S

1: functionQUERY(G,root,q,k,S)

2: find subtree root nodesrk, rk+1,· · ·, rcoreG[q];

3: initializel=0,ΨusingS;

4: whiletruedo

5: l←l+ 1;Φl← ∅;

6: foreach< S0, c >∈Ψdo

7: findG[S0]under the rootrc;

8: ifG[S0]is not pruned by Lemma 3then

9: findGk[S0]fromG[S0]; 10: ifGk[S0]existsthen 11: Φl.add(< S0, coreG[Gk[S0]]>); 12: ifΦl6=∅then 13: Ψ←GENECAND(Φl); 14: foreachS0inΨdo

15: ifS0is generated fromS1andS2then

16: c←max{coreG[Gk[S1]], coreG[Gk[S2]]};

17: Ψ.update(S0,< S0, c >);

18: elsebreak;

19: output the communities of keyword sets inΦl−1;

6.1.2

Inc-T Algorithm

We begin with a lemma which inspires the design ofInc-T.

LEMMA 4. Given two keyword setsS1andS2, ifGk[S1]and

Gk[S2]exist, we have

Gk[S1∪S2]⊆Gk[S1]∩Gk[S2]. (2)

This lemma implies, ifS0is generated fromS1andS2, we can

findGk[S0]fromGk[S1]∩Gk[S2]directly. Since every vertex inGk[S1]∩Gk[S2]contains bothS1 andS2, we do not need to consider the keyword constraint again when findingGk[S0].

Based on Lemma 4, we introduce a new algorithmInc-T.

Dif-ferent fromInc-S,Inc-TmaintainsGk[S0]rather thancoreG[

Gk[S0]]for each qualified keyword setS0. As we will demonstrate

later, Inc-Tis more effective for shrinking the subgraphs

con-taining the ACs, and thus more efficient. As a trade-off for better

efficiency,Inc-Tconsumes more memory as it needs to store a

list of subgraphGk[S0]in memory.

Algorithm 3 presentsInc-T. We first applycore-locating

to find thek-cored containingqfrom the CL-tree (line 2). Then, we setl=0, indicating the sizes of current keyword sets, and initialize a setΨof< S0,G >b pairs, whereS

0

is a set containing a keyword fromSandGbis thek

-d

core. The while loop (lines 4-18) is simi-lar with that ofInc-S. The main differences are that: (1) for each qualified keyword setS0,Inc-Tkeeps Gk[S0]in memory (line

11); and (2) for each candidate keyword setS0generated fromS1

andS2,Inc-TfindsGk[S0]fromGk[S1]∩Gk[S2]directly with-out further keyword verification (lines 6-9, 16).

EXAMPLE 5. Continue the graph and query (q=A,k=1,S={w,

x, y}) in Example 4. ByInc-T, we first findG1[{x}]andG1[{y}],

whose vertex sets are{A, B, C, D}and{A, C, D,E, F, G}. Then

to findG1[{x, y}], we only need to search it from the subgraph,

in-duced by the vertex set{A, C, D}.

6.2

The Decremental Algorithm

The decremental algorithm, denoted byDec, differs from

previ-ous query algorithms not only on the generation of candidate key-word sets, but also on the verification of candidate keykey-word sets.

1. Generation of candidate keyword sets. Decexploits the

key observation that, if S0 (S0 ⊆ S) is a qualified keyword set, then there are at leastkofq’s neighbors containing setS0. This

(9)

Algorithm 3Query algorithm:Inc-T

1: functionQUERY(G,root,q,k,S) 2: find thek-cored, which containsq;

3: initializel=0,ΨusingS;

4: whiletruedo

5: l←l+ 1;Φl← ∅;

6: foreach< S0,G >b ∈Ψdo

7: findG[S0]fromGb;

8: ifG[S0]is not pruned by Lemma 3then

9: findGk[S0]fromG[S0]; 10: ifGk[S0]existsthen 11: Φl.add(< S0, Gk[S0]>); 12: ifΦl6=∅then 13: Ψ←GENECAND(Φl); 14: foreachS0∈Ψdo

15: ifS0is generated fromS1andS2then

16: Gb←Gk[S1]∩Gk[S2];

17: Ψl.update(S0,< S0,G >b );

18: elsebreak;

19: output the communities of keyword sets inΦl−1;

is because every vertex inGk[S0]must has degree at leastk. This observation implies, we can generate all the candidate keyword set-s directly by uset-sing the query vertexqandq’s neighbors, without touching other vertices.

Specifically, we considerqandq’s neighbor vertices. For each

vertexv, we only select the keywords, which are contained byS

and at leastkof its neighbors. Then we use these selected

key-words to form an itemset, in which each item is a keyword. After this step, we obtain a list of itemsets. Then we apply the well s-tudied frequent pattern mining algorithms (e.g., Apriori [13] and FP-Growth [14]) to find the frequent keyword combinations, each of which is a candidate keyword set. Since our goal is to

gener-ate keyword combinations shared by at leastkneighbors, we set

the minimum support ask. In this paper, we use the well-known

FP-Growth algorithm [14]. 0 3 1 2 4 0 3 1 2 4 Q Q:{v,x,y,z} A:{v,x,y,z} B:{v,x} D:{x,y,z} E:{w,x,y,z} k=3 C:{v,y}

Set Keyword sets Ψ1 {v},{x},{y},{z} Ψ2 {x,y},{x,z},{y,z} Ψ3 {x,y,z} F:{v, w} r1 r2 r3 r4(q) Ψ1

(a) a query vertex

0 3 1 2 4 0 3 1 2 4 Q Q:{v,w,x,y,z} A:{v,x,y,z} B:{v,x} D:{x,y,z} E:{w,x,y,z} k=3 C:{v,y}

Set Keyword sets Ψ1 {v},{x},{y},{z} Ψ2 {x,y},{x,z},{y,z} Ψ3 {x,y,z} F:{v, w} r1 r2 r3 r4(q) Ψ1 (b) candidates Figure 6: An example of candidate generation.

EXAMPLE 6. Consider a query vertexQ(k=3,S={v, x, y, z}) with 6 neighbors in Figure 6(a), where the selected keywords of each vertex are listed in the curly braces. By FP-Growth, 8

can-didate keyword sets) are generated, as shown in Figure 6(b). Ψi

denotes the set of keyword sets with sizes beingi.

2. Verification of candidate keyword sets. As candidates can be obtained usingSandq’s neighbors directly, we can verify them either incrementally as that inInc-S, or in a decremental manner (larger candidate keyword sets first and smaller candidate keyword sets later). In this paper, we choose the latter manner. The rationale

behind is that, for any two keyword setsS1 ⊆ S2, the number

of vertices containingS2is usually smaller than that ofS1, which impliesS2can be verified more efficiently thanS1.

Based on the above discussions, we designDecas shown in

Al-gorithm 4. We first generate candidate keyword sets usingS and

Algorithm 4Query algorithm:Dec

1: functionQUERY(G,root,q,k,S)

2: generateΨ1,Ψ2,· · ·,ΨhusingSandq’s neighbors;

3: find the subtree root noderk;

4: createR1, R2,· · ·, Rh0by using subtree rooted atrk;

5: l←h;Q← ∅;

6: Rb←Rh∪ · · · ∪Rh0;

7: whilel≥1do

8: foreachS0∈Ψldo

9: findG[S0]from the subgraph induced onRb;

10: findGk[S0]fromG[S0];

11: ifGk[S0]existsthenQ.add(Gk[S0]);

12: ifQ=∅then

13: l←l−1;

14: Rb←Rb∪Rl;

15: elsebreak;

16: output communities inQ;

q’s neighbors by FP-Growth algorithm (line 2). Then, we apply

core-locatingto find the root (with core numberk) of the sub-tree from CL-sub-tree, whose correspondingk-cored containsq(line 3). Next, we traverse the subtree rooted atrkand find vertices which share keywords withq(line 4).Ridenote the sets of vertices shar-ingikeywords withq. Then, we initializelash(line 5), as we verify keyword sets with the largest sizehfirst. We maintain a set

b

Rdynamically, which contains vertices sharing at leastlkeywords

withq(line 6). In the while loop, we examine candidate keyword

sets in the decremental manner. For each candidateS0 ∈Ψl, we

first try to findG[S0], then findGk[S0], and putGk[S0]intoQif it exists (lines 8-11). Finally, if we have found at least one qualified community, we stop at the end of this loop and outputQ; otherwise, we examine smaller candidate keyword sets in next loop.

7.

EXPERIMENTS

We now present the experimental results. Section 7.1 discusses the setup. We discuss the results in Sections 7.2 and 7.3.

7.1

Setup

We consider four real datasets. ForFlickr4, a vertex represents a user, and an edge denotes a “follow” relationship between two users. For each vertex, we use the 30 most frequent tags of its

as-sociated photos as its keywords. ForDBLP5, a vertex denotes an

author, and an edge is a co-authorship relationship between two au-thors. For each author, we use the 20 most frequent keywords from the titles of her publications as her keywords. In theTencentgraph provided by the KDD contest 20126, a vertex is a person, an orga-nization, or a microblog group. Each edge denotes the friendship between two users. The keyword set of each vertex is extracted from a user’s profile. For theDBpedia7, each vertex is an entity, and each edge is the relationship between two entities. The key-words of each entity are extracted by the Stanford Analyzer and Lemmatizer. Table 3 shows the number of vertices and edges, the

kmaxvalue, a vertex’s average degreedb, and its keyword set sizebl.

To evaluate ACQs, we set the default value ofkto 6. The input

keyword setSis set to the whole set of keywords contained by the query vertex. For each dataset, we randomly select 300 query ver-tices with core numbers of 6 or more, which ensures that there is a

4 https://www.flickr.com/ 5 http://dblp.uni-trier.de/xml/ 6http://www.kddcup2012.org/c/ kddcup2012-track1 7 http://dbpedia.org/datasets 8

(10)

Table 3: Datasets used in our experiments.

Dataset Vertices Edges kmax db bl

Flickr 581,099 9,944,548 152 17.11 9.90

DBLP 977,288 3,432,273 118 7.02 11.8

Tencent 2,320,895 50,133,369 405 43.2 6.96

DBpedia 8,099,955 71,527,515 95 17.66 15.03

k-core containing each query vertex. Each data point is the average result for these 300 queries. We implement all the algorithms in Java, and run experiments on a machine having a quad-core Intel i7-3770 processor, and 32GB of memory, with Ubuntu installed.

7.2

Results on Effectiveness

We now study the effectiveness of ACQ, and compare it with existing CD and CS methods. We then discuss a case study.

7.2.1

ACQ Effectiveness

We first define two measures, namely CMF and CPJ, for evaluat-ing the keyword cohesiveness of the communities. LetC(q)={C1, C2,

· · ·,CL}be the set ofLcommunities returned by an algorithm for

a query vertexq∈V (Note thatS=W(q)).

•Community member frequency (CMF): this is inspired by

the classical document frequency measure. Consider a keywordx

ofq’s keyword setW(q). Ifxappears in most of the vertices (or members) of a communityCi, then we regardCito be highly

cohe-sive. The CMF uses the occurrence frequencies ofq’s keywords in

Cito determine the degree of cohesiveness. Letfi,hbe the number of vertices ofCiwhose keyword sets contain theh-th keyword of

W(q). Then, fi,h

|Ci| is the relative occurrence frequency of this key-word inCi. The CMF is the average of this value over all keywords inW(q), and all communities inC(q):

CM F(C(q)) = 1 L · |W(q)| L X i=1 |W(q)| X h=1 fi,h |Ci| (3) Notice thatCM F(C(q))ranges from 0 to 1. The higher its value, the more cohesive is a community.

•Community pair-wise Jaccard (CPJ): this is based on the similarity between the keyword sets of any pair of vertices of

com-munityCi. We adopt the Jaccard similarity, which is commonly

used in the IR literature. LetCi,jbe thej-th vertex ofCi. The CPJ is then the average similarity over all pairs of vertices ofCi, and all communities ofC(q): CP J(C(q)) = 1 L L X i=1   1 |Ci|2 |Ci| X j=1 |Ci| X k=1 W(Ci,j)∩W(Ci,k) W(Ci,j)∪W(Ci,k)   (4)

TheCP J(C(q))value has a range of 0 and 1. A higher value of

CP J(C(q))implies better cohesiveness.

1. Effect of common keywords. We examine the impact of

the AC-label length (i.e., the number of keywords shared by all the vertices of the AC) on keyword cohesiveness. We collect ACs containing one to five keywords, and then group the ACs according to their AC-label lengths. The average CMF and CPJ value of each group is shown in Figure 7. For all the datasets, when the AC-label lengths increase, both CMJ and CPJ value rises. This justifies the use of the maximal AC-label length as the criterion of returning an AC in our ACQ Problem.

2. Comparison with existing CD methodsAs mentioned

a-head, the existing CD methods for attributed graph can be

adapt-ed for community search. We choose to adaptCODICIL[24] for

comparison. The main reasons are: (1) it has been tested on the

1 2 3 4 5 0 0.2 0.4 0.6 0.8 1

the nubmer of shared keywords

CMF Flickr DBLP Tencent DBpedia (a) CMF 1 2 3 4 5 0 0.2 0.4 0.6 0.8 1

the nubmer of shared keywords

CPJ Flickr DBLP Tencent DBpedia (b) CPJ Figure 7: AC-label length.

(a) Keyword (CMF) (b) Keyword (CPJ)

(c) Structure (Avg. degree) (d) Structure (degree≥6)

Figure 8: Comparing with community detection method.

ever reported largest attributed graph (vertex number:3.6M); (2) it identifies communities of comparable or superior quality than those of many existing methods like [22, 31]; and (3) it runs faster than

many existing methods. SinceCODICILneeds users to specify the

number of clusters expected, we set the numbers as 1K, 5K, 10K, 50K and 100K. The corresponding adapted algorithms are named asCod1K,· · ·,Cod100Krespectively. Other parameter settings are the same as those in [24]. We first run these algorithms offline to obtain all the communities. Given a query vertexq, they return communities containingqas the results.

We consider both keyword and structure for evaluating

commu-nity quality. (1)Keyword: Figures 8(a) and (b) show that ACQ

(implemented byDec) always performs the best, in terms of CMF

and CPJ. (2)Structure:AsCODICILhas no guarantee on vertices’

minimum degrees, it is unfair to compare them using this metric. We intuitively compare their structure cohesiveness by reporting the average degree of the vertices in the communities and the per-centage of vertices having degrees of 6 or more. When the number of clusters inCODICILis too large or too small, the structure

co-hesiveness becomes weak, as shown in Figures 8(c) and (d). ACQ

always performs better thanCODICIL, even when its number of

cluster is well set (e.g.,Cod10KandCod50Kon DBLP dataset).

3. Comparison with existing CS methods.The existing meth-ods mainly focus on non-attributed graphs. We implement two

state-of-the-art methods: Global[27] andLocal[5]. Both of

them use the metric minimum degree, we thus focus on the key-word cohesiveness. Figure 9 shows the CMF and CPJ values for the four datasets. We can see that the keyword cohesiveness of

ACQis superior to bothGlobalandLocal, becauseACQ

con-siders vertex keywords, whileGlobalandLocaldo not.

7.2.2

A Case Study

We next perform a case study on the DBLP dataset, in which we consider two renowned researchers in database and data mining:

Jim Gray and Jiawei Han. We usek= 4here. We useCod50Kto

(11)

(a) CMF (b) CPJ

Figure 9: Comparing with community search methods.

representCODICILfor further analysis. We mainly consider the

input query keyword setS, keywords and sizes of communities.

1. Effect ofS. Figure 10 shows two ACs of Jiawei (The AC-labels are shown in the captions), where the setSare set as{analysis, mine, data, information, network}and{mine, data, pattern, database} respectively. These two groups of Jiawei’s collaborators are in-volved in graph analysis (Figure 10(a)) and pattern mining (Fig-ure 10(b)). Although these researchers all have close co-author re-lationship with Jiawei, the use of the input keyword setSenables the identification of communities with different research themes. For Jim, we can obtain similar results as discussed in Section 1 (Figure 2). While forCODICIL, it is not clear how to consider the input keyword setS, and we thus do not show the results.

Jiawei Han Jeffrey Xu Yu Xifeng Yan Dong Xin Hong Cheng Jian Pei

Frequent pattern mining

Jiawei Han Charu C. Aggarwal Mohammad M. Masud Nikunj C. Oza Latifur khan Jing Gao

Data stream classification Hongyan Liu Reynold Cheng Hans-peter Kriege Matthias Renz Lei Chen Andreas zufle Efficient probabilistic data

query database Hans-peter Kriege Jeffrey Xu Yu Philip S. Yu Ada Wai-chee Matthias Renz

Efficient query data mine database Andreas zufle

Yiping Ke Reynold Cheng

Ben Kao Kwok-wa Lam Tei-wei Kuo Sheung-lun Hung Kam-yiu Lam Victor C. S. Lee

Concurrency control database system

Ben Kao

Michael Chau

Reynold Cheng David Wai-lok Cheung

Kevin Y. Yip

Sau Dan Lee

Data mine uncertain system

Jiawei Han Xifeng Yan Philip S. Yu Yizhou Sun Tianyi Wu Jiawei Han Jeffrey Xu Yu Philip S. Yu Jianyong Wang Jian Pei Guozhu Dong Jim Gray Michael Stonebraker

Hector Garcia-Moina Stanley B. Zdonik Gerhard Weikum Bruce G. Lindsay Michael L. Brodie Jim Gray Peter Z. Kunszt Christopher Stoughton Alexander S. Szalay Jordan Raddick Jan Vandenberg Ani Thakar Tanu Malik

(a) {analysis, data,

infor-mation, network} Jiawei Han Jeffrey Xu Yu Xifeng Yan Dong Xin Hong Cheng Jian Pei

Frequent pattern mining

Jiawei Han Charu C. Aggarwal Mohammad M. Masud Nikunj C. Oza Latifur khan Jing Gao

Data stream classification Hongyan Liu Reynold Cheng Hans-peter Kriege Matthias Renz Lei Chen Andreas zufle Efficient probabilistic data

query database Hans-peter Kriege Jeffrey Xu Yu Philip S. Yu Ada Wai-chee Matthias Renz

Efficient query data mine database Andreas zufle

Yiping Ke Reynold Cheng

Ben Kao Kwok-wa Lam Tei-wei Kuo Sheung-lun Hung Kam-yiu Lam Victor C. S. Lee

Concurrency control database system

Ben Kao

Michael Chau

Reynold Cheng David Wai-lok Cheung

Kevin Y. Yip

Sau Dan Lee

Data mine uncertain system

Jiawei Han Xifeng Yan Philip S. Yu Yizhou Sun Tianyi Wu Jiawei Han Jeffrey Xu Yu Philip S. Yu Jianyong Wang Jian Pei Guozhu Dong Jim Gray Michael Stonebraker

Hector Garcia-Moina Stanley B. Zdonik Gerhard Weikum Bruce G. Lindsay Michael L. Brodie Jim Gray Peter Z. Kunszt Christopher Stoughton Alexander S. Szalay Jordan Raddick Jan Vandenberg Ani Thakar Tanu Malik

(b) {mine, data, pattern,

database} Figure 10: Jiawei Han’s ACs.

10 20 30 0 0.2 0.4 0.6 0.8 1 MF Cod50K Global Local ACQ

(a) Jim Gray

10 20 30 0 0.2 0.4 0.6 0.8 1 MF Cod50K Global Local ACQ (b) Jiawei Han Figure 11: Frequency distribution of keywords. 2. Keyword analysis.We analyze the frequency distribution of keywords in their communities. Specifically, given a keywordwh, we define the member frequency (MF) ofwhas:M F(wh, C(q)) =

1 L L P i=1 fi,h

|Ci|. The MF measures the occurrence of a keyword in

C(q). For eachCqgenerated by an algorithm, we select 30 words with the highest MF values. We report the MF of each key-word in descending order of their MF values in Figure 11. We see

thatACQhas the highest MF values for the top 20 keywords. Thus,

the keywords associated with the communities generated byACQ

tend to repeat among the community members.

The number of distinct keywords ofACQcommunities is also

the fewest, as shown in Table 4. For example, thek-cored returned

byGlobalhas over139Kdistinct keywords, about 2,300 times

more than that returned byACQ(less than 60 keywords). While the

semantics of thek-cored can be difficult to understand, the small

Table 4: # distinct keywords of communities.

Researcher Cod50K Global Local ACQ

Jim Gray 134 139,881 60 44

Jiawei Han 140 139,881 58 54

number of distinct keywords of AC makes it easier to understand why the community is so formed. We further report the keywords with the 6 highest MF values in the communities in Tables 5 and 6. We can see that, the top-6 keywords are highly related to their

input query keyword sets. Note that the top-6 keywords ofGlobal

are the same for both Jim and Jiawei, as they are in the samek

-d

core. Thus, they cannot be used to characterize the communities

specifically related to Jim and Jiawei. The overall results show that,

ACQperforms better than other methods.

3. Effect ofkon community size.We vary the value ofkand re-port the average size of communities in Figure 12. We can see that

the communities returned byGlobalare extremely large (more

than105), which can make them difficult for a query user to

ana-lyze. The community size ofLocalincreases sharply whenk=8.

In this situation,Localreturns the same community asGlobal.

The size of an AC is relatively insensitive to the change ofk, as AC contains around a hundred vertices for a wide range of values ofk.

4. GPM Results.We have examined communities produced by

Graph Pattern Matching (GPM) algorithms on the DBLP dataset. We consider a “Star-a” pattern, which containsavertices linked to the query vertexq. A keyword setSis randomly drawn from Jim Gray’s keyword sets, i.e.,W(q). Each vertex of the pattern is asso-ciated withS. We vary the size ofS; for each|S|, we obtain 100

different sets. We then execute theMatchalgorithm [9] with its

default settings. Table 7 shows the fraction of GPM

References

Related documents

Таким чином, в міометрії NO або його похідні здатні підвищувати пасивну проникність сарколеми для Са 2+ і стимулюва- ти його транспорт у міоцити, що може при- водити

Cloud Service Selection proposed by Rehman, Hussain – Making use of the QoS history over different time periods, ranks the service using Multi Criteria Decision

The purpose of this project is to identify different strategies for ESL students in community colleges to develop their public speaking skills. Based on the review of literature,

Reconstruction of drip-water δ 18 O based on calcite oxygen and clumped isotopes of speleothems from Bunker Cave (Germany)..

Since traffic flows can be influenced by planning and policy decisions, particularly along local road networks, the second set of analyses focus on understanding how

Movement time (MT), presented as function of 1 level and 2 levels of dissociation between vision and action subtracted from the standard mapping condition (V), for both

Neste estudo observou-se uma prevalência discretamente maior destes fatores de risco nos idosos institucionalizados, o que corrobora com o fato da institucionalização ser, por si