Switch between considering directed or undirected edges in edge-based
algorithms