modifying buildGi in layout.py
Gi graph is now a DiGraph