use dict to store edges.

normalize methods' name