We propose and analyze a mathematical model for the evolution of opinions on
directed complex networks. Our model generalizes the popular DeGroot and
Friedkin-Johnsen models by allowing vertices to have attributes that may
influence the opinion dynamics. We start by establishing sufficient conditions
for the existence of a stationary opinion distribution on any fixed graph, and
then provide an increasingly detailed characterization of its behavior by
considering a sequence of directed random graphs having a local weak limit. Our
most explicit results are obtained for graph sequences whose local weak limit
is a marked Galton-Watson tree, in which case our model can be used to explain
a variety of phenomena, e.g., conditions under which consensus can be achieved,
mechanisms in which opinions can become polarized, and the effect of disruptive
stubborn agents on the formation of opinions