3bcf0b83f7f0e6bffdebd5bef3beb1d382437262
12 struct components
*next
;
15 #define FOREACHCOMP(x, l) for(struct components *x = l; x != NULL; x = x->next)
18 * Calculate the strongly connected components using Tarjan's algorithm:
19 * en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm
21 * Returns NULL when there are invalid edges
23 * @param number of nodes
24 * @param data of the nodes
25 * @param number of edges
26 * @param data of edges
28 struct components
*tarjans(int nnodes
, void *nodedata
[], int nedges
,
29 struct edge
*edgedata
[], int *error
);
32 * Free a list of components
34 * @param cs components
35 * @param freefun function to free the data with, if NULL, data isn't freed
37 void components_free(struct components
*cs
, void (*freefun
)(void *));