notes20b

From wehave 25 135 24 356 124 4

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: ew edge list is: 1,2,6 , 1,5,2 , 2,3,4 , 2,5,5 , 3,4,7 , 4,5,1 , 4,6,3 Adjacency List neighbours , neighbours , … , neighbours , where neighbours is a list of all vertices adjacent to . From ∗ , we have: 2,5 , 1,3,5 , 2,4 , 3,5,6 , 1,2,4 , 4 We can add edge weights by tupling them with the neighbours. For example, vertex 1 has neighbours 2 and 5. Edge 1,2 has weight 6 and edge 1,5 has weight 2, so the tupled list of neighbours is 2,6 , 5,2 . Our new adjacency list is: 2,6 , 5,2 , 1,6 , 3,4 , 5,5 , 2,4 , 4,7 , 3,7 , 5,1 , 6,3 , 1,2 , 2,5 , 4,1 , 4,3 Adjacency Matrix matrix where 1, 1 0 so 0 1 1 1, 1 03 0, 1 3...
View Full Document

This note was uploaded on 02/04/2014 for the course CS 234 taught by Professor Baranoski during the Spring '09 term at Waterloo.

Ask a homework question - tutors are online