[an error occurred while processing this directive] [an error occurred while processing this directive]
[an error occurred while processing this directive] Skip to the content of the web site.You may use all standard libraries available on ecelinux. This includes the Standard Template Library (STL), cstring, etc. However, if you want to compete for the fastest implementations that get a prize, you should restrict yourself to using operations like std::swap and other reasonably straight-forward features. Do not use any of the containers if you want to compete..
In this sub-project, you will implement one class:
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 + distance( in m:Integer, in n:Integer ):Real + 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 shortest distance between two connected vertices. 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 an undirected graph with n vertices (by default, 50). If n ≤ 0, use n = 1.
Clean up any allocated memory.
This class has three accessors:
This class has two mutators: