Putting people in prison or in mental hospitals costs a minimum of a thousand pounds a week. The same as a care home bed, and they are closing for lack of funds. So are hospices.
It seems more sensible to use modern methods of behaviour control: Put people in a single cell secure medical centre until the appropriate medication has been established.
Then implant them with long lasting doses of what is required to pacify and calm them to a point where they are apathetic, in simulated situations of what once made them a danger to themselves or others.
Long lasting contraceptive implants have been proved to work for women. Violent men are allowed to be released with essential mental health medication in the form of pills which they can choose not to take.
Let men have long lasting implants of whatever reduces testosterone plus whatever calms mental disturbance plus whatever makes them too apathetic to be bothered with fetishes or previous obsessions.
Again, women have tried weight loss drugs and have led the way in finding that it is possible to become indifferent to what was once of interest.
Body-worn recorders are now able to show if, for example, alcohol has been obtained. The old style of ankle tag could be cut off, but even a miniature tracker could be implanted if necessary. CCTV would ensure an instant alert to the nearest police patrol car, if the person left the house, or if a non-permitted individual entered. The person could in effect be under 24 hour watch, all by technology, so there would be no strain on police or probation or health staff.
The entertainment and communication available could be just as limited as in prison, so there would be no option to mix with other offenders or with potential victims, nor to use sites feeding the perversions.
Men could be under house arrest for life, or under whatever terms the court decided. It would be far cheaper, and would be more effective than putting them in prisons or mental homes together with others who could give them tips on how to plan the next offence.
There are some who are so violent they have to have several guards with them at all times. If they are not currently under a prison sentence, they are sometimes put in special accommodation, with a right to go out in public, but with a need to be accompanied. This too is absurdly unaffordable. If they are never going to be safe to the public, they must stay under house arrest for life. But if medication calms them, to a point they could be allowed out, it must be implanted, not to be voluntarily consumed or refused . And, a tracker and compulsory body-worn camera must be feeding their activities and location to an A,I. monitor.
We cannot continue pretending A.I. does not exist. Nor, pretending that prison works.