Closed evanscat closed 2 years ago
We use graph in power grid topological analysising. The graph among power grid are always DAG and the most common use case is to find all power supply path. I'll use BFS or DFS to implement my own algorithm.Thanks a lot!
Thanks! If you want to further share your use cases or need guidance, just reach out.
No, at the time being,
graph
only supports finding the shortest path between two vertices. Finding all paths efficiently is one of the hardest problems in graph theory.If you can specialize your use case with a framework of assumptions that are safe to make, you can implement your own path search using BFS or DFS - but providing a built-in function in the library that works for all use cases in all graphs is close to impossible. It might be easier in directed graphs, maybe I'll come up with an algorithm for this in the future.