AttributeDriven Community Search
Abstract
Recently, community search over graphs has attracted significant attention and many algorithms have been developed for finding dense subgraphs from large graphs that contain given query nodes. In applications such as analysis of protein protein interaction (PPI) networks, citation graphs, and collaboration networks, nodes tend to have attributes. Unfortunately, most previously developed community search algorithms ignore these attributes and result in communities with poor cohesion w.r.t. their node attributes. In this paper, we study the problem of attributedriven community search, that is, given an undirected graph where nodes are associated with attributes, and an input query consisting of nodes and attributes , find the communities containing , in which most community members are densely interconnected and have similar attributes.
We formulate our problem of finding attributed truss communities (ATC), as finding all connected and close ktruss subgraphs containing , that are locally maximal and have the largest attribute relevance score among such subgraphs. We design a novel attribute relevance score function and establish its desirable properties. The problem is shown to be NPhard. However, we develop an efficient greedy algorithmic framework, which finds a maximal truss containing , and then iteratively removes the nodes with the least popular attributes and shrinks the graph so as to satisfy community constraints. We also build an elegant index to maintain the known truss structure and attribute information, and propose efficient query processing algorithms. Extensive experiments on large realworld networks with groundtruth communities shows the efficiency and effectiveness of our proposed methods.
AttributeDriven Community Search
Xin Huang, Laks V.S. Lakshmanan 
University of British Columbia 
{xin0,laks}@cs.ubc.ca 
\@float
copyrightbox[b]
\end@floatGraphs have emerged as a powerful model for representing different types of data. For instance, unstructured data (e.g., text documents), semistructured data (e.g., XML databases) and structured data (e.g., relational databases) can all be modeled as graphs, where the vertices(nodes) are respectively documents, elements, and tuples, and the edges can respectively be hyperlinks, parentchild relationships, and primaryforeignkey relationships [?]. In these graphs, communities naturally exist as groups of nodes that are densely interconnected. Finding communities in large networks has found extensive applications in proteinprotein interaction networks, sensor/communication networks, and collaboration networks. Consequently, community detection, i.e., finding all communities in a given network, serves as a global networkwide analysis tool, and has been extensively studied in the literature. Specifically, various definitions of communities based on different notions of dense subgraphs have been proposed and studied: quasiclique [?], densest subgraph [?], core [?, ?, ?, ?], and ktruss [?, ?]. More recently, a related but different problem called community search has generated considerable interest. It is motivated by the need to make answers more meaningful and personalized to the user [?, ?]. For a given set of query nodes, community search seeks to find the communities containing the query nodes.
In the aforementioned applications, the entities modeled by the network nodes often have properties which are important for making sense of communities. E.g., authors in collaboration networks have areas of expertise; proteins have molecular functions, biological processes, and cellular components as properties. Such networks can be modeled using attributed graphs [?] where attributes associated with nodes capture their properties. E.g., Figure AttributeDriven Community Search shows an example of a collaboration network. The nodes represent authors. Node attributes (e.g., DB, ML) represent authors’ topics of expertise. In finding communities (with or without query nodes) over attributed graphs, we might want to ensure that the nodes in the discovered communities have homogeneous attributes. For instance, it has been found that communities with homogeneous attributes among nodes more accurately predict protein complexes [?]. Furthermore, we might wish to query, not just using query nodes, but also using query attributes. To illustrate, consider searching for communities containing the nodes . Based on structure alone, the subgraph shown in Figure AttributeDriven Community Search is a good candidate answer for this search, as it is densely connected. However, attributes of the authors in this community are not homogeneous: the community is a mix of authors working in different topics – DB, DM, IR, and ML. Previous community search methods include those based on core [?, ?, ?], truss [?], and 1.0quasicliqueadjacent community [?]. A core [?] is a subgraph in which each vertex has at least neighbors within the subgraph. A truss [?] is a subgraph in which each edge is contained in at least triangles within the subgraph. The 1.0quasicliqueadjacent community model [?] allows two cliques overlapping in vertices to be merged into one community. In Figure AttributeDriven Community Search, for and , all these community models will report as the top answer and are thus unsatisfactory. The subgraph obtained from by removing node with unique attribute IR, is a more homogeneous community than and is just as densely connected (see Figure AttributeDriven Community Search(b)). Intuitively, it is a better answer than . Thus, in general, communities found by most previous community search methods can be hard to interpret owing to the heterogeneity of node attributes. Furthermore, the communities reported could contain smaller dense subgraphs with more homogeneity in attributes, which are missed by most previous methods. A recent work [?] proposed an attribute community model. A detailed comparison of [?] with our model can be found in Section AttributeDriven Community Search. Consider now querying the graph of Figure AttributeDriven Community Search with query nodes and attributes (i.e., keywords) {DB, DM}. We would expect this search to return subgraph (Figure AttributeDriven Community Search(b)). On the other hand, for the same query nodes, if we search with attribute {DB} (resp., {DM}), we expect the subgraph (resp., ) to be returned as the answer (Figure AttributeDriven Community Search(a)&(c)). Both and are dense subgraphs where all authors share a common topic (DB or DM).
Given a query consisting of nodes and attributes (keywords), one may wonder whether we can filter out nodes not having those attributes and then run a conventional community search method on the filtered graph. To see how well this may work, consider querying the graph in Figure AttributeDriven Community Search with query node and query attribute ML. Filtering out nodes without attribute ML and applying community search yields the chain consisting of , which is not densely connected. On the other hand, the subgraph induced by is a 3truss in Figure AttributeDriven Community Search(d). Even though it includes one node without ML it is more densely connected than the chain above and is a better answer than the chain as it brings out denser collaboration structure among the authors in the community. Thus, a simple filtering based approach will not work. As some denser subgraphs may be less homogeneous in their node attributes than some sparser ones and a careful balance has to be struck between density and attribute homogeneity.
Another topic related to our problem is keyword search over graphs, which has been extensively studied [?, ?, ?, ?, ?, ?]. A natural question is whether we can model the information suitably and leverage keyword search to find the right communities. We could model authors’ attributes also as nodes and directly connect them to the author nodes and query the resulting graph with the union of the author id’s and the keywords. Figure AttributeDriven Community Search illustrates this for a small subgraph of Figure AttributeDriven Community Search and a query. Keyword search finds answers corresponding to trees or subgraphs with minimum communication cost that connect the input keywords/nodes, where the communication cost is based on diameter, query distance, weight of spanning tree or steiner tree. On this graph, if we search for the query node and attribute DB, we will get the single edge connecting and DB as the answer as this is the subgraph with minimum communication cost connecting these two nodes. Clearly, this is unsatisfactory as a community.
In sum, attributed graphs present novel opportunities for community search by combining dense structure of subgraphs with the level of homogeneity of node attributes in the subgraph. Most previous work in community search fails to produce satisfactory answers over attributed graphs, while keyword search based techniques do not find dense subgraphs. The main problem we study in this paper is finding top communities from attributed graphs, given a community search query consisting of query nodes and query attributes. This raises the following major challenges. Firstly, how should we combine dense connectedness with the distribution of attributes over the community nodes? We need a community definition that promotes dense structure as well as attribute homogeneity. However, there can be tension between these goals: as illustrated in the example above, some denser subgraphs may be less homogeneous in their node attributes than some sparser ones. Secondly, the definition should capture the intuition that the more input attributes that are covered by a community, the better the community. Finally, we need to find the answer communities from large input graphs in an efficient manner.
To tackle these challenges, we propose an attributed truss community () model. Given a query consisting of a set of query nodes and a set of query attributes , a good community must be a dense subgraph which contains all query nodes and attributes must be contained in numerous nodes of the community. The more nodes with attribute , the more importance to commonly accorded by the community members. Additionally, the nodes must share as many attributes as possible. Notice that these two conditions are not necessarily equivalent. Capturing these intuitions, we define an attribute score function that strikes a balance between attribute homogeneity and coverage. Moreover, as a qualifying cohesive and tight structure, we define a novel concept of  for modeling a densely connected community. A  is a connected truss containing all query nodes, where each node has a distance no more than from every query node. This inherits many nice structural properties, such as bounded diameter, edge connectivity, and hierarchical structure. Thus, based on attribute score function and , we propose a novel community model as attributed truss community (), which is a  with the maximum attribute score. In this paper, we make the following contributions.

