Implementation of Nagamochi Ibaraki Algorithm