A word splitting criterion is required for hyphonation, truncation or wrapping. Following restriction should be enough for Malayalam:
A word ...AB... can be split as:
ONLY IF A is not virama AND B is not a vowel symbol, chillu letter, anuswara or virama.
This rule has got problems with words like ദൃക്സാക്ഷി, which will not get split as ദൃക്+സാക്ഷി (the best split that can happen to this word). But this problem has more to it than just the case of word splitting. See this description.