This research proposes a novel technique for distributed control and optimization of the networked systems considering the uncertainties associated with internal complex dynamics and external interactions with the environment. The proposed technique applies a distributed multi-agent framework that minimizes the overall objective of the system subject to the limitations on the shared resources. In this framework, each agent tries to optimize its decisions and improve the learning strategy based on artificial neural networks (ANN) without having access to the statistical distributions of the involved parameters. Comprehensive experiments are implemented to investigate the effects of the learning mechanism and the level of uncertainties. The efficiency of the technique is tested by comparing the proposed technique with the existing traditional network optimization techniques. The proposed technique can be utilized in a variety of applications such as min cost flow problems, disease propagation models, and distributed controls over man-made networks such as supply chain and power grid.