Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Paths and Polynomials

869 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Paths and Polynomials

  1. 1. Paths & Polynomials
  2. 2. Hamiltonian Path has an algorithm that spends O(2n) time and consumes O(2n) space.
  3. 3. Walks to the rescue…
  4. 4. Walks to the rescue…
  5. 5. Walks to the rescue…
  6. 6. Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G.
  7. 7. Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G.
  8. 8. Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G.
  9. 9. Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G.
  10. 10. Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G. What is A2[i,j]?
  11. 11. Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G. What is A2[i,j]?
  12. 12. i j Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G. What is A2[i,j]?
  13. 13. i j Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G. What is A2[i,j]?
  14. 14. i j Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G. What is A2[i,j]?
  15. 15. i j Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G. What is A2[i,j]?
  16. 16. i j Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G. What is A2[i,j]?
  17. 17. i j Adjacency Matrix A[i,j] = 1 iff (i,j) is an edge in G. What is A2[i,j]?
  18. 18. What is A2[i,j] counts the number of common neighbors of i and j.
  19. 19. What is A2[i,j] counts the number of common neighbors of i and j. What is Ak[i,j]?
  20. 20. What is A2[i,j] counts the number of common neighbors of i and j. What is Ak[i,j]? What is Ak[i,j] counts the number of walks of length k between i and j.
  21. 21. We know how to count walks!
  22. 22. We know how to count walks! Suppose we now want to count paths.
  23. 23. We know how to count walks! Suppose we now want to count paths. Let U be the collection of all Hamiltonian Walks.
  24. 24. We know how to count walks! Suppose we now want to count paths. Let U be the collection of all Hamiltonian Walks. Let Ai be the set of walks of length n passing through i.
  25. 25. Consider… n X= Ai i=1 Let U be the collection of all Hamiltonian Walks. Let Ai be the set of walks of length n passing through i.
  26. 26. Consider… n X=U Ai i=1 Let U be the collection of all Hamiltonian Walks. Let Ai be the set of walks of length n passing through i.
  27. 27. Consider… n X=U Ai i=1 Let U be the collection of all Hamiltonian Walks. Let Ai be the set of walks of length n passing through i.
  28. 28. Consider… n X=U Ai i=1 Let U be the collection of all Hamiltonian Walks. Let Ai be the set of walks of length n passing through i. The set of walks that avoid i.
  29. 29. Consider… n X=U Ai i=1 |Z| |X| = |U| ( 1) Z [n] Ai i Z Let U be the collection of all Hamiltonian Walks. Let Ai be the set of walks of length n passing through i. The set of walks that avoid i.
  30. 30. Consider… n X=U Ai i=1 |Z| |X| = |U| ( 1) Z [n] Ai i Z Let U be the collection of all Hamiltonian Walks. Let Ai be the set of walks of length n passing through i. The set of walks that avoid i.
  31. 31. Consider… n X=U Ai i=1 |Z| |X| = |U| ( 1) Z [n] Ai i Z Let U be the collection of all Hamiltonian Walks. Let Ai be the set of walks of length n passing through i. The set of walks that avoid i. The set of walks that avoid X.
  32. 32. Consider… n X=U Ai i=1 |Z| |X| = |U| ( 1) Z [n] Ai i Z Let U be the collection of all Hamiltonian Walks. Let Ai be the set of walks of length n passing through i. The set of walks that avoid i. The set of walks that avoid X.
  33. 33. Polynomial Identity Testing Input: A polynomial p(x). Question: Is p(x) identically zero? (x1 + 3x2 x3 )(3x1 + x4 1) · · · (x7 x2 ) 0?
  34. 34. Polynomial Identity Testing Input: A polynomial p(x). Question: Is p(x) identically zero? (x1 + 3x2 x3 )(3x1 + x4 1) · · · (x7 x2 ) 0? Captures several problems, like checking if two polynomials are equal, finding a perfect matching, primality testing, and so on.
  35. 35. Basic Idea (x1 + 3x2 x3 )(3x1 + x4 1) · · · (x7 x2 ) Simplifying is expensive, but evaluating is cheap. 0?
  36. 36. Basic Idea (x1 + 3x2 x3 )(3x1 + x4 1) · · · (x7 x2 ) Simplifying is expensive, but evaluating is cheap. The probability that a random assignment corresponds to a root is low. 0?
  37. 37. Given a (directed) graph G and a number k… ! ! ! Let’s try to construct a polynomial that is zero ! if and only if ! G has a path of length k.
  38. 38. x[v1,2 ]x[v2,3 ] · ·2,3 ] · k· x[vk 1,k]y[v2 ] · · · 2 ] · · ·]y[vk ] x[v1,2 ]x[v · x[v· 1,k ]y[v1 1 ]y[v y[vk Edges Vertices
  39. 39. x[v1,2 ]x[v2,3 ] · ·2,3 ] · k· x[vk 1,k]y[v2 ] · · · 2 ] · · ·]y[vk ] x[v1,2 ]x[v · x[v· 1,k ]y[v1 1 ]y[v y[vk Edges Vertices We want terms corresponding to walks to cancel out,
  40. 40. x[v1,2 ]x[v2,3 ] · ·2,3 ] · k· x[vk 1,k]y[v2 ] · · · 2 ] · · ·]y[vk ] x[v1,2 ]x[v · x[v· 1,k ]y[v1 1 ]y[v y[vk Edges Vertices We want terms corresponding to walks to cancel out, somehow.
  41. 41. The Trick
  42. 42. Evaluate these polynomials over finite fields of characteristic two.
  43. 43. Evaluate these polynomials over finite fields of characteristic two. a+a=0
  44. 44. x[v1,2 ]x[v2,3 ] · ·2,3 ] · k· x[vk 1,k]y[v2 ] · · · 2 ] · · ·]y[vk ] x[v1,2 ]x[v · x[v· 1,k ]y[v1 1 ]y[v y[vk Edges Vertices
  45. 45. x[v1,2 ]x[v2,3 ] · ·2,3 ] · k· x[vk 1,k]y[v2 ] · · · 2 ] · · ·]y[vk ] x[v1,2 ]x[v · x[v· 1,k ]y[v1 1 ]y[v y[vk Edges 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] Vertices
  46. 46. x[v1,2 ]x[v2,3 ] · ·2,3 ] · k· x[vk 1,k]y[v2 ] · · · 2 ] · · ·]y[vk ] x[v1,2 ]x[v · x[v· 1,k ]y[v1 1 ]y[v y[vk Edges 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] Vertices
  47. 47. x[v1,2 ]x[v2,3 ] · ·2,3 ] · k· x[vk 1,k]y[v2 ] · · · 2 ] · · ·]y[vk ] x[v1,2 ]x[v · x[v· 1,k ]y[v1 1 ]y[v y[vk Edges 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] Vertices
  48. 48. x[v1,2 ]x[v2,3 ] · ·2,3 ] · k· x[vk 1,k]y[v2 ] · · · 2 ] · · ·]y[vk ] x[v1,2 ]x[v · x[v· 1,k ]y[v1 1 ]y[v y[vk Edges 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] Vertices
  49. 49. x[v1,2 ]x[v2,3 ] · ·2,3 ] · k· x[vk 1,k]y[v2 ] · · · 2 ] · · ·]y[vk ] x[v1,2 ]x[v · x[v· 1,k ]y[v1 1 ]y[v y[vk Edges 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] 1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 ]y[v2 ] · · · y[vk ] Vertices
  50. 50. For a walk W, we will dump all these terms into the formula:
  51. 51. For a walk W, we will dump all these terms into the formula: :[k] [k] x[v1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 , (1)]y[v2 , (2)] · · · y[vk , (k)]
  52. 52. For a walk W, we will dump all these terms into the formula: :[k] [k] x[v1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 , (1)]y[v2 , (2)] · · · y[vk , (k)] Sum this over all walks W:
  53. 53. For a walk W, we will dump all these terms into the formula: :[k] [k] x[v1,2 ]x[v2,3 ] · · · x[vk 1,k ]y[v1 , (1)]y[v2 , (2)] · · · y[vk , (k)] Sum this over all walks W: (W, ) W:=v1 ,...,vk
  54. 54. This polynomial captures exactly the paths in G, i.e, it is identically zero precisely when G has no paths of length k.
  55. 55. (W, ) W:=v1 ,...,vk
  56. 56. (W, ) W:=v1 ,...,vk How do we evaluate this polynomial now?
  57. 57. (W, ) W:=v1 ,...,vk How do we evaluate this polynomial now?
  58. 58. Inclusion Exclusion RELOADED

×