[an error occurred while processing this directive]
Project 5 is due either at 12:00 midnight of the last day of class. There are no resubmissions or late submissions for Project 4; however, projects which achieve a grade less than 80 will be examined to determine if they deserve a grade great than what was actually received (to a maximum of 80).
You may use all standard libraries available on ecelinux. This includes the Standard Template Library (STL), cstring, etc.
In this sub-project, you will implement one class:
This class will implement a weighted undirected graph with Prim's algorithm.
Weighted_graph |
---|
+ create( in n:Integer = 50 ):Weighted_graph + degree( in n:Integer ):Integer + edge_count():Integer + adjacent( in m:Integer, in n:Integer ):Real + minimum_spanning_tree( in m:Integer ):Real + is_connected():Boolean + insert( in m:Integer, in n:Integer, in w:Real ) + destroy() |
This class allows the user to create and destroy an undirected weighted graph.You will be able to find the minimum span tree of a graph, using Prim's algorithm. The vertices are numbered 0 through n − 1 where n is the argument to the constructor.
You may define whatever member variables you wish.
Weighted_graph( int n = 50 )
Construct a weighted undirected graph with n vertices (by default, 50).
Clean up any allocated memory.
This class has four accessors:
This class has one mutator: