| igraph Reference Manual |
|---|
int igraph_compose(igraph_t *res, const igraph_t *g1, const igraph_t *g2);
The composition of graphs contains the same number of vertices as the bigger graph of the two operands. It contains an (i,j) edge if and only if there is a k vertex, such that the first graphs contains an (i,k) edge and the second graph a (k,j) edge.
This is of course exactly the composition of two binary relations.
Two two graphs must have the same directedness, otherwise the function returns with an error message. Note that for undirected graphs the two relations are by definition symmetric.
Arguments:
|
Pointer to an uninitialized graph object, the result will be stored here. |
|
The firs operarand, a graph object. |
|
The second operand, another graph object. |
Returns:
Error code. |
Time complexity: O(|V|*d1*d2), |V| is the number of vertices in the first graph, d1 and d2 the average degree in the first and second graphs.
<< 2.2. igraph_complementer — Create the complementer of a graph |
Chapter 19. Using ARPACK for igraph graphs >> |