As an enterprise architect, I would absolutely not use the graph structure for this data. This data is a list and nothing more.
For a problem like this, the only reason I would ever consider using a graph structure would be to potentially create a relationship between the requirements and prerequisites of the course.
That way, you could use the graph algorithm to determine if it really is intended to be registered for the class, making sure that it is a valid addition to the tree. You can check the same for deleting classes to make sure that you are not dropping the class and staying in the lab for an example class.
Now, if I were going to actually implement this. I would still have a general list of classes that have a key to the top in the graph view. It should be borne in mind that graph algorithms are the biggest strong forward that you can drop into the database, so minimizing the amount of work done to plot the graph is always key. Depending on the size and volume, I would also evaluate if I can store whole graphs in serialized form or use a document database for the same reason.
What in this example would be the most likely route I would take. I would save the whole object of the necessary premises, etc. Right inside my course facility. Since the graph is the set that he made, there is no need to actually go around the graph, and you better keep the pre-computed graph.
Chris marisic
source share