Prims algorithm for minimum spanning tree, Programming Languages

Implement the Prim's algorithm with array data structure as described in slide 12 of the file 04mst.ppt. Your program should have a runtime complexity of O(n2) and should be as efficient as possible. It should be able to handle up to 6K nodes and 18M edges. Please use adjacency list to represent the graph.  You may use either C or C++ for the implementation.   

The input weighted undirected graph is specified in a text file in the format below:  

  <# of nodes>

  <# of edges>

 

  ...

   

For example, the following file describes a graph with 3 nodes (indexed 1, 2 and 3) and 2 edges ({1,2} with weigth 0.5 and {2,3} with weight 2.2).

   3

  2

  1 2 0.5

  2 3 2.2  

For the output, your program should display the total weight of the MST and write a file representing the MST in the same format as the input file above. 

Several graphs will be posted to test your program. Please make a table to report, for each graph posted, the number of nodes in the graph, the number of edges in the graph, the runtime, and the total weight of the MST. Please also report the processor model and clock frequency of the machine that you use to obtain the runtime. Please email a zip file named prog01-prim.zip containing your source code and all output files to the TA.

 

Posted Date: 2/19/2013 8:18:42 AM | Location : United States







Related Discussions:- Prims algorithm for minimum spanning tree, Assignment Help, Ask Question on Prims algorithm for minimum spanning tree, Get Answer, Expert's Help, Prims algorithm for minimum spanning tree Discussions

Write discussion on Prims algorithm for minimum spanning tree
Your posts are moderated
Related Questions
1. Develop a Web page, indicating an ordered list of the names of your five friends. 2. Develop an HTML document with a nested list indicating the content page of any book 3.

i need a coding to glow 8 LEDs on a port with pwm effect

Select two different architecture styles to design and implement a software system and provide its Architecture Diagrams (implement the software with java)

Write a Prolog predicate remove_nth(N,L1,L2) that is true if list L2 is just list L1 with its Nth element removed. If L1 does not have an Nth element then the predicate should fail

(a) Define a procedure called make-avl-tree which makes an AVL tree with one node. Also create another constructor build-avl-tree that creates an AVL tree from a root, left subtree

I need to finish my game project within two weeks using XNA. Would you guys can help me to finish it? Thank you

i have to make a program that encrypt a text to numbers, i don''t know what is wrong in my code, the example of what i need: text: hi >> number: 17 23

2. TEST & AND TEST is like CMP, it is used for conditional statement, and doesn’t save the answer. AND is logical multiplication. 3. INS & IN IN is used for data transfer from I/O

Explain, in your own words, how web designers can deal with CSS conflict resolution. What is the order of precedence between the different types of CSS (inline, embedded and extern

**This programming assignment is for use in the LINUX/UNIX environment!! Introduction: System administration often requires custom written programs and tools. One problem a syste