Adding connectedness-check to random network generation