| igraph Reference Manual |
|---|
int igraph_lattice(igraph_t *graph, const igraph_vector_t *dimvector, igraph_integer_t nei, igraph_bool_t directed, igraph_bool_t mutual, igraph_bool_t circular);
Arguments:
|
An uninitialized graph object. |
|
Vector giving the sizes of the lattice in each of its dimensions. Ie. the dimension of the lattice will be the same as the length of this vector. |
|
Integer value giving the distance (number of steps) within which two vertices will be connected. Not implemented yet. |
|
Boolean, whether to create a directed graph. The direction of the edges is determined by the generation algorithm and is unlikely to suit you, so this isn't a very useful option. |
|
Boolean, if the graph is directed this gives whether to create all connections as mutual. |
|
Boolean, defines whether the generated lattice is periodic. |
Returns:
Error code:
|
Time complexity: if nei is less than two then it is O(|V|+|E|) (as
far as i remember), |V| and |E| are the number of vertices
and edges in the generated graph. Otherwise it is O(|V|*d^o+|E|), d
is the average degree of the graph, o is the nei argument.
<< 1.6. igraph_star — Creates a star graph, every vertex connects only to the center. |
1.8. igraph_ring — Creates a ring graph, a one dimensional lattice. >> |