Make reduceVertex and disconnect work in directed graph