Determining functions from a graph