We propose a greedy algorithm which, given a hypergraph H and a positive integer k, produces a hypertree decomposition of width less than or equal to 3k −1, or determines that H does not have a generalized hypertree-width less than k. The running time of this algorithm is O(mk+2n), where m is the number of hyperedges and n is the number of vertices. If k is a constant, it is polynomial. The concepts of (generalized) hypertree decomposition and (generalized) hypertree-width were introduced by Gottlob et al. Many important NP-complete problems in database theory or artificial intelligence are polynomially solvable for classes of instances associated with hypergraphs of bounded hypertree-width. Gottlob et al. also developed a polynomial time algorithm det-k-decomp which, given a hypergraph H and a constant k, computes a hypertree decomposition of width less than or equal to k if the hypertree-width of H is less than or equal to k. The running time of det-k-decomp is O(m2kn2) in the wo...