How to find all the nodes that lead to certain other node without traversing all the graph? (directed graph)
Is there a way to performed this?
Are there techniques or algorithms that help perform this task without having to traverse all the graph?
UPDATE
Imagine that your graph has 3 paths that can reach A, how do you find those 3 paths without traversing all the graph? I don't want one of the paths but all tree. I'm from relational databases and what cames to my mind is indexes, but graphs are different, so I'm asking if there is a way to find all the nodes that lead to A without traversing all the graph. Or in worst case traversing only once, and from there I can just query the structure for the paths.
In SQL Terms it would be like:
SELECT nodes.id
FROM Graph
WHERE node.destination = "A";
node.destination would have to take into account indirect paths.
So this is kinda what I want. a fast way to get all the nodes that can reach node A