Suppose you are given the "action" of a morphism, some specification of what it does to elements; in $\textbf{Set}$ or related categories it would be the graph of a function. Is it possible to determine, in theory or practice, (whether there exists) a set of arrows whose composition matches the given action? If there are many such sets, is it possible to determine the one(s) requiring minimal compositions?
My intuition, stemming from the digraph axiomatization of a category, suggests that this is a simple example of pathfinding. However, most categories not only have infinite or large object sets, but infinite or large hom-sets. It's not clear how the standard algorithms would work on an infinite graph, let alone a graph with infinitely many edges between each vertex. I couldn't find any information on generalizations of pathfinding to such cases. However, it seems like this would be a common enough question in the subject to have been asked before. Is there something I'm missing?