Adaptation, learning, and optimization over networks