2.1. igraph_random_sample — Generates an increasing random sequence of integers.

int igraph_random_sample(igraph_vector_t *res, igraph_integer_t l, igraph_integer_t h, 
			 igraph_integer_t length);

This function generates an incresing sequence of random integer numbers from a given interval. The algorithm is taken literally from Jeffrey Scott Vitter: 'An Efficient Algorithm for Sequential Random Sampling', ACM Transactions on Mathematical Software, 13/1, 58--67. This method can be used for generating numbers from a very large interval, it is primilarly created for randomly selecting some edges from the sometimes huge set of possible edges in a large graph.

Arguments: 

res:

Pointer to an initialized vector, this will hold the result. It will be resized to the proper size.

l:

The lower limit of the generation interval (inclusive).

h:

The upper limit of the generation interval (inclusive).

length:

The number of random integers to generate.

Returns: 

Error code.

Time complexity: according to the referenced paper, the expected running time is O(length).