-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to best improve results of an algorithm (get nodes and order in path) #400
Comments
Hi @luminize, There is no work that actually contemplate this. Let me know how you want to contribute to this, or open a PR and then we can discuss it. Thank you in advance |
Hi @ZigRazor I'll dive into how to solve finding the node identities that are on the critical path for my "problem". That might to clarify what I think I need. But I can imagine running the algorithm a lot of times with bigger graphs can take up a lot of time. So that might not be the best way. How about remembering the |
Hi @ZigRazor, I have in Typedef.hpp added to the BellmanFordResult_struct: std::vector<std::pair <std::string, double>> node_and_value{}; And in the algorithm if the result is successfull auto edgeSet = Graph<T>::getEdgeSet();
for (const auto &edge : edgeSet) {
auto elem = edge->getNodePair();
result.node_and_value.push_back(std::pair(elem.first.get()->getUserId(), dist[elem.first]) );
} What would help your project? Me adding a PR for this? I'm writing code for finding all critical path(s if there are) with inspecting the edgeset of the graph. Would this have a place in your codebase? An example or helper functions maybe? |
Yes, you can provide a new file with your helper function. |
Dear developers,
First; thank you for this library. Much leaner than boost :)
I use the Bellman Ford algorithm with negative edges to find the longest path in a directed graph. Great out of the box. For future work I would like to get the nodes that lie on the longest (or shortest) path. Think multiple jobs with (sequential) tasks on machines and finding the critical path. Might even get the delayed start times out as a result for all nodes.
I've been looking thru the source, and for starters I'm thinking of adding a vector of visited nodes or something to the results of the algorithm.
What would be the best way to work on this? Update the algorithm in the source code? Is there maybe a more general solution (already in the making)?
Best,
Bas
The text was updated successfully, but these errors were encountered: