D4-Minimum Edit Cost