In this paper, we proposed a new approach of data routing in wireless sensors network (WSN) based on Khalimsky theory and Multi-agent systems (MAS). The WSN is constituted by a set of nodes grouped into clusters, and another set of deployed nodes according to the Khalimsky topology acting as gateway agents (GA). In each cluster, there are member node agents (MNA) for data collecting and a master node agent called cluster-head node agent (CHA) for inter-cluster data aggregation, fusion and data transmission to GA. The gateways are organized according to the Khalimsky topology to transmit data by selecting an optimal path among the set of shortest paths between two sensor nodes. Our simulation study showed an optimization of the energy consumption and the communication rates by our solution using the Khalimsky theory and the multi-agent systems. The simulation results of our solution are compared with the results of other routing protocols such as conventional Flooding protocol, Khalimsky Flooding algorithm and LEACH protocol.