Let G = (V, E) be a connected graph. For a symmetric, integer-valued function delta on V x V, where K is an integer constant, N-0 is the set of nonnegative integers, and Z is the set of integers, we define a C-mapping F: V x V x N-0 --> Z by F(u, v, m) = delta(u, v) + m - K. A coloring c of G is an F-coloring if F(u, v, \c(u) - c(v)\) greater than or equal to 0 for every two distinct vertices u and v of G. The maximum color assigned by c to a vertex of G is the value of c, and the F-chromatic number F(G) is the minimum value among all F-colorings of G. For an ordering s: v(1), v(2),...,v(n) of the vertices of G, a greedy F-coloring c of s is defined by (1) c(v(1)) = 1 and (2) for each i with 1 less than or equal to i < n, c(v(1 divided by 1)) is the smallest positive integer p such that F(v(j), v(i + 1), \c(v(j)) - p) greater than or equal to 0, for each j with 1 less than or equal to j less than or equal to i. The greedy F-chromatic number gF(s) of s is the maximum color assigned by c to a vertex of G. The greedy F-chromatic number of G is gF(G) = min{gF(s)} over all orderings s of V. The Grundy F-chromatic number is GF(G) = max{gF(s)} over all orderings s of V. It is shown that gF(G) = F(G) for every graph G and every F-coloring defined on G. The parameters gF(G) and GF(G) are studied and compared for a special case of the C-mapping F on a connected graph G, where delta(u, v) is the distance between u and v and K = 1 + diam G. (C) 2003 Elsevier B.V. All rights reserved.