Replace array by enum for representing edge type.