Maximum clique and independent set problems are classical NP-full optimization problems, the solutions of which are difficult
to obtain from conventional methods. Hopfield network in neural network, which simulates the partial functions of a human
brain through the ultra-large scale parallel computation, has been proven to have potentials in solving these problems in
a reasonable period of time. The main problem of this approach is the difficulty in defining an efficient energy function
and the dynamic equation of motion for the Hopfield model. In this paper, we propose solutions to this problem by solving
two typical problems in the coloring of graphs, the maximum clique and independent set, through our refined Hopfield network
model. Both the mathematical model and the simulation algorithm are given here. It is found that the time complexity to obtain
an optimal solution can approach one order of magnitude lower than the current available solutions.