# Dependency Graph

c# question and need guidance to help me learn.

Everything in the file
Requirements:
1/27/23, 11:19 AMAssignment Two – Dependency Graphhttps://utah.instructure.com/courses/834041/assignments/11982609?return_to=https%3A%2F%2Futah.instructure.com%2Fcalendar%23view_name%3Dmonth%26…2/15Use Testing to drive and improve development. Define and implement unit tests.3. Lab 3 – Unit TestingInformational: Lab 3 will cover unit testing and code coverage in C#/Visual Studio. The documentationbelow will give you a quick start, but you will learn more during Lab. You are encouraged to bringquestions to the Lab as well.Further, Lab 3 will introduce you to the tools necessary to determine how much of your code is “covered”by tests.4. Overview – Dependency Graph At this point in your career, you should be familiar with the idea behind a graph. A graph representsnodes and edges between the nodes. For the purpose of an example, we will use the followingspreadsheet:A1 contains the formula: A2 + A3A2 contains the formula: A3 * A4A3 contains either a value or a formula with no variables in itA4 contains either a value or a formula with no variables in it This “state” can be represented as a graph:
1/27/23, 11:19 AMAssignment Two – Dependency Graphhttps://utah.instructure.com/courses/834041/assignments/11982609?return_to=https%3A%2F%2Futah.instructure.com%2Fcalendar%23view_name%3Dmonth%26…3/15Here a box represents a (non-empty) cell in the spreadsheet and an arrow represents therelationship: must be computed before, i.e., A4 must be computed before A2. (Note: as in ourprogram, the relationship between A4 and A1 is implied, but not directly represented!) It should be noted that while the above picture correctly identifies the relationships, I find that I like tothink/visualize in terms of “top down” (i.e., do the stuff at the top, and work your way down the diagram). Thus we can rearrange the graph (without any changes to meaning) as follows, with a “top-down”hierarchy imposed. One more note: We could mirror the graph (put A4 on the left and A3 on the right)also without any change to meaning.You can interpret the arrows as the direction that computations must happen; thus A1 is dependent onA2 and A3 (A2 and A3 must be computed before A1). A2 is dependent on A3 and A4 (A3 and A4 mustbe computed before A2). The direction of the arrow is just convention.From the second view, you can also determine the order of evaluations that must take place,i.e., either A3 or A4 first, then the other (A3 or A4), then A2, and finally A1.
1/27/23, 11:19 AMAssignment Two – Dependency Graphhttps://utah.instructure.com/courses/834041/assignments/11982609?return_to=https%3A%2F%2Futah.instructure.com%2Fcalendar%23view_name%3Dmonth%26…4/15Important: you are not writing the traversal code for the graph. See the starter code (API) given belowfor the methods you are to write.5. Notation – Dependee vs DependentWe will use the terms “dependent” and “dependee” as nouns, having critical meanings that are importantnot to confuse.Dependent: (or depender) – a node that depends on another node. In the example above, A4 hasone dependent: A2. The set of A3’s dependents is {A2, A1}.Dependee: – a node that is depended upon. The set of A1’s dependees is {A2, A3}.Warning: Saying something is dependent on something else defines both the dependents and thedependees. For example, when we say: “A2 is dependent on A4”, this implies that A4’s dependents areA2 and A2’s dependees are A4. I suggest you refer to the diagram for this simple graph whenever youare puzzling over Dependee vs Dependent.To further help you, use the following defintions:1. Dependents: After : Asking for a node’s set of dependents is asking: “who depends on me?”, or”what must be calculated after this node?”2. Dependees: Before: Asking for a node’s set of dependees is asking: “who do I depend upon?”, or”what must be calculated before this node?”If a node has an empty set of dependents, then nothing is a dependent of it. There are no nodes thatmust wait for it to be computed before they are computed. A1 is such a node.If a node has an empty set of dependees, then it is a dependent of nothing. Its value can be calculatedat any time. A3 and A4 are such nodes. The full set of relationships for the example is given in the table below:CellDependentsDependeesA1{}{A2, A3}A2{A1}{A3, A4}A3{A1, A2}{}A4{A2}{}