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(m k+2 n), 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(m 2k n 2 ) in the worst case, where m and n are the number of hyperedges and the number of vertices, respectively. The proposed algorithm is faster than this. The key step of our algorithm is checking whether a set of hyperedges is an obstacle to a hypergraph having low generalized hypertree-width. We call such a local hypergraph structure a k-hyperconnected set. If a hypergraph contains a k-hyperconnected set with a size of at least 2k, it has hypertreewidth of at least k. Adler et al. propose another obstacle called a k-hyperlinked set. We discuss the difference between the two concepts with examples.