fix random bug in graph builder

Link: https://github.com/GeneAssembly/biosal/issues/509
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>