The document proposes a dynamic K-means clustering algorithm to improve routing in mobile ad hoc networks (MANETs). It aims to address limitations of the basic K-means algorithm like fixed cluster heads and members. The dynamic algorithm elects cluster heads periodically based on distance to cluster center and node energy. It allows any node to serve as cluster head for a time slot to address head mobility. Experimental results show the dynamic approach enhances MANET routing performance metrics like route discovery time, delay, and packet delivery rate compared to basic K-means routing.