Is it a good practice to put the initial work and improved version (both published) in PhD thesis? Suppose for my PhD thesis, I solve problems like the following:

1) At the begining I solve one problem

2) Later, before any one improve the results, I myself improve it.

Suppose both of the papaers get published. Will it still be considered as two different problems in thesis or just a single one ? Should one avoid to do such practice and try to put the best results only in thesis.

PS: By improving I mean earlier I solve some problem under some stronger assumption and later I weaken it.
If you can connect the two methods as part of a broader narrative, then you can do so and maybe should. If the second approach entirely subsumes the first, and it doesn't benefit or motivate the discussion to show the original approach, then you can skip it. Sometimes the story is about telling a story, and sometimes it's just about the solution.