cs140-independentset

# cs140-independentset - A graph problem Maximal Independent...

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

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

View Full Document

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.

Unformatted text preview: A graph problem: Maximal Independent Set A graph problem: Maximal Independent Set 1 8 7 6 5 4 3 2 • Graph with vertices V = {1,2,…,n} • A set S of vertices is independent if no two vertices in S are neighbors. • An independent set S is maximal if it is impossible to add another vertex and stay independent • An independent set S is maximum if no other independent set has more vertices • Finding a maximum independent set is intractably difficult (NP-hard) • Finding a maximal independent set is easy, at least on one processor. The set of red vertices S = {4, 5} is independent and is maximal but not maximum Sequential Maximal Independent Set Algorithm Sequential Maximal Independent Set Algorithm 1 8 7 6 5 4 3 2 1. S = empty set; 2. for vertex v = 1 to n { 3. if (v has no neighbor in S) { 4. add v to S 5. } 6. } S = { } Sequential Maximal Independent Set Algorithm Sequential Maximal Independent Set Algorithm 1 8 7 6 5 4 3 2 1. S = empty set; 2. for vertex v = 1 to n { 3. if (v has no neighbor in S) { 4. add v to S 5. } 6. } S = { 1 } Sequential Maximal Independent Set Algorithm...
View Full Document

{[ snackBarMessage ]}

### Page1 / 12

cs140-independentset - A graph problem Maximal Independent...

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

View Full Document
Ask a homework question - tutors are online