A color-coding method in which the vertices of a graph are randomly colored using colors is introduced. The method was originally intended to design algorithms for finding paths and cycles. Using this method, the authors found that a path of length k can be found in a digraph G = ( V , E ) in 2 O ( k ) | E | expected time, and such a path can be found in 2 O ( k ) | V | expected time in an undirected graph. A cycle of length k can be found in 2 O ( k ) | V | &ohgr;log | V | expected time for &ohgr; < 2.376.
This color-coding method can also be used to solve many other problems. It is known that many special cases of the subgraph isomorphism problem can be solved in polynomial time, although the general problem is NP-complete. This method allows us to extend the class of subgraph isomorphism cases that can be solved in polynomial time and to solve some cases already belonging to this class more efficiently.
The authors also describe how their algorithms can be derandomized. This is accomplished by creating a set of perfect hash functions from { 1 , 2 ,..., | V | } to { 1 , 2 ,..., k }. The derandomized algorithms are less efficient than their randomized counterparts, but the difference is small.