_id -> getid. bug fixed
add directd graph and topological sort