TLO5 �������&aacu

Pick any vertex as a starting vertex set call it s

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: it into E0 Find the cheapest edge in E \E0 that doesn't close a cycle with those already chosen in E0. Include it into E0. Repeat Step 2 until you reach out to every vertex of the graph (or |E0| = n –1). Minimum Spanning Tree • Prim's Algorithm 1. Pick any vertex as a starting vertex set. (Call it S). Let E0 = Φ. 2. Find the nearest neighboring vertices k∈S and p∈ N S, such that c(p,k) = min{c(i,j), i∈S, j∈ N S}. Let S←S ∪ {p}, E ← E ∪ {(p,k)}. 3. Repeat Step 2 until all vertices are in S, e.g. |S| = n. 0 0 Minimum Spanning Tree • Euler Tour – An Euler tour in an undirected graph G is a cycle using every edge exactly once. – An Euler tour in a directed graph G is a directed cycle which includes every arc exactly once. – Example • Can one find out whether or not it is possible to cross each bridge exactly once? • A connected undirected graph has an Euler tour if and only if the degree of every vertex is even. • A weakly connected directed graph has an Euler tour if and only if for any vertex v, indeg(v) = outdeg(v). Source...
View Full Document

This note was uploaded on 07/22/2013 for the course CODING 422 taught by Professor Phuongmaitramp during the Summer '10 term at Yonsei University.

Ask a homework question - tutors are online