{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Program_Graph

# Program_Graph - Campus Tour 8:52 AM Outline and Reading...

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

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 )

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

Program_Graph - Campus Tour 8:52 AM Outline and Reading...

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

View Full Document
Ask a homework question - tutors are online