Geneate 1M small graphs (up to 32 vertexs). For each such graph verify
that SCCs computed by compute_scc() are correct:
- generate a small graph;
- use DFS to compute a matrix of vertexes reachable from each vertex;
- compute SCCs using
compute_scc(); - for each pair of vertexes
vreachable fromu:- if
uis also reachable fromvthenuandvmust be in a same SCC; - otherwise
uandvmust be in different SCCs.
- if
- for each pair of vertexes
vnot reachable fromu,uandvmust be in different SCCs.
Mock kernel functions to allow copy-pasting compute_scc() as-is.