2.7. igraph_degree_sequence_game — Generates a random graph with a given degree sequence

int igraph_degree_sequence_game(igraph_t *graph, const igraph_vector_t *out_deg,
				const igraph_vector_t *in_deg, 
				igraph_degseq_t method);

Arguments: 

graph:

Pointer to an uninitialized graph object.

out_deg:

The degree sequence for an undirected graph (if in_seq is of length zero), or the out-degree sequence of a directed graph (if in_deq is not of length zero.

in_deg:

It is either a zero-length vector or NULL (if an undirected graph is generated), or the in-degree sequence.

method:

The method to generate the graph. Possible values: IGRAPH_DEGSEQ_SIMPLE, for undirected graphs this method puts all vertex ids in a bag, the multiplicity of a vertex in the bag is the same as its degree. Then it draws pairs from the bag, until it is empty. This method can generate both loop (self) edges and multiple edges. For directed graphs, the algorithm is basically the same, but two separate bags are used for the in- and out-degrees. IGRAPH_DEGSEQ_VL is a much more sophisticated generator, that can sample undirected, connected simple graphs uniformly. It uses Monte-Carlo methods to randomize the graphs. This generator should be favoured if undirected and connected graphs are to be generated. igraph uses the original implementation Fabien Viger; see http://www-rp.lip6.fr/~latapy/FV/generation.html and the paper cited on it for the details of the algorithm.

Returns: 

Error code: IGRAPH_ENOMEM: there is not enough memory to perform the operation. IGRAPH_EINVAL: invalid method parameter, or invalid in- and/or out-degree vectors. The degree vectors should be non-negative, out_deg should sum up to an even integer for undirected graphs; the length and sum of out_deg and in_deg should match for directed graphs.

Time complexity: O(|V|+|E|), the number of vertices plus the number of edges.

See also: 

igraph_barabasi_game(), igraph_erdos_renyi_game()