Generalized Baumslag-Solitar groups (GBS groups) are groups that act on trees with infinite cyclic edge and vertex stabilizers. Such an action is described by a labeled graph (essentially, the quotient graph of groups). This paper addresses the problem of determining whether two given labeled graphs define isomorphic groups; this is the isomorphism problem for GBS groups. There are two main results and some applications. First, we find necessary and sufficient conditions for a GBS group to be represented by only finitely many reduced labeled graphs. These conditions can be checked effectively from any labeled graph. Then we show that the isomorphism problem is solvable for GBS groups whose labeled graphs have first Betti number at most one.