  The problem of finding graph structure of functions commuting with a given
function in terms of their functional graphs is considered. Structure of
functional graphs of commuting functions is described. The problem is reduced
to describing graph homomorphisms of weakly connected components of functional
graphs. Four subcases with finite sets are considered: permutations commuting
with permutation, permutations commuting with a function, functions commuting
with a permutation and functions commuting with a function. For finite sets the
number of functions commuting with a given one and functions with extremal
properties are found. Results for finite sets are generalized to the case of
arbitrary sets where there are additional types of functional graph components.
