Overview: The graph.cpp file contains two classes, Graph and GraphNode, which together allow for the representation and manipulation of an undirected graph containing up to some specified number of nodes (currently set to 256, via the MAX_GRAPH_SIZE definition). There is also a simple main() function which creates the graph that needs to be colored in order to complete the basic part of this project, as well as a framework in place to help students get started in their implementation of the coloring algorithm. Compilation: This code has been shown to compile using g++ 3.2.3 on Windows XP Professional SP2, and should compile equally well on Linux using the same (or newer) version of g++. It should also compile in MS Visual Studio, but this has not been tested or verified. When using g++, the invocation is "g++ graph.cpp". Usage: In its current state, the code requires no user-interaction. If compiled with the above command, the program may then be run by typing "a.exe" (on Windows), or "./a.out" (on Linux). You will then see some information about the test graph printed to your console, and the program will terminate. Please see the second to the last paragraph in the "Specifications" section for more information on how the program works. Specifications: The GraphNode class represents a single node in a graph, and stores data about the nodes that are connected to this node by using an adjacency list notation. The adjacency list is defined as an integer array of size MAX_GRAPH_SIZE (currently 256), which works nicely because even in a maximally connected graph containing 256 nodes, each node will only have 255 entries in its adjacency list. Note that a node should never be specified as being adjacent to itself (so 'node 0' should not appear in node 0's adjacency list), and that because we are using an undirected graph, our links must be commutative (so if 'node 0' has 'node 1' and 'node 2' in its adjacency list, then both 'node 1' and 'node 2' *must* have 'node 0' in their lists)...if this property is not enforced in our graph layout, then we no longer have an undirected graph. The Graph class encapsulates an array of GraphNodes (currently of size 256), and provides public member functions to allow for their retrieval and manipulation. Note that the default value defined as MAX_GRAPH_SIZE should be more than adequate for the purposes of this project, and should not need to be changed. Both classes provide a constructor which will create an 'empty' instance of the class (i.e. a GraphNode with no entries in its adjacency list and a Graph with no entries in its internal GraphNode array), as well as a constructor which lets you specify the field values to be applied to the instantiated member of the class. Because no dynamic memory allocation is used, neither class has a destructor defined. Both classes also provide public member functions that allow the insertion, deletion, and modification of data fields as deemed appropriate to the given context. It should also be noted that while functional, neither of these classes should be considered to be 'perfect,' and each one could use a little bit of improvement. For example, in each class, the 'insert' function will fail silently if an attempt is made to insert to a list that is already full, and it would be much better if this function were modified so that it returned an error code (or at least printed an error message) instead of just failing silently. Additionally, each class has a method which will return a pointer to the internal array that the class manages, and because the pointer allows for direct manipulation of the classes' internal, private data member from outside of the class, this breaks encapsulation (and requires that you be careful with how you use this pointer), and it would be better if these methods were either removed, or modified so that they no longer broke encapsulation. The existing code in main() creates an empty graph and sets up a list of 10 different colors which can be used to color the graph (which is more than are needed for coloring the base assignment), and then proceeds to construct the graph pictured in the graph.jpg file that accompanies the assignment. After the graph is set up, it is printed to stdout, and then the colorizeGraph() function is invoked on it. Note that this function currently *does not do what it is supposed to do* (you must modify it so that it does), and instead just assigns a color of 'red' to the first node in the graph and then returns. After the function returns, the graph is then printed out again (ultimately to show that colors that got assigned to each node). For easire distribution and compilation, the code for both classes and the main() program is in a single monolithic file. You may wish to break it up into smaller files once you have it on your PC, but this is at your discretion. Known Issues: Aside from the aforementioned silent error condition when inserting to a full list, and the methods that break encapsulation by returning s pointer, there are none, although it should be noted that these classes have *not* been thoroughly tested.