We motivate the problem of attributed community search, and identify the desiderata of a good attributed community (Section AttributeDriven Community Search).

We propose a novel dense and tight subgraph, , and design an attribute score function satisfying the desiderata set out above. Based on this, we propose a community model called attributed truss community (), and formulate the problem of attributed community search as finding (Section AttributeDriven Community Search).

We analyze the structural properties of and show that it is nonmonotone, nonsubmodular and nonsupermodular, which signal huge computational challenges. We also formally prove that the problem is NPhard (Section AttributeDriven Community Search).

We develop a greedy algorithmic framework to find an containing given query nodes w.r.t. given query attributes. It first finds a maximal , and then iteratively removes nodes with smallest attribute score contribution. For improving the efficiency and quality, we design a revised attribute marginal gain function and a bulk removal strategy for cutting down the number of iterations (Section AttributeDriven Community Search).

For further improving efficiency, we explore the local neighborhood of query nodes to search an . This algorithm first generates a Steiner tree connecting all query nodes, and then expands the tree to a dense subgraph with the insertion of carefully selected nodes, that have highly correlated attributes and densely connected structure (Section 2).

We conduct extensive experiments on 7 real datasets, and show that our attribute community model can efficiently and effectively find groundtruth communities and social circles over realworld networks, significantly outperforming previous work (Section AttributeDriven Community Search).
We discuss related work in Section AttributeDriven Community Search, and conclude the paper with a summary in Section AttributeDriven Community Search.
We consider an undirected, unweighted simple graph with vertices and edges. We denote the set of neighbors of a vertex by , and the degree of by . We let denote the maximum vertex degree in . W.l.o.g. we assume that the graphs we consider are connected. Note that this implies that . We consider attributed graphs and denote the set of all attributes in a graph by . Each node contains a set of zero or more attributes, denoted by . The multiset union of attributes of all nodes in is denoted . Note that . We use to denote the set of nodes having attribute , i.e., .
Given a query with a set of query nodes and a set of query attributes , the attributed community search () problem is to find a subgraph containing all query nodes , where the vertices are densely interconnected, cover as many query attributes as possible and share numerous attributes. In addition, the communication cost of should be low. We call the query an query. Before formalizing the problem, we first identify the commonly accepted desiderata of a good attributed community.
Criteria of a good attributed community: Given a graph and a query , an attributed community is a connected subgraph that satisfies:

(Participation) contains all query nodes as ;

(Cohesiveness) A cohesiveness function that measures the cohesive structure of is high.

(Attribute Coverage and Correlation) An attribute score function that measures the coverage and correlation of query attributes in vertices of is high.

(Communication Cost) A communication cost function that measures the distance of vertices in is low.
The participation condition is straightforward. The cohesiveness condition is also straightforward since communities are supposed to be densely connected subgraphs. One can use any notion of dense subgraph previously studied, such as core, truss, etc. The third condition captures the intuition that more query attributes covered by , the higher ; also more attributes shared by vertices of , the higher . This motivates designing functions with this property. Finally, keeping the communication cost low helps avoid irrelevant vertices in a community. This is related to the socalled free rider effect, studied in [?, ?]. Intuitively, the closer the community nodes to query nodes, subject to all other conditions, the more relevant they are likely to be to the query. Notice that sometimes a node that does not contain query attributes may still act as a “bridge” between other nodes and help improve the density. A general remark is that other than the first condition, for conditions 2–4, we may either optimize a suitable metric or constrain that the metric be above a threshold (below a threshold for Condition 4). We formalize this intuition in Section AttributeDriven Community Search and give a precise definition of an attributed communityand formally state the main problem studied in the paper .
Work related to this paper can be classified into community search, keyword search, team formation, and community detection in attributed graphs. Table AttributeDriven Community Search shows a detailed comparison of representative works on these topics.
Method  Topic  Participation  Attribute  Cohesiveness  Communication 

Condition  Function  Constraint  Cost  
[?]  ✓  ✓  
[?]  ✓  ✓  
[?]  ✓  ✓  
[?]  ✓  ✓  
[?]  ✓  ✓  ✓  
[?]  ✓  ✓  
[?]  ✓  ✓  ✓  
[?]  ✓  ✓  
[?]  ✓  ✓  ✓  
[?]  ✓  ✓  ✓  
Ours  ✓  ✓  ✓  ✓ 
Community Search. Community search on a graph aims to find densely connected communities containing query nodes, and has attracted a great deal of attention recently. Various models based on different dense subgraphs have been proposed and studied: quasiclique [?], densest subgraph [?], kcore [?, ?, ?] and ktruss [?, ?]. All these works focus on the structure of the community while ignoring node attributes. This can result in communities with poor cohesion in the attribute sets of the community nodes. In particular, while [?, ?] use truss as the basis structure of communities, the truss communities they find are not guaranteed to have high cohesion in the attribute sets of the nodes.
Keyword Search. Keyword search in relational databases has been extensively studied. Most of the works focus on finding minimal connected tuple trees from a relational database [?, ?, ?, ?, ?, ?]. There are two basic approaches: DBXplorer [?] DISCOVERI [?], and DISCOVERII [?] use SQL to find tupletrees. The other approach materializes a relational database as a graph, and finds trees from the graph: e.g., see BANKSI [?] and BANKSII [?]. Keyword search over graphs finds a substructure containing all or a subset of the input keywords. The works [?, ?] report subgraphs instead of trees as keyword search answers. However, keyword search does not consider the cohesive structure involving the query nodes and keywords. As illustrated in the introduction, keyword search cannot return the right communities over attributed graphs.
Team Formation. Lappas et al. [?] introduced the problem of discovering a team of experts from a social network, that satisfies all attributed skills required for a given task with low communication cost. Kargar and An [?] study the team formation problem with a team leader who communicates with each team member to monitor and coordinate the project. Most of the team formation studies focus on a tree substructure, as opposed to densely connected subgraph required by community search. Gajewar and Sarma [?] extend the team formation problem to allow for potentially more than one member possessing each required skill, and use maximum density measure or minimum diameter as the objective. Compared with our problem, these studies do not consider both dense structure and distance constraint at the same time, and also have no constraint on query nodes.
Community Detection in Attributed Graphs. Community detection in attributed graphs is to find all densely connected components with homogeneous attributes [?, ?, ?]. Zhou et al.[?] model the community detection problem as graph clustering, and combine structural and attribute similarities through a unified distance measure. When highdimensional attributed communities are hard to interpret or discover, [?, ?] consider subspace clustering on highdimensional attributed graphs. A survey of clustering on attributed graphs can be found in [?]. Community detection in attributed graphs is to find all communities of the entire graph, which is clearly different from our goal of querybased community search. Moreover, it is practically hard and inefficient to adapt the above community detection approaches [?, ?, ?] for online attributed community search: community detection is inherently global and much of the work involved may be irrelevant to the community being searched.
Recently, Yang et al.[?] have proposed a model for community search over attributed graphs based on cores. The key distinction with our work is as follows. (1) Our community model is based on trusses, which have wellknown advantages over cores such as denser structure. A connected core has no guarantee to be edgeconnected, even with a large core value . (2) Our search supports multiple query nodes whereas theirs is limited to a single query node. (3) Their approach may miss useful communities. E.g., consider the example graph in Figure AttributeDriven Community Search with query node and attributes {DB, DM}, and parameter . Their model will return the subgraphs (Figure AttributeDriven Community Search(a)) and (Figure AttributeDriven Community Search(c)) as answers. However, the subgraph (Figure AttributeDriven Community Search(a)) will not be discovered, due to their strict homogeneity constraints. (4) Furthermore, unlike them, we minimize the query distance of the community which has the benefit of avoiding the free rider effect. (5) Finally, unlike them, we validate our model with experiments over datasets with groundtruth communities.
In this section, we develop a notion of attributed community by formalizing the the desiderata discussed in Section AttributeDriven Community Search. We focus our discussion on conditions 2–4.
In the following, we introduce a novel definition of dense and tight substructure called  by paying attention to cohesiveness and communication cost.
Cohesiveness. While a number of definitions for dense subgraphs have been proposed over the years, we adopt the truss model, proposed by Cohen [?], which has gained popularity and has been found to satisfy nice properties.
A subgraph is a core, if every vertex in has degree at least . A triangle in is a cycle of length 3. We denote a triangle involving vertices as . The support of an edge in , denoted , is the number of triangles containing , i.e., . When the context is obvious, we drop the subscript and denote the support as . Since the definition of truss [?, ?] allows a truss to be disconnected, we define a connected truss below.
Definition 1 (Connected KTruss)
Given a graph and an integer , a connected truss is a connected subgraph , such that , .
Intuitively, a connected truss is a connected subgraph in which each connection (edge) is “endorsed” by common neighbors of and [?]. A connected truss with a large value of signifies strong innerconnections between members of the subgraph. In a truss, each node has degree at least , i.e., it is a core , and a connected truss is also edgeconnected, i.e., it remains connected if fewer than edges are removed [?].
Example 1
Consider the graph (Figure AttributeDriven Community Search). The edge is contained in three triangles , and , thus its support is . Consider the subgraph of (Figure AttributeDriven Community Search(c)). Every edge of has support , thus is a 4truss. Note that even though the edge has support 3, there exists no 5truss in the graph in Figure AttributeDriven Community Search.
Communication Cost. For two nodes , let denote the length of the shortest path between and in , where if and are not connected. The diameter of a graph is the maximum length of a shortest path in , i.e., . We make use of the notion of graph query distance in the following.
Definition 2 (Query Distance [?])
Given a graph and query nodes , the vertex query distance of vertex is the maximum length of a shortest path from to a query node in , i.e., . Given a subgraph and , the graph query distance of is defined as
Given a subgraph and , the query distance measures the communication cost between the members of and the query nodes. A good community should have a low communication cost with small .
For the graph in Figure AttributeDriven Community Search and query nodes , the vertex query distance of is . Consider the subgraph in Figure AttributeDriven Community Search(a). Then graph query distance of is . The diameter of is .
(k, d)truss. We adapt the notions of truss and query distance, and propose a new notion of  capturing dense cohesiveness and low communication cost.
Definition 3 ()
Given a graph , query nodes , and numbers and , we say that is a  iff is a connected truss containing and .
By definition, the cohesiveness of a  increases with , and its proximity to query nodes increases with decreasing . For instance, the community in Figure AttributeDriven Community Search (a) for is a  with and .
We first identify key properties that should be obeyed by a good attribute score function for a community. Let denote the attribute score of community w.r.t. query attributes . We say that a node of covers an attribute , if . We say that a node of is irrelevant to the query if it does not cover any of the query attributes.
1: The more query attributes that are covered by some node(s) of , the higher should be the score . The rationale is obvious.
2: The more nodes contain an attribute , the higher the contribution of should be toward the overall score . The intuition is that attributes that are covered by more nodes of signify homogeneity within the community w.r.t. shared query attributes.
3: The more nodes of that are irrelevant to the query, the lower the score .
We next discuss a few choices for defining and analyze their pros and cons, before presenting an example function that satisfies all three principles. Note that the scores are always compared between subgraphs that meet the same structural constraint of . An obvious choice is to define , where , the contribution of attribute to the overall score, can be viewed as the relevance of w.r.t. . This embodies 1 above. Inspired by 2, we could define , i.e., the number of nodes of that cover . Unfortunately, this choice suffers from some limitations by virtue of treating all query attributes alike. Some attributes may not be shared by many community nodes while others are and this distinction is ignored by the above definition of . To illustrate, consider the community in Figure AttributeDriven Community Search(a) and the query ; has 5 vertices associated with the attribute and achieves a score of 5. The subgraph of the graph shown in Figure AttributeDriven Community Search also has the same score of 5. However, while the community in Figure AttributeDriven Community Search(a) is clearly a good community, as all nodes carry attribute , the subgraph in Figure AttributeDriven Community Search includes several irrelevant nodes without attribute . Notice that both and are 4trusses so we have no way of discriminating between them, which is undesirable.
An alternative is to define as as this captures the popularity of attribute . Unfortunately, this fails to reward larger commumities. For instance, consider the query over the graph in Figure AttributeDriven Community Search. The subgraph in Figure AttributeDriven Community Search(a) as well as its subgraph obtained by removing is a 4truss and both will be assigned a score of 1.
In view of these considerations, we define as a weighted sum of the score contribution of each query attribute, where the weight reflects the popularity of the attribute.
Definition 4 (Attribute Score)
Given a subgraph and an attribute , the weight of an attribute is , i.e., the fraction of nodes of covering . For a query and a community , the attribute score of is defined as , where is the number of nodes covering .
The contribution of an attribute to the overall score is . This depends not only on the number of vertices covering but also on ’s popularity in the community . This choice discourages vertices unrelated to the query attributes which decrease the relevance score, without necessarily increasing the cohesion (e.g., trussness). At the same time, it permits the inclusion of essential nodes, which are added to a community to reduce the cost of connecting query nodes. They act as an important link between nodes that are related to the query, leading to a higher relevance score. We refer to such additional nodes as steiner nodes. E.g., consider the query on the graph in Figure AttributeDriven Community Search. As discussed in Section AttributeDriven Community Search, the community in Figure AttributeDriven Community Search(d) is preferable to the chain of nodes . Notice that it includes with attribute (but not ); is thus a steiner node. It can be verified that which is smaller than the attribute score of the chain, which is . However, is a 3truss whereas the chain is a 2truss. It is easy to see that any supergraph of in Figure AttributeDriven Community Search is at most a 3truss and has a strictly smaller attribute score.
The more query attributes a community has that are shared by more of its nodes, the higher its attribute score. For example, consider the query on our running example graph of Figure AttributeDriven Community Search. The communities in Figure AttributeDriven Community Search are all potential answers for this query. We find that ; by symmetry, ; on the other hand, . Intuitively, we can see that and are mainly focused in one area (DB or DM) whereas has 5 nodes covering DB and DM each and also has the highest attribute score.
Remark 1
We stress that the main contribution of this subsection is the identification of key principles that an attribute score function must satisfy in order to be effective in measuring the goodness of an attributed community. Specifically, these principles capture the important properties of high attribute coverage and high attribute correlation within a community and minimal number of nodes irrelevant to given query. Any score function can be employed as long as it satisfies these principles. The algorithmic framework we propose in Section AttributeDriven Community Search is flexible enough to handle an community model equipped with any such score function.
We note that a natural candidate for attribute scoring is the entropybased score function, defined as . It measures homogeneity of query attributes very well. However, it fails to reward larger communities, specifically violating Principle 1. E.g., consider the query on the graph in Figure AttributeDriven Community Search. The subgraph in Figure AttributeDriven Community Search(a) and its subgraph obtained by removing are both 4trusses and both are assigned a score of 0. Clearly, has more nodes containing the query attribute DB.
Combining the structure constraint of  and the attribute score function , we define an attributed truss community () as follows.
Definition 5
[Attribute Truss Community] Given a graph and a query and two numbers and , is an attribute truss community (), if satisfies the following conditions:

is a  containing .

has the maximum attribute score among subgraphs satisfying condition (1).
In terms of structure and communication cost, condition (1) not only requires that the community containing the query nodes be densely connected, but also that each node be close to the query nodes. In terms of query attribute coverage and correlation, condition (2) ensures that as many query attributes as possible are covered by as many nodes as possible.
Example 2
For the graph in Figure AttributeDriven Community Search, and query with and , in AttributeDriven Community Search(b) is the corresponding , since is a truss with the largest score as seen before.
The  studied in this paper can be formally formulated as follows.
Problem Statement: Given a graph , query and two parameters and , find an , such that is a  with the maximum attribute score .
We remark that in place of the  with the highest attribute score, we could consider the problem of finding the  with the highest attribute score. Our technical results and algorithms easily generalize to this extension.
In this section, we analyze the complexity of the problem and show that it is NPhard. We then analyze the properties of the structure and attribute score function of our problem. Our algorithms for community search exploit these properties.
Our main result in this section is that the  is NPhard (Theorem 2). The crux of our proof idea comes from the hardness of finding the densest subgraph with vertices [?]. Unfortunately, that problem cannot be directly reduced to our . To bridge this gap, we extend the notion of graph density to account for vertex weights and define a helper problem called  – given a graph, find the subgraph with maximum “weighed density” with at least vertices. We then show that it is NPhard and then reduce the  to our problem.
Weighted Density. Let be an undirected graph. Let be a nonnegative weight associated with each vertex . Given a subset , the subgraph of induced by is , where . For a vertex in a subgraph , its degree is . Next, we define:
Definition 6 (Weighted Density.)
Given a subset of vertices of a weighted graph , the weighted density of subgraph is defined as .
Recall that traditional edge density of an induced subgraph is [?, ?]. That is, is twice the average degree of a vertex in . Notice that in Definition 6, if the weight of is , , then the weighted density . It is well known that finding a subgraph with the maximum edge density can be solved optimally using parametric flow or linear programming relaxation [?]. However, given a number , finding the maximum density of a subgraph containing at least vertices is NPhard [?].
Define the weight of a vertex in a graph as its degree in , i.e., . Then, . We define a problem, the , as follows: given a graph with weights as defined above, and a density threshold , check whether contains an induced subgraph with at least vertices such that . We show it is NPhard in Theorem 1. To establish this, we first show that the , i.e., finding whether has a subgraph with exactly vertices with weighted density at least , i.e., , is NPhard.^{1}^{1}1Notice that the hardness of finding the maximum density subgraph with vertices does not imply hardness of  for a specific weight function over the vertices and thus it needs to be proved. We then extend this result to the hardness of the .
Lemma 1
 is NPhard.

