graph-ug2dag function

Coerce between undirected and directed graphs when possible