This thesis discusses the implementation of function optimization algorithms through distributed and decentralized processing in a peer-to-peer fashion. Our research is focused on a fully decentralized, general purpose P2P environment, with no special or ad-hoc facility for executing optimization tasks. Relevant information is exchanged among nodes by means of epidemic protocols, exploiting the overlay network topology formed by peers. A key issue in such a context is the relationship between the solution quality and the amount/kind of exchanged information among the various running instances. We propose and detail novel heuristics and hyper-heuristics. Experimental results obtained both in simulated and real P2P environments are presented and discussed as well. Distributed optimization has a long and rich history, but little has been done to make it exploit the (potentially) large computing facilities a reliable P2P network can provide. We propose a novel framework that aims at easing the burden of performing function optimization tasks in a decentralized P2P network of solvers. Our ‘GOssiping Optimization Framework’ (GOOF) bridges the gap between P2P services that can provide large reliable networks of interconnected nodes and the needs of optimization practitioners who are often not able to find a reasonably simple way to run their algorithms in such a distributed environment.