add directed/undirected list