Most cities around the world are in danger of disasters. Among disasters, the earthquake is the most dangerous and ruining one. Iran has been located in the Alpine-Himalayas seismic belt, and because of the significant frequency of severe earthquakes happening all over the country compare to other countries and the state of the unsecured residential and non-residential buildings in most of the areas, attention to the post-disaster phase is vital. This study aims to locate shelters in some districts and allocate at-risk people of all districts to these shelters. Also, another purpose of this study is the reduction of the allocated budget by the government and reduction of traveled distance by people considering the possibility of link failure due to the earthquake. Allocated budget by the government for shelter construction includes the fixed and marginal cost. Mixed Integer Linear Programming has been used for modeling the suggested method. This method has been applied to the Tehran network, and the Genetic Algorithm has been used for solving the proposed method. The results showed that the leading share of the imposed costs arose from the shelter construction budget. Furthermore, the probability of choosing a district for constructing a shelter has a direct relationship with the at-risk population and the cost of shelter construction in that district. Seven districts have chosen to build shelters with about 400 thousand people capacity. District 16 chosen for constructing the biggest shelter that should serve to up to 123 thousand people and District 5 chosen to construct the smallest shelter that should serve to up to 16 thousand people.