implements graph building from dvid