Nowadays, legacy electrical distribution systems are migrating to a new modern electric grid with the capability of supporting different applications such as advanced metering infrastructure (AMI), distributed energy resources, and electric vehicles. Among these applications, AMI is playing an important role in delivering data from customers to power utilities, supporting reliable real-time monitoring, and remote operation of power quality data and voltage profile. The AMI consists of smart meters, data aggregation points (DAPs), the utility control center, and communication networks. Appropriate network planning plays an essential role in facilitating the exchange of data between consumers and power utilities as well as accommodating new smart grid applications and future growth. This work proposes an optimal placement of DAPs for AMI based on machine learning clustering techniques in residential grids. Network partitioning is introduced to create sub-networks and graph algorithms generate a deployment topology given optimization constraints. A new measurement metric called coverage density is considered to indicate neighborhood area networks (NAN) zones with the appropriate coverage. Three real scenarios of NAN are considered: urban, suburban, and rural. The proposed algorithm is evaluated and compared with conventional heuristic optimization methods with respect to average and maximum distance between smart meters and DAPs, coverage density, and execution time.