Let G = (V, E) be a finite simple connected graph. We say a graph G realizes
a code of the type 0^s_1 1^t_1 0^s_2 1^t_2 ... 0^s_k1^t_k if and only if G can
obtained from the code by some rule. Some classes of graphs such as threshold
and chain graphs realizes a code of the above mentioned type. In this paper, we
develop some computationally feasible methods to determine some interesting
graph theoretical invariants. We present an efficient algorithm to determine
the metric dimension of threshold and chain graphs. We compute threshold
dimension and restricted threshold dimension of threshold graphs. We discuss
L(2, 1)-coloring of threshold and chain graphs. In fact, for every threshold
graph G, we establish a formula by which we can obtain the {\lambda}-chromatic
number of G. Finally, we provide an algorithm to compute the
{\lambda}-chromatic number of chain graphs