libs/tarjan/tarjan.c
OrderedNodes* tarjan(int* A, size_t n)
{
    size_t v;
    OrderedNodes * result = NULL;
    tarjan_data * data = tarjan_init(A, n);

    if (!data)
        goto end0;

    for (v = 0; v < data->n; v++) {
        if (SIZE_T_ERROR == data->vindex[v]) {
            if (!tarjan_connect(data, v)) {
                goto end0;
            }
        }
    }

    result = data->result;

    tarjan_cleanup(data);

    return result;

end0:
    return 0;
}
/**
 * See wikipedia (https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm) for details
 *
 * A is  the n*n-adjacency matrix of the graph
 **/
See wikipedia  for details
A is  the n*n-adjacency matrix of the graph
See wikipedia for details A is the n * n - adjacency matrix of the graph
OrderedNodes* tarjan(int* A, size_t n)
{
    size_t v;
    OrderedNodes * result = NULL;
    tarjan_data * data = tarjan_init(A, n);
    if (!data)
        goto end0;
    for (v = 0; v < data->n; v++) {
        if (SIZE_T_ERROR == data->vindex[v]) {
            if (!tarjan_connect(data, v)) {
                goto end0;
            }
        }
    }
    result = data->result;
    tarjan_cleanup(data);
    return result;
end0:
    return 0;
}
OrderedNodes * tarjan ( int * A , size_t n ) { size_t v ; OrderedNodes * result = NULL ; tarjan_data * data = tarjan_init ( A , n ) ; if ( ! data ) goto end0 ; for ( v = 0 ; v < data -> n ; v ++ ) { if ( SIZE_T_ERROR == data -> vindex [ v ] ) { if ( ! tarjan_connect ( data , v ) ) { goto end0 ; } } } result = data -> result ; tarjan_cleanup ( data ) ; return result ; end0 : return 0 ; }
See wikipedia (https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm) for details
 A is  the n*n-adjacency matrix of the graph
See wikipedia ( https : // en . wikipedia . org / wiki / Tarjan%27s_strongly_connected_components_algorithm ) for details A is the n * n - adjacency matrix of the graph