lecture6

# lecture6 - CSci 5403 COMPLEXITY THEORY LECTURE VI SPACE...

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

1 COMPLEXITY THEORY CSci 5403 LECTURE VI: SPACE COMPLEXITY AND MORE CENTRAL QUESTIONS PSPACE = SPACE(n k ) k N NPSPACE = NSPACE(n k ) k N PSPACE = NPSPACE REALLY SMALL SPACE L = SPACE(log n) NL = NSPACE(log n) Problems in L can be solved in log space. Problems in NL can be solved nondeterministically in log space. Minor detail: for SPACE(o(n)), need to consider programs with a read-only input tape and a read-write work tape . e.g. 2-tape TM, with transition function δ : Q £ Γ £ Γ ! Q £ {S,L,R} £ {S,L,R} £ Γ . Example. FVAL, SSUM, CHECKHAM 2 L, where: FVAL = { ʪ φ , x ʫ | φ (x) = 1 } SSUM = { ʪ y 1 ,…,y n ,b 1 ,…,b n ,t ʫ | y i b i = t } CHECKHAM = { ʪ G,C ʫ | C is a Ham. cycle in G }

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

View Full Document
2 STCONN IS IN P has_path(G,s,t): marked = {s} queue = [s] while not queue.empty(): u = queue.pop_front() for v in G.neighbors(u): if v marked: marked += {v} queue.push_back(v) if t ˥ marked: return True else: return False 1 2 3 4 Total SPACE Complexity: O(n ) 5 6 7 STCONN = { ʪ G,s,t ʫ | G has a path from s to t} STCONN IS IN NL has_path(G,s,t) = i = 0; v_current = s; while i < n: v_next = guess(); if (v_current, v_next) G.edges: return False else: i = i+1 if v_next = t: return True v_current = v_next else: return False 1 2 3 4 Total SPACE Complexity: O(log n ) 5 6 7 STCONN IS IN L 2 has_path(G,s,t,n) = if (n=1): if s=t: return True else if (s,t) 2 G.E: return True else: return False for mid 2 G.V: if has_path(G,s,mid,n/2) and has_path(G,mid,t, n/2): return True else: return False 1 2 3 4 Total SPACE Complexity:
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

lecture6 - CSci 5403 COMPLEXITY THEORY LECTURE VI SPACE...

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

View Full Document
Ask a homework question - tutors are online