move graph building code to ReadRegionData