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.
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.