For this assignment, you will be using RMI(Remote Method Invocation) in Java to implement a simple single server architecture with support for multiple clients. The details are as follows:
• The server maintains a list of graphs each associated with a distinct identiﬁer. • Clients can request to add a new graph, update an existing graph and query for the total weight of the minimum weight spanning tree of a given graph. • Clients can request to add a new graph using ‘add graph 〈graph identifier〉 n’. This command will add a new graph on the server with the identiﬁer graph identiﬁer and n number of nodes. The graph identiﬁer is a string with a maximum length of 10 and it won’t already exist. n will be in the range: 1 <= n <= 100,000. • Clients can request to add a new edge in a graph using ‘add edge 〈graph identifier〉 〈u〉 〈v〉 〈w〉’. This will add an undirected edge between the nodes u and v with weight w. u and v are the node numbers of the endpoints of the edge such that 1 <= u,v <= n and 0 <= w <= 10,000. n is the number of nodes in the speciﬁed graph. A graph with identiﬁer graph identiﬁer will already exist. There can be multiple edges and self-loops added to the graph.
• Clients can request for the total weight of the minimum weight spanning tree in a graph from the server using ‘get mst 〈graph identifier〉’. The client will print the solution the server returns. In case the graph does not have a spanning tree, -1 should be printed. A graph with identiﬁer graph identiﬁer will already exist. • All values should ﬁt in 32-bit signed integers. • The server should be able to handle multiple clients simultaneously and should also work with clients on other machines. • You are free to use any algorithm for MST.