We reduce the wellknown NPcomplete problem, CLIQUE, to missing. Given a graph with vertices and a number , construct a graph as follows. For each vertex , add new dummy vertices. contains an edge connecting each with each of its associated dummy vertices. Notice that the maximum degree of any node in is . In particular, every vertex in has degree in whereas every dummy vertex in has degree . So for any , . Set . We claim that contains a clique of size iff .
: Suppose is a clique. Since each vertex of has degree in and is the average degree of a vertex in , we have .
: Suppose contains an induced subgraph with and with . It is clear that for any with , . The reason is that vertices in have degree in . Thus, we must have . Now, for any , is upper bounded by . Thus, , and we can infer that , implying is a clique.
Theorem 1
 is NPhard.

missingWe can reduce missing to , using the ideas similar to those used in reducing the densest subgraph problem to the densest at least k subgraph problem [?].
Theorem 2
 is NPhard.

We reduce the missing to . Given a graph with vertices, construct an instance as follows. is a complete graph over vertices. For simplicity, we use to refer to the vertex set of both and , without causing confusion. For each edge , create a distinct attribute for . We assume and denote the same attribute. Then, with each vertex in , associate a set of attributes: . Notice that the cardinality of is . Also, an attribute is present only in the attribute sets of and , i.e., .
For a vertex set , we will show that , where is the induced subgraph of by , is the induced subgraph of by , and . That is, the query attributes are the set of attributes associated with every edge of . We have
(1) For every attribute , exactly one of the following conditions holds:

