In as far as the notion of functor generalizes that of function and that of profunctor generalizes that of relation, the notion of graph of a (pro)functor generalizes that of graph of a function.
Just as the graph of a function , or more generally that of a relation for is nothing but the category of elements of the corresponding characteristic function , so the graph of a functor , or more generally that of a profunctor , is nothing but its category of elements.
Generally, the graph of a functor between -categories is the Grothendieck construction of the corresponding correspondence: the fibration classified by the correspondence, i.e. the comma object
whenever this makes sense. For instance in the context of -category theory the graph may be taken to be the fibration classified by as described at universal fibration of (∞,1)-categories.
For let and be a realization of the notions of -category of -categories and of the -category of -categories, respectively, such that standard constructions of category theory work, in particular a version of the Yoneda lemma. See higher category theory.
Eric: Is it really necessary to restrict to ? In principle, couldn’t you have a graph of a (-1)-functor and/or (-2)-functor?
Toby: Sure. There's not much to them, but why not?
Then with let be a (-)functor.
By the general logic of distributors this defines an -correspondence
The graph of is the fibration classified by .
Mike Shulman: It’s not obvious to me that this is the best thing to call the graph of a functor; there are lots of other graphy things one can construct from a functor that all reduce to the usual notion of the graph of a function. To start with, there is of course also the induced opfibration oven , would you call that the “opgraph”? But actually, the two-sided fibration (an opfibration over and a fibration over ) looks to me more like a graph. And then there is of course the other profunctor induced by , which gives a fibration over , an opfibration over , and a two-sided fibration from to .
Urs Schreiber: I would be inclined to loosely say “graph” for all of these and to introduce terminology like “opgraph” when it really matters which specific realization we mean. Because all these seem to be so similar to me that I am not sure if it is worth distinguishing them a lot. For instance, wouldn’t an analogous discussion be possible concerning what we call given a functor ? I don’t actually know what a standard term is, does one say “opfunctor” for this? But I’d say it doesn’t matter much either way, calling just a functor which effectively is the functor doesn’t do much harm.
To reproduce the ordinary notion of graph of a function let . then -categories are just sets and a functor is just a function between sets. Moreover, the category of -categories is the set of truth values, as described at (-1)-category. The profunctor corresponding to is therefore the characteristic function
that maps
(Notice that in this case .)
The 2-pullback of along is just the ordinary pullback
which identifies with the subset of pairs for which . This is the ordinary notion of graph of a function.
For an ordinary functor, with corresponding profunctor , the category is the category of elements of .
If we regard and as 2-categories under the embedding then the profunctor corresponding to is of the form and in this context is the Grothendieck construction on .
Closely related is the notion of cograph of a functor.