split between undirected and directed graphs