How to set the route or path to any node/vertex in iGraph in python

I have a iGraph . I want to set the predefined path to reach any particular node/vertex. How to do that?

It is not clear what you mean. Can you show a concrete example?

In the above graph, I know the path exists in the bold edges like A->B->D and A->C->F while building the graph itself. How to set these routes during setup the iGraph? In future I only consider these predefined path for my calculations … say some score calculations. Although we have edges connecting other nodes, I only consider the bold edges.

I don’t understand what you mean by “set these routes”.

For example if I use the function all_simple_paths() then I get all possible paths from one node to another node. Is there any way I can return only my predefined path highlighted in the graph. Just want to confirm ? or else I have to write my own function to do this.

Idea is set all the predefined route or path in the graph and return those path during calculations.

I don’t think we are making good progress on the clarification. I suggest you phrase your question in terms of a practical, answerable question: (1) this is my input data (2) this is my desired output. Show a concrete example for each. If you have tried anything, show your code in form of a reproducible example.

Reading your description, it sounds like: (1) you have a set of paths as input (2) you want the same as output. Why do you need to do any computation then? You already have your result.

As for all_simple_paths(), at this time there is no way to restrict the output.

Thank you. @szhorvat , from you reply I understood like we cant set the predefined path in the graph. regarding the use case I am working on, I am dealing with more than 10000 nodes (infrastructure nodes) and I cant traverse all the paths every time. I can look only specific paths. It is mainly for scoring purpose.