1.0 Introduction……………………………………………………….................................................1
2.0 The Problem………………………………………………………………………………………..…….1
3.0 Testing and test data………………………………………………………………………………….6
4.0 Program Design…………………………………………………………………………………….…..6
5.0 Discussion…………………………………………………………………………………………………8
6.0 Conclusion………………………………………………………………………………………………10
7.0 References………………………………………………………………………………………………11
1.0 Introduction
The objective of this assignment is to design the network. The nodes are given, but we must decide which links to give to the network. Specifically, each potential link has a cost (different for different links) for inserting it into the network. We are required to provide enough links to provide a path between every pair of nodes. The objective is to do this in a way that minimizes the total cost of the links. Such a problem is referred to as a minimum spanning-tree problem. To find the Minimum Spanning Tree (MST), Kruskal’s algorithm is used to determine the MST path for the network. It finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all edges in the tree is minimized. If the graph is not connected, then it finds a minimum spanning forest that is a minimum spanning tree for each connected component.
2.0 The Problem
The Premiere Bank soon will be hooking up computer terminals at each of its branch offices to the computer at its main office, using special phone lines with telecommunications devices. The phone lines from a branch office need to be connected directly to the main office. It can be connected indirectly by being connected to another branch office that is connected directly or indirectly to the main office. The only requirement is that every branch office be connected by some route to the main office. The charge for the special phone lines is RM100 times the number of km involved. Management wishes to determine which pairs of offices
References: [1] Data Structure & Algorithms in Java, Micheal T. Goodrich | Roberto Tamasia, 5th edition. [2] http://en.algoritmy.net/article/43884/Kruskals-algorithm [3] http://students.ceid.upatras.gr/~papagel/project/pseukrus.htm [4] http://www.java-made-easy.com/java-scanner.html [5] http://en.wikipedia.org/wiki/Kruskal 's_algorithm