parallelized graph building