Testing the gravity model through network analysis