All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
Deserting a dissolute person depends on the interest that is hoped from it. If deserting him will deter him and it is hoped that he would stop his dissoluteness, then he should be deserted and one should not greet him (with the Salaam) or respond to his Salaam (if one is greeted by him) in order to deter him and rectify him.
The fatwa of Ar-Ramli from the Shaafi’i School reads, “Is it obligatory to respond to the Salaam of a dissolute person or not? It is not obligatory to respond to his greeting of Salaam if deserting him will deter him, and it is not recommended to start the Salaam greeting to him.”
However, if saying the Salaam to him will soften his heart and it is hoped that this would make him benefit from the advice, then it is more appropriate to say the Salaam to him.
In brief, this matter depends on the benefit.
Allah knows best.