graph: ensure that children are always ordered