I’m new to OGDF library and need to find the longest path in an acyclic directed graph (I want to use OGDF built in functions).
I know, it is possible to find longest path using shortest path algorithms with negative weights for edges, but also could not find a proper function for it.
Does OGDF has a specific function to do that?
If yes, how can I use it?
I’m new to OGDF library and need to find the longest path in an
Share
In OGDF, you can find the shortest path between node
sand other nodes usingShortestPathWithBFM. The lengths (weights) of edges should be passed to the function, usingEdgeArray<int>. Here is the class definition from its source code:The algorithm would compute the longest path if you pass lengths in negative.
For more information, please refer to: http://www.ogdf.net/doc-ogdf/classogdf_1_1_shortest_path_with_b_f_m.html