.. (לתיקייה המכילה) | ||
What should happen if we try to connect vertex v to vertex u, and they already are connected? | |
The operation should success (i.e. not result in an error or incorrect state of the system), and do nothing. |
What is the exact meaning of the "Deterministic Behavior" requirement? | |
That's actually important. For each graph, origin vertex and algorithm, the tests accept only one output (that was necessary for keeping the assignment and tests simple). The output is determined by the graph, the origin vertex and the algorithm (obviously), but also by the behavior of the neighbours message (which can be known in design time, because you are required to return the vertices in lexicographical order of the vertex names), and the behavior of open (the pdf contains a hint for the correct behavior of open). Since all these factors are known in design time, the result of a graph walk can be determined in design time. Make sure all those parts of your solution behave correctly (according to the expected results of the sample code). |
Should the solution be consistent with the graphic examples in the PDF document? | |
No. The numbers in those example represent graph walks on a graph with that general form. They are not the names of the vertices (the vertices don't have names). Since the result of the graph walks should depend on the names of the vertices (because neighbours returns the vertices in lexicographical order), there is no way to know what's the correct result for a graph with no vertex names. |