Content

1 . zero Introduction………………………………………………………................................................. 1 2 . 0 The Problem……………………………………………………………………………………….. ……. one particular 3. zero Testing and test data…………………………………………………………………………………. 6 4. 0 System Design……………………………………………………………………………………. ….. 6 your five. 0 Discussion…………………………………………………………………………………………………8 6. 0 Conclusion………………………………………………………………………………………………10 7. 0 References………………………………………………………………………………………………11

1 . zero Introduction

The objective of this project is to design the network. The nodes are given, yet we must decide which links to give to the network. Specifically, each potential link has a expense (different several links) intended for inserting this into the network. We are needed to provide enough links to get a path between every couple of nodes. The aim is to accomplish this in a way that decreases the total cost of the links. These kinds of a problem is known as a minimum spanning-tree problem.

To find the Minimum Spanning Tree (MST), Kruskal's protocol is used to determine the MST route for the network. It finds a subset in the edges that forms a tree which includes every vertex, where the total weight coming from all edges in the tree is minimized. If the graph is definitely not connected, then it discovers a minimum spanning forest this is a minimum comprising tree for each and every connected aspect.

2 . 0 The Problem

The Hottest Bank rapidly will be joining computer terminals at each of its branch offices to the computer in its main workplace, using exceptional phone lines with telecommunications devices. The device lines from a part office should be connected directly to the main workplace. It can be linked indirectly because they are connected to one other branch office that is connected directly or indirectly for the main office. The only need is that just about every branch business office be connected by simply some approach to the main business office. The fee for the special phone lines is definitely RM100 times the number of kilometers involved.

Administration wishes to determine which pairs of office buildings should be directly connected by special mobile phone lines to be able to connect every branch office (directly or indirectly) towards the main business office at a minimum total cost. Listed here are the paths that have been given in the question.

Number 1

2 . 1 Part 1

Minimal spanning tree given a connected, undirected graph, a spanning woods of that chart is a subgraph that is a woods and attaches all vertices together. A single graph may have many distinct spanning tree and we could also assign a weight with each edge, the number symbolizing how undesirable it is, and use this to assign a weight to a spanning forest by computer the amount of the weights of sides in that comprising tree.

Besides that, we would like to lease phone lines to get in touch them plan each other and connect all of the Premier Bank with a minimum total price. Therefore , it should be a spanning tree, seeing that if a network is not really a tree we could always take out some ends and spend less. Note that whenever we have a path browsing all points specifically once, it is a special kind of tree. For example in the case in point below, you will find fifteen course, so whenever we have a path visiting some vertices more than once, we could always drop some ends to get a forest.

installment payments on your 2 Portion 2

Based on the distance that has been given, the picture shows the network branch of the Premier Bank and the distance between your paths. From your program, we get the total excess weight is four twenty based on the length given. Just about every kilometers need to times with 100. For example , the distance through the path under is 420. Therefore the telephone charge is RM420000 based on the distance we get. The path is definitely shown while using red series in photo below.

Physique 2

Determine 3

3. 0 Tests and check data

Finish test info are required to show that your program functions properly. The datasets and the corresponding results are to be offered in the record with eloge. Table below was the tests data. User need to put the distance by manual since I did not examine from text file.

Primary

B1

B2...

References: [1] Data Composition & Methods in Java, Micheal T. Goodrich | Roberto Tamasia, 5th model.

[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