implement transition segment ratio correction in all dp algorithms