What data structure would you use for the curriculum of the department at the university?

For my homework, I am introducing a university registration system, and I have implemented a simple class for the curriculum with a list of semesters and other properties such as department name, general loans, etc.

But I wonder if I can inherit this class from a graph data structure with edges and vertices.

Has anyone done similar things before?

My current design looks something like this:

public class Curriculum { public string NameOfDepartment { get; set; } public List<Semester> Semesters { get; set; } public bool IsProgramDesigned { get; set; } public Curriculum() { IsProgramDesigned = false; } // public string AddSemester(Semester semester) { 
+8
c #
source share
2 answers

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.

+2
source share

Yes, you can inherit this class from the Graph data structure. You can make it a subclass of everything you want (except for a private class). The question of whether this is a wise design depends entirely on what you want to do. I assume that you know how, so comment if you need an example of how to implement inheritance.

IF you want to write your own graphing algorithms, why not just simulate them yourself? This is likely to be a fun exercise.

0
source share

All Articles