assignment - efficient way to connect a big network

20
Project assignment Determing the most efficient way to connect the network Tom von Hegedus, Jochem Lentz, George Karlos, Zakaria Nafid, Mike Spadaru, Group 4c

Upload: xgeorgekx

Post on 20-Jul-2015

56 views

Category:

Education


1 download

TRANSCRIPT

Project assignment

Determing the most efficient way

to connect the network

Tom von Hegedus, Jochem Lentz, George Karlos,

Zakaria Nafid, Mike Spadaru,

Group 4c

Understand the problem

We have 2 problems:

• Total weight of the initial graph

• Total weight of the Minmumspanningtree

• initial weight – minimumspannigtree

weight = the solution

What do we have?

• A text document with a lot of numbers

• We know that the weighted graph has 40

vertices.

• So we need a 40x40 matrix

Import

Import["C:\\Users\\Tom\\Documents\\network.txt"]

WeightedAdjacencyGraph

• Replace all the – with ∞

• Make 40 lines with 40 numbers

WeightedAdjacencyGraph

WeightedAdjacencyGraph

WeightedAdjacency Matrix

• WeightedAdjacencyMatrix[m] // MatrixForm

• VertexList[m];

TableForm

[Normal@WeightedAdjacencyMatrix[m],

TableHeadings®{c=Style[#,Blue]&/@%,c}]

Initial Graph Weight

• The weight of the initial graph is 261,832

MinimumSpanningTree• Problems with Mathematica

• We used Prims algorithm on table by hand

Wrong !!!

Prims Algorithm

Minimum Spanning Tree

Weight

• The Weight of the Minimumspanningtree

is 2153

Solution

• Initial Graph Weight –

MinimumSpanningTree Weight = solution

• 261,832 – 2153= 259,679

Problems

• The only problem was to get a

MinimumSpanningTree in Mathematica

Solution strategies/ Algorithms/

tools

• Divide the problem into sub problems

• Prim’s Algorithm

• We used the site of Mathematica a lot

Time spent on problem

• About 20 to 25 hours per person.

Conclusion

• Not very hard project

• Problems with MinimumSpanningTree[]

function in Mathematica

Thank you!