Balanced hashing, color coding and approximate counting

Noga Alon, Shai Gutner

Research output: Chapter in Book/Report/Conference proceedingConference contribution

21 Scopus citations


Color Coding is an algorithmic technique for deciding efficiently if a given input graph contains a path of a given length (or another small subgraph of constant tree-width). Applications of the method in computational biology motivate the study of similar algorithms for counting the number of copies of a given subgraph. While it is unlikely that exact counting of this type can be performed efficiently, as the problem is #W[1]-complete even for paths, approximate counting is possible, and leads to the investigation of an intriguing variant of families of perfect hash functions. A family of functions from [n] to [k] is an (ε,k)-balanced family of hash functions, if there exists a positive T so that for every K ⊂ [n] of size |K| = k, the number of functions in the family that are one-to-one on K is between (1 - ε)T and (1 + ε)T. The family is perfectly k-balanced if it is (0,k)-balanced. We show that every such perfectly k-balanced family is of size at least c(k)n [k/2], and that for every ε > 1/poly(k) there are explicit constructions of (ε,k)-balanced families of hash functions from [n] to [k] of size e(1+o(1))k logn. This is tight up to the o(1)-term in the exponent, and supplies deterministic polynomial time algorithms for approximately counting the number of paths or cycles of a specified length k (or copies of any graph H with k vertices and bounded tree-width) in a given input graph of size n, up to relative error ε, for all k ≤ O(logn).

Original languageEnglish (US)
Title of host publicationParameterized and Exact Computation - 4th International Workshop, IWPEC 2009, Revised Selected Papers
Number of pages16
StatePublished - 2009
Externally publishedYes
Event4th International Workshop on Parameterized and Exact Computation, IWPEC 2009 - Copenhagen, Denmark
Duration: Sep 10 2009Sep 11 2009

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume5917 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349


Other4th International Workshop on Parameterized and Exact Computation, IWPEC 2009

All Science Journal Classification (ASJC) codes

  • Theoretical Computer Science
  • General Computer Science


  • Approximate counting of subgraphs
  • Color-coding
  • Derandomization
  • Expanders
  • K-wise independence
  • Perfect hashing


Dive into the research topics of 'Balanced hashing, color coding and approximate counting'. Together they form a unique fingerprint.

Cite this