Program_Graph - Campus Tour 4/1/2003 8:52 AM Outline and...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
4/1/2003 8:52 AM Campus Tour 1 Campus Tour 4/1/2003 8:52 AM Campus Tour 2 Outline and Reading Overview of the assignment Review ± Adjacency matrix structure (§12.2.3) ± Kruskal’s MST algorithm (§12.7.1) Partition ADT and implementatio The decorator pattern (§12.3.1) The traveling salesperson problem ± Definition ± Approximation algorithm 4/1/2003 8:52 AM Campus Tour 3 Graph Assignment Goals ± Learn and implement the adjacency matrix structure an Kruskal’s minimum spanning tree algorithm ± Understand and use the decorator pattern Your task ± Implement the adjacency matrix structure for representing a graph ± Implement Kruskal’s MST algorithm Frontend ± Computation and visualization of an approximate traveling salesperson tour 4/1/2003 8:52 AM Campus Tour 4 Adjacency Matrix Structure Edge list structure Augmented vertex objects ± Integer key (index) associated with vertex 2D-array adjacency array ± Reference to edge object for adjacent vertices ± Null for non nonadjacent vertices u v w ab 2 1 0 2 1 0 a u v w 0 1 2 b 4/1/2003 8:52 AM Campus Tour 5 Kruskal’s Algorithm The vertices are partitioned into clouds ± We start with one cloud per vertex ± Clouds are merged during the execution of the algorithm Partition ADT: ± makeSet ( o ) : create set { o } and return a locator for object o ± find ( l ) : return the set of the object with locator l ± union ( A,B )
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/02/2012 for the course CS 251 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 2

Program_Graph - Campus Tour 4/1/2003 8:52 AM Outline and...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online