Skip to content
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

Split reaction nodes could be re-unified to nearly halve the number of nodes/edges #37

Open
samblau opened this issue Dec 4, 2020 · 2 comments
Assignees

Comments

@samblau
Copy link
Member

samblau commented Dec 4, 2020

While it was easiest to conceptualize the introduction of prerequisites by any A + B -> ??? reaction node into two, A + PR_B -> ??? and B + PR_A -> ???, technically it is unnecessary since the costs are on the edges, not the nodes. Thus, we can dramatically reduce the size of our networks, which in practice are mostly composed of A + B -> ??? reactions, by replacing the two nodes A + PR_B -> ??? and B + PR_A -> ??? with a single A + B -> ??? node, where the edge from A to that reaction node will include the cost of PR_B and the edge from B to that reaction node will include the cost of PR_A. This should approximately halve the size of our networks (thus halving the amount of memory) and approximately halve the time required to solve prerequisite costs thanks to the scaling of Dijkstra's algorithm.

@samblau
Copy link
Member Author

samblau commented Dec 4, 2020

I expect @KhanWhale may take the first crack at modifying the code to fix this issue since @hpatel1567 has a lot on her plate the next couple of weeks, but @hpatel1567 should be following along closely to make sure she understands and agrees with all changes being made.

@KhanWhale
Copy link
Collaborator

KhanWhale commented Dec 5, 2020

Most recent PR #31 should be a good step in the right direction-was able to generalize graph representation, which will reduce the locations we need to tweak code, as well as elucidate the logic behind the representation in a crisper and more concise manner. Next step may be to modify the actual data stored on nodes/edges so as to simplify the algorithm as well as facilitate the removal of duplicate/redundant nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants