implemented [un]directed graphs