Assume a sufficiently large population of rats (to allow genetic variation and facilitate inbreeding) in a place with abundant water, sunlight, shelter but no food. For how many generations can this population persist solely by cannibalizing?
Here's a back of the envelope answer: one generation if you have a LOT of rats.
Numbers according to the Great State if Indiana.
Assuming also that we start with adult breeding rats. 50% females / 50% males.
The gestation period is 21 days. The adult rat can eat 1/3 of its body weight each day. Assuming that the rat is eating about 80% of the 'victim' rat body weight, the colony reduces in size about 40% each day.
Lets say the rats are going to be a bit hungry and the colony loses 30% of its size each day. And they don't eat their own feces, which I think they can do, but also assuming that the malnutrition from eating only rat for food will not cause problems.
Over the period of gestation, 21 days the colony will have a final size of 0.3^21 = 0.000559 times its original size. So in order to have a surviving gestating female you'd have to start with 1791 rats. Also assuming that the last rat is a very pregnant female who can compete with the male cannibals who are not pregnant.
Then the average litter is not 1790. So you'd need something like 1790^N rats for N generations. and they'd have to be pretty lucky rats to boot.
BTW similar numbers would be true for any animal including human beings. This is one reason that cannibalism is usually only a social ritual, not a means of acquiring nutrition except in extreme cases.