Graph Algorithm
Last updated
Last updated
GlobalChem Internal Network
class GlobalChem
was designed where each Node
is stored as a flat list in the attribute of the class like so as well as itself, GlobalChem
gets installed as a dummy
node:
If we look at the initiate
_network()
in more detail:
The network gets added with both parents
and children
lists. This will act as a linked list of sorts where each node can have as many parents and as many children. Press "Network Diagram" to see the red circle as the node and the purple as the parent and child lists.
Choosing this decision was based on flexibility. There are rules that accommodate this type of software design.
Rule 1
For now to start off the graph networks we need to define a center. Somewhere to start and then place all the other nodes. That being said we don't start off we multiple nodes, this was just to make the data structure easier to implement but could be subject to start from several places.
The code can be initialized like so:
Adding a node is the root of the algorithm and defined here as well as the source code but first there is another rule that must be met:
Rule 2
For example there cannot be a situation like this:
Users can construct their own graphs from here and whatever they fit. This is what makes the lookup so fast instead of traversing through directories since it's only serving as a key:value pair.
The algorithm is pretty efficient in keep tracking but there is no order which is the trick - another part of the algorithm will handle that which can be called with the function:
To build the network first global makes a each python file that is a correspond object into a reversed list:
Then the parent object is popped off:
Then proceeds into the node_function
where the next item which is environment is added as a child into global_chem
. This continues until the length of thew list reaches a value of 1 which is the leaf node.
Deep Graph Layer Network
The deep layer network follows similar design paradigms but is adjusted a little bit. There must be a root node of 1 which marks as your "input" node. This revisits the case of a similar rule we established before. The fundamental rule is