: In this case . Clearly, , so .

exactly one of belongs to and . In this case, , so .

. In this case, clearly and , so .
Therefore,
(2) On the other hand, we have
(3) Overall, . Next, we show that an instance of  is a YESinstance iff for the corresponding instance of , has a weighted density above a threshold, w.r.t. the query where and and the parameter .^{2}^{2}2Since , we can set to any value; we choose to set it to the tightest value. The hardness follows from this.
Suppose is a YESinstance of , i.e., there exists a subset such that for the induced subgraph of , we have . Then, the subgraph has . In addition, since and is an clique, is a clique, and hence a truss. For , trivially and satisfies the communication constraint on query distance. Thus, is a  with , showing is a YESinstance of .
Supose there exists a  , a subgraph of induced by , with . Then, we have and . Since is a truss and , we have , showing is a YESinstance of .

In view of the hardness, a natural question is whether efficient approximation algorithms can be designed for . Thereto, we investigate the properties of the problem in the next subsections. Observe that from the proof, it is apparent that the hardness comes mainly from maximizing the attribute score of a .
Our attribute truss community model is based on the concept of truss, so the communities inherit good structural properties of trusses, such as kedgeconnected, bounded diameter and hierarchical structure. In addition, since the attribute truss community is required to have a bounded query distance, it will have a small diameter, as explained below.
A truss community is ()edgeconnected, since it remains connected whenever fewer than edges are deleted from the community [?]. Moreover, a truss based community has hierarchical structure that represents the hearts of the community at different levels of granularity [?], i.e., a truss is always contained in some truss, for . In addition, for a connected truss with vertices, the diameter is at most [?]. Small diameter is considered an important property of a good community [?].
Since the distance function satisfies the triangle inequality, i.e., for all nodes , , we can express the lower and upper bounds on the community diameter in terms of the query distance as follows.
Observation 1
For a  and a set of nodes , we have .
Remark 2
Besides truss, there exist several other definitions of dense subgraphs including: (,)nucleus [?], quasiclique [?], densest subgraph [?], and core [?]. A (,)nucleus, for positive integers and , is a maximal union of cliques in which every clique is present in at least cliques, and every pair of cliques in that subgraph is connected via a sequence of cliques containing them. Thus, (,)nucleus is a generalized concept of truss, which can achieve very dense strucutre for large parameters , , and . However, finding (,)nucleus incurs a cost of time where is the number of edges, which is more expensive than the time taken for computing trusses, whenever . A detailed comparison of truss and other dense subgraph models can be found in [?]. In summary, truss is a good dense subgraph model that strikes a balance between good structural property and efficient computation.
We next investigate the properties of the attribute score function, in search of prospects for an approximation algorithm for finding . From the definition of attribute score function , we can infer the following useful properties.
Positive influence of relevant attributes. The more relevant attributes a community has, the higher the score . E.g., consider the community and in Figure AttributeDriven Community Search (d). If the additional attribute “ML” is added to the vertex , then it can be verified that the score will increase. We have:
Observation 2
Given a and a vertex , let a new input attribute be added to , and denote the resulting community. Then .
In addition, we have the following easily verified observation.
Observation 3
Given a and query attribute sets , we have .
Negative influence of irrelevant vertices. Adding irrelevant vertices with no query attributes to a will decrease its attribute score. For example, for , if we insert the vertex with attribute into the community in Figure AttributeDriven Community Search(b), it decreases the score of the community w.r.t. the above query attribute , i.e., . The following observation formalizes this property.
Observation 4
Given two ’s and where , suppose and , . Then .
Nonmonotone property and majority attributes. The attribute score function is in general nonmonotone w.r.t. the size of the community, even when vertices with query related attributes are added. For instance, for the community in Figure AttributeDriven Community Search(a), with , . Let us add vertex with attribute into and represent the resulting graph as , then . If vertex has attribute DB instead of IR, then it is easy to verify that the attribute score of the resulting graph w.r.t. is strictly higher than . Thus, is neither monotone nor antimonotone. This behavior raises challenges for finding with the maximum attibute score. Based on the above examples, we have the following observation.
Observation 5
There exist ’s and with , and , such that , and there exist ’s and with , and , for which