2.19. igraph_citing_cited_type_game — Simulate a citation network based on vertex types.

int igraph_citing_cited_type_game(igraph_t *graph, igraph_integer_t nodes,
const igraph_vector_t *types,
const igraph_matrix_t *pref,
igraph_integer_t edges_per_step,
igraph_bool_t directed);

This game is similar to igraph_cited_type_game() but here the category of the citing vertex is also considered.

An evolving citation network is modeled here, a single vertex and its edges_per_step citation are added in each time step. The odds the a given vertex is cited by the new vertex depends on the category of both the citing and the cited vertex and is given in the pref matrix. The categories of the citing vertex correspond to the rows, the categories of the cited vertex to the columns of this matrix. Ie. the element in row i and column j gives the probability that a j vertex is cited, if the category of the citing vertex is i.

Note that this function might generate networks with multiple edges if edges_per_step is greater than one. You might want to call igraph_simplify() on the result to remove multiple edges.

Arguments:

 graph: Pointer to an uninitialized graph object. nodes: The number of vertices in the network. types: A numeric matrix of length nodes, containing the categories of the vertices. The categories are numbered from zero. pref: The preference matrix, a square matrix is required, both the number of rows and columns should be the maximum element in types plus one (types are numbered from zero). directed: Logical constant, whether to create a directed network.

Returns:

 Error code.

Time complexity: O((|V|+|E|)log|V|), |V| and |E| are number of vertices and edges, respectively.