A graph G is well-covered if all its maximal independent sets are of the same cardinality. Assume that a weight function w is defined on its vertices. Then G is w-well-covered if all maximal independent sets are of the same weight, where a weight of a set is the sum of weights of its elements. For every graph G, the set of weight functions w such that G is w-well-covered is a vector space. Given an input graph G without cycles of lengths 4, 5, and 6, we characterize polynomially the vector space of weight functions w for which G is w-well-covered. Let B be an induced complete bipartite subgraph of G on vertex sets of bipartition B-X and B-Y. Assume that there exists an independent set S such that each of S boolean OR B-X and S boolean OR B-Y is a maximal independent set of G. Then B is a generating subgraph of G, and it produces the restriction w(B-X) = w(B-Y). It is easy to see that for every weight function w, if G is w-well-covered, then the above restriction is satisfied. In the special case, where B-X = {x} and B-Y = {y}, we say that xy is a relating edge. Recognizing relating edges and generating subgraphs is an NP-complete problem. However, we provide a polynomial algorithm for recognizing generating subgraphs of an input graph without cycles of lengths 5, 6 and 7. We also present a polynomial algorithm for recognizing relating edges in an input graph without cycles of lengths 5 and 6. (C) 2015 Elsevier B.V. All rights reserved.