Changed to use the NetworkX method instead.