  Many complex networks display a mesoscopic structure with groups of nodes
sharing many links with the other nodes in their group and comparatively few
with nodes of different groups. This feature is known as community structure
and encodes precious information about the organization and the function of the
nodes. Many algorithms have been proposed but it is not yet clear how they
should be tested. Recently we have proposed a general class of undirected and
unweighted benchmark graphs, with heterogenous distributions of node degree and
community size. An increasing attention has been recently devoted to develop
algorithms able to consider the direction and the weight of the links, which
require suitable benchmark graphs for testing. In this paper we extend the
basic ideas behind our previous benchmark to generate directed and weighted
networks with built-in community structure. We also consider the possibility
that nodes belong to more communities, a feature occurring in real systems,
like, e. g., social networks. As a practical application, we show how
modularity optimization performs on our new benchmark.
