The input should be an undirected graph in compressed sparse row (CSR) format. The result is an array which shows the predecessor of a vertex in the generated tree. The vertex ID can be used to index the